@Override public synchronized void start() throws Exception { switch (state) { case NONE: throw new IllegalStateException("not initialized"); case STARTED: throw new IllegalStateException("started already"); case DESTROYED: throw new IllegalStateException("can't start after destruction"); default: break; } final File configFile = findConfigFile(this.configFile, DEFAULT_CONFIG_FILE); final CentralDogma dogma; if (configFile == null) { dogma = new CentralDogmaBuilder(DEFAULT_DATA_DIR).build(); } else { dogma = CentralDogma.forConfig(configFile); } dogma.start().get(); this.dogma = dogma; state = State.STARTED; }
@Override public synchronized void start() throws Exception { switch (state) { case NONE: throw new IllegalStateException("not initialized"); case STARTED: throw new IllegalStateException("started already"); case DESTROYED: throw new IllegalStateException("can't start after destruction"); default: break; } final File configFile = findConfigFile(this.configFile, DEFAULT_CONFIG_FILE); final CentralDogma dogma; if (configFile == null) { dogma = new CentralDogmaBuilder(DEFAULT_DATA_DIR).build(); } else { dogma = CentralDogma.forConfig(configFile); } dogma.start().get(); this.dogma = dogma; state = State.STARTED; }
@Override public synchronized void start() throws Exception { switch (state) { case NONE: throw new IllegalStateException("not initialized"); case STARTED: throw new IllegalStateException("started already"); case DESTROYED: throw new IllegalStateException("can't start after destruction"); default: break; } final File configFile = findConfigFile(this.configFile, DEFAULT_CONFIG_FILE); final File securityConfigFile = findConfigFile(this.securityConfigFile, DEFAULT_SECURITY_CONFIG_FILE); final Ini securityConfig = securityConfigFile != null ? Ini.fromResourcePath(securityConfigFile.getPath()) : null; final CentralDogma dogma; if (configFile == null) { dogma = new CentralDogmaBuilder(DEFAULT_DATA_DIR).build(); } else { dogma = CentralDogma.forConfig(configFile, securityConfig); } dogma.start().get(); this.dogma = dogma; state = State.STARTED; }