public void running() { ServiceManager.ServiceManagerState state = (ServiceManager.ServiceManagerState) this.state.get(); if (state != null) { state.transitionService(this.service, Service.State.STARTING, Service.State.RUNNING); } }
public void stopping(Service.State from) { ServiceManager.ServiceManagerState state = (ServiceManager.ServiceManagerState) this.state.get(); if (state != null) { state.transitionService(this.service, from, Service.State.STOPPING); } }
public void starting() { ServiceManager.ServiceManagerState state = (ServiceManager.ServiceManagerState) this.state.get(); if (state != null) { state.transitionService(this.service, Service.State.NEW, Service.State.STARTING); if (!(this.service instanceof ServiceManager.NoOpService)) { ServiceManager.logger.log(Level.FINE, "Starting {0}.", this.service); } } }
public void failed(Service.State from, Throwable failure) { ServiceManager.ServiceManagerState state = (ServiceManager.ServiceManagerState) this.state.get(); if (state != null) { if (!(this.service instanceof ServiceManager.NoOpService)) { ServiceManager.logger.log( Level.SEVERE, "Service " + this.service + " has failed in the " + from + " state.", failure); } state.transitionService(this.service, from, Service.State.FAILED); } }
public void terminated(Service.State from) { ServiceManager.ServiceManagerState state = (ServiceManager.ServiceManagerState) this.state.get(); if (state != null) { if (!(this.service instanceof ServiceManager.NoOpService)) { ServiceManager.logger.log( Level.FINE, "Service {0} has terminated. Previous state was: {1}", new Object[] {this.service, from}); } state.transitionService(this.service, from, Service.State.TERMINATED); } }