/** * Stops all services and puts the service manager into a stopped state. */ public void stop() { if( !started ) { throw new IllegalStateException(getClass().getSimpleName() + " not started."); } for( Service<T> s : services ) { if( log.isLoggable(Level.FINE) ) { log.log(Level.FINE, "Stopping service:{0}", s); } s.stop(); } started = false; }
/** * Removes the specified service from this service manager, stopping * and terminating it as required. If this service manager is in a * started state then the service will be stopped. After removal, * the service will be terminated. */ public <S extends Service<T>> void removeService( S s ) { if( log.isLoggable(Level.FINE) ) { log.log(Level.FINE, "removeService({0})", s); } if( started ) { if( log.isLoggable(Level.FINE) ) { log.log(Level.FINE, "Stopping service:{0}", s); } s.stop(); } services.remove(s); if( log.isLoggable(Level.FINE) ) { log.log(Level.FINE, "Terminating service:{0}", s); } s.terminate(getParent()); }
/** * Stops all services and puts the service manager into a stopped state. */ public void stop() { if( !started ) { throw new IllegalStateException(getClass().getSimpleName() + " not started."); } for( Service<T> s : services ) { if( log.isLoggable(Level.FINE) ) { log.log(Level.FINE, "Stopping service:{0}", s); } s.stop(); } started = false; }
/** * Removes the specified service from this service manager, stopping * and terminating it as required. If this service manager is in a * started state then the service will be stopped. After removal, * the service will be terminated. */ public <S extends Service<T>> void removeService( S s ) { if( log.isLoggable(Level.FINE) ) { log.log(Level.FINE, "removeService({0})", s); } if( started ) { if( log.isLoggable(Level.FINE) ) { log.log(Level.FINE, "Stopping service:{0}", s); } s.stop(); } services.remove(s); if( log.isLoggable(Level.FINE) ) { log.log(Level.FINE, "Terminating service:{0}", s); } s.terminate(getParent()); }