private void transition() { transition(true); }
private void transition() { transition(true); }
private void transition() { transition(true); }
/** * Stop a managed server. */ protected synchronized void stop() { final InternalState required = this.requiredState; if(required != InternalState.STOPPED) { this.requiredState = InternalState.STOPPED; ROOT_LOGGER.stoppingServer(serverName); // Transition, but don't wait for async notifications to complete transition(false); } }
/** * Start a managed server. */ protected synchronized void start() { final InternalState required = this.requiredState; // Ignore if the server is already started if(required == InternalState.SERVER_STARTED) { return; } // In case the server failed to start, try to start it again if(required != InternalState.FAILED) { final InternalState current = this.internalState; if(current != required) { // TODO this perhaps should wait? throw new IllegalStateException(); } } this.requiredState = InternalState.SERVER_STARTED; ROOT_LOGGER.startingServer(serverName); transition(); }
/** * Finish a state transition from a notification. * * @param current * @param next */ private synchronized void finishTransition(final InternalState current, final InternalState next) { internalSetState(getTransitionTask(next), current, next); transition(); }
/** * Finish a state transition from a notification. * * @param current * @param next */ private synchronized void finishTransition(final InternalState current, final InternalState next) { internalSetState(getTransitionTask(next), current, next); transition(); }
/** * Finish a state transition from a notification. * * @param current * @param next */ private synchronized void finishTransition(final InternalState current, final InternalState next) { internalSetState(getTransitionTask(next), current, next); transition(); }
/** * Stop a managed server. */ synchronized void stop(Integer timeout) { final InternalState required = this.requiredState; if(required != InternalState.STOPPED) { this.requiredState = InternalState.STOPPED; ROOT_LOGGER.stoppingServer(serverName); // Only send the stop operation if the server is started if (internalState == InternalState.SERVER_STARTED) { internalSetState(new ServerStopTask(timeout), internalState, InternalState.PROCESS_STOPPING); } else { transition(false); } } }
/** * Stop a managed server. */ synchronized void stop(Integer timeout) { final InternalState required = this.requiredState; if(required != InternalState.STOPPED) { this.requiredState = InternalState.STOPPED; ROOT_LOGGER.stoppingServer(serverName); // Only send the stop operation if the server is started if (internalState == InternalState.SERVER_STARTED) { internalSetState(new ServerStopTask(timeout), internalState, InternalState.PROCESS_STOPPING); } else { transition(false); } } }
/** * Start a managed server. * * @param factory the boot command factory */ synchronized void start(final ManagedServerBootCmdFactory factory) { final InternalState required = this.requiredState; // Ignore if the server is already started if(required == InternalState.SERVER_STARTED) { return; } // In case the server failed to start, try to start it again if(required != InternalState.FAILED) { final InternalState current = this.internalState; if(current != required) { // TODO this perhaps should wait? throw new IllegalStateException(); } } operationID = CurrentOperationIdHolder.getCurrentOperationID(); bootConfiguration = factory.createConfiguration(); requiredState = InternalState.SERVER_STARTED; ROOT_LOGGER.startingServer(serverName); transition(); }
/** * Start a managed server. * * @param factory the boot command factory */ synchronized void start(final ManagedServerBootCmdFactory factory) { final InternalState required = this.requiredState; // Ignore if the server is already started if(required == InternalState.SERVER_STARTED) { return; } // In case the server failed to start, try to start it again if(required != InternalState.FAILED) { final InternalState current = this.internalState; if(current != required) { // TODO this perhaps should wait? throw new IllegalStateException(); } } operationID = CurrentOperationIdHolder.getCurrentOperationID(); bootConfiguration = factory.createConfiguration(); requiredState = InternalState.SERVER_STARTED; ROOT_LOGGER.startingServer(serverName); transition(); }