Ejemplo n.º 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);
   }
 }
Ejemplo n.º 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);
   }
 }
Ejemplo n.º 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);
     }
   }
 }
Ejemplo n.º 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);
   }
 }
Ejemplo n.º 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);
   }
 }