@Override public void transition(ServiceController< ? extends S> controller, Transition transition) { if(transition.getAfter().equals(Substate.UP)) { serviceAvailable(); synchronized(this) { this.notifyAll(); } } else if(transition.getAfter().equals(Substate.CANCELLED)){ synchronized(this) { cancelled = true; this.notifyAll(); } } else if(transition.getAfter().equals(Substate.START_FAILED)) { synchronized (this) { failed = true; this.notifyAll(); } } }
@Override public void transition(ServiceController< ? extends S> controller, Transition transition) { if(transition.getAfter().equals(Substate.UP)) { serviceAvailable(); synchronized(this) { this.notifyAll(); } } else if(transition.getAfter().equals(Substate.CANCELLED)){ synchronized(this) { cancelled = true; this.notifyAll(); } } else if(transition.getAfter().equals(Substate.START_FAILED)) { synchronized (this) { failed = true; this.notifyAll(); } } }
@Override public void transition(ServiceController< ? extends S> controller, Transition transition) { if(transition.getAfter().equals(Substate.UP)) { serviceAvailable(); synchronized(this) { this.notifyAll(); } } else if(transition.getAfter().equals(Substate.CANCELLED)){ synchronized(this) { cancelled = true; this.notifyAll(); } } else if(transition.getAfter().equals(Substate.START_FAILED)) { synchronized (this) { failed = true; this.notifyAll(); } } }
@Override public void transition(ServiceController controller, ServiceController.Transition transition) { if (this.direction == Direction.DOWNWARDS) { if (transition.getAfter().equals(ServiceController.Substate.DOWN)) { this.direction = Direction.UPWARDS; this.controller.setMode(this.mode); } } else if (this.direction == Direction.UPWARDS) { if (transition.entersRestState()) { this.controller.removeListener(this); if (this.callback != null) { this.callback.accept(controller); } } } } }
@Override public void transition(ServiceController< ? extends S> controller, Transition transition) { if(transition.getAfter().equals(Substate.UP)) { serviceAvailable(); synchronized(this) { this.notifyAll(); } } else if(transition.getAfter().equals(Substate.CANCELLED)){ synchronized(this) { cancelled = true; this.notifyAll(); } } else if(transition.getAfter().equals(Substate.START_FAILED)) { synchronized (this) { failed = true; this.notifyAll(); } } }
@Override public void transition(ServiceController< ? extends S> controller, Transition transition) { if(transition.getAfter().equals(Substate.UP)) { serviceAvailable(); synchronized(this) { this.notifyAll(); } } else if(transition.getAfter().equals(Substate.CANCELLED)){ synchronized(this) { cancelled = true; this.notifyAll(); } } else if(transition.getAfter().equals(Substate.START_FAILED)) { synchronized (this) { failed = true; this.notifyAll(); } } }
@Override public void transition(ServiceController< ? extends S> controller, Transition transition) { if(transition.getAfter().equals(Substate.UP)) { serviceAvailable(); synchronized(this) { this.notifyAll(); } } else if(transition.getAfter().equals(Substate.CANCELLED)){ synchronized(this) { cancelled = true; this.notifyAll(); } } else if(transition.getAfter().equals(Substate.START_FAILED)) { synchronized (this) { failed = true; this.notifyAll(); } } }
@Override public void transition(final ServiceController<?> controller, final ServiceController.Transition transition) { if(transition.getAfter().equals(ServiceController.Substate.DOWN)) { controller.setMode(Mode.ACTIVE); controller.removeListener(this); } } });
@Override public void transition(ServiceController<?> controller, ServiceController.Transition transition) { if (transition.getAfter().equals(ServiceController.Substate.START_FAILED)) { log.errorf(controller.getStartException(), "Unable to start service: %s", controller.getName()); } } });
@Override public void transition(ServiceController<?> controller, ServiceController.Transition transition) { if (transition.getAfter().equals(ServiceController.Substate.REMOVED)) { latch.countDown(); } } });