Skip to content

Commit

Permalink
0002617: Allow user into web console as soon as one engine initializes
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed May 27, 2016
1 parent 3df0a2c commit 744e10b
Showing 1 changed file with 19 additions and 1 deletion.
Expand Up @@ -377,6 +377,19 @@ public boolean areEnginesStarting() {
return !holderHasBeenStarted || enginesStarting.size() > 0;
}

public boolean hasAnyEngineInitialized() {
if (enginesStarting.size() < engines.size()) {
return true;
}
for (EngineStarter starter : enginesStarting) {
ISymmetricEngine engine = starter.getEngine();
if (engine != null && engine.isInitialized()) {
return true;
}
}
return false;
}

public String getEngineName(Properties properties) {
String engineName = properties.getProperty(ParameterConstants.ENGINE_NAME);
if (StringUtils.isBlank(engineName)) {
Expand Down Expand Up @@ -450,6 +463,7 @@ public static Date getCreateTime() {
class EngineStarter extends Thread {

String propertiesFile;
ISymmetricEngine engine;

public EngineStarter(String propertiesFile) {
super("symmetric-engine-startup-"+threadNumber++);
Expand All @@ -458,12 +472,16 @@ public EngineStarter(String propertiesFile) {

@Override
public void run() {
ISymmetricEngine engine = create(propertiesFile);
engine = create(propertiesFile);
if (engine != null && autoStart &&
engine.getParameterService().is(ParameterConstants.AUTO_START_ENGINE)) {
engine.start();
}
enginesStarting.remove(this);
}

public ISymmetricEngine getEngine() {
return engine;
}
}
}

0 comments on commit 744e10b

Please sign in to comment.