protected final RunningState doStart() throws Exception { RunningState state = null; try { stateLock.lock(); if (this.state.get() == State.RESTORING) { throw new IllegalStateException(JcrI18n.repositoryIsBeingRestoredAndCannotBeStarted.text(getName())); } state = this.runningState.get(); if (state == null) { // start the repository by creating the running state ... this.state.set(State.STARTING); state = new RunningState(); this.runningState.compareAndSet(null, state); state.completeInitialization(); this.state.set(State.RUNNING); state.postInitialize(); } return state; } catch (Exception e) { // we should set the state to NOT_RUNNING regardless of the error/exception that occurs this.state.set(State.NOT_RUNNING); throw e; } finally { stateLock.unlock(); } }
protected final RunningState doStart() throws Exception { RunningState state = null; try { stateLock.lock(); if (this.state.get() == State.RESTORING) { throw new IllegalStateException(JcrI18n.repositoryIsBeingRestoredAndCannotBeStarted.text(getName())); } state = this.runningState.get(); if (state == null) { // start the repository by creating the running state ... this.state.set(State.STARTING); state = new RunningState(); this.runningState.compareAndSet(null, state); state.completeInitialization(); this.state.set(State.RUNNING); state.postInitialize(); } return state; } catch (Exception e) { // we should set the state to NOT_RUNNING regardless of the error/exception that occurs this.state.set(State.NOT_RUNNING); throw e; } finally { stateLock.unlock(); } }
assert state.get() == State.RUNNING; RunningState newState = new RunningState(oldState, configChanges); this.runningState.set(newState);
assert state.get() == State.RUNNING; RunningState newState = new RunningState(oldState, configChanges); this.runningState.set(newState);