예제 #1
0
 public void running() {
   ServiceManager.ServiceManagerState state =
       (ServiceManager.ServiceManagerState) this.state.get();
   if (state != null) {
     state.transitionService(this.service, Service.State.STARTING, Service.State.RUNNING);
   }
 }
예제 #2
0
 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);
   }
 }
예제 #3
0
 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);
     }
   }
 }
예제 #4
0
 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);
   }
 }
예제 #5
0
 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);
   }
 }