/** * Starts this service manager and all services that it contains. * Any services added after the service manager has started will have * their start() methods called. */ public void start() { if( started ) { return; } for( Service<T> s : services ) { if( log.isLoggable(Level.FINE) ) { log.log(Level.FINE, "Starting service:{0}", s); } s.start(); } started = true; }
/** * Adds the specified service and initializes it. If the service manager * has already been started then the service will also be started. */ public <S extends Service<T>> void addService( S s ) { if( log.isLoggable(Level.FINE) ) { log.log(Level.FINE, "addService({0})", s); } services.add(s); if( log.isLoggable(Level.FINE) ) { log.log(Level.FINE, "Initializing service:{0}", s); } s.initialize(getParent()); if( started ) { if( log.isLoggable(Level.FINE) ) { log.log(Level.FINE, "Starting service:{0}", s); } s.start(); } }
/** * Starts this service manager and all services that it contains. * Any services added after the service manager has started will have * their start() methods called. */ public void start() { if( started ) { return; } for( Service<T> s : services ) { if( log.isLoggable(Level.FINE) ) { log.log(Level.FINE, "Starting service:{0}", s); } s.start(); } started = true; }
/** * Adds the specified service and initializes it. If the service manager * has already been started then the service will also be started. */ public <S extends Service<T>> void addService( S s ) { if( log.isLoggable(Level.FINE) ) { log.log(Level.FINE, "addService({0})", s); } services.add(s); if( log.isLoggable(Level.FINE) ) { log.log(Level.FINE, "Initializing service:{0}", s); } s.initialize(getParent()); if( started ) { if( log.isLoggable(Level.FINE) ) { log.log(Level.FINE, "Starting service:{0}", s); } s.start(); } }