/*** Add a new Service to the set of defined Services.** @param service The Service to be added*/ @Override public void addService(Service service) {service.setServer(this);synchronized (services) {Service results[] = new Service[services.length + 1];System.arraycopy(services, 0, results, 0, services.length);results[services.length] = service;services = results;if (getState().isAvailable()) {try {service.start();} catch (LifecycleException e) {// Ignore}}// Report this property change to interested listenerssupport.firePropertyChange("service", null, service);}}
/*** Start nested components ({@link Service}s) and implement the requirements* of {@link org.apache.catalina.util.LifecycleBase#startInternal()}.** @exception LifecycleException if this component detects a fatal error* that prevents this component from being used*/ @Override protected void startInternal() throws LifecycleException {fireLifecycleEvent(CONFIGURE_START_EVENT, null);setState(LifecycleState.STARTING);globalNamingResources.start();// Start our defined Servicessynchronized (services) {for (int i = 0; i }
/*** Notify all lifecycle event listeners that a particular event has* occurred for this Container. The default implementation performs* this notification synchronously using the calling thread.** @param type Event type* @param data Event data*/ public void fireLifecycleEvent(String type, Object data) {LifecycleEvent event = new LifecycleEvent(lifecycle, type, data);LifecycleListener interested[] = listeners;for (int i = 0; i
/*** Add a new Connector to the set of defined Connectors, and associate it* with this Service's Container.** @param connector The Connector to be added*/ @Override public void addConnector(Connector connector) {synchronized (connectors) {connector.setService(this);Connector results[] = new Connector[connectors.length + 1];System.arraycopy(connectors, 0, results, 0, connectors.length);results[connectors.length] = connector;connectors = results;if (getState().isAvailable()) {try {connector.start();} catch (LifecycleException e) {log.error(sm.getString("standardService.connector.startFailed",connector), e);}}// Report this property change to interested listenerssupport.firePropertyChange("connector", null, connector);}}