/** * Host is added. * * @param host tomcat host. */ private void hostAdded(final StandardHost host) { addContextListener(host); host.addLifecycleListener(this); for (final Container child : host.findChildren()) { if (child instanceof StandardContext) { final StandardContext context = (StandardContext) child; contextAdded(context); } } }
Object newValue = event.getNewValue(); if (oldValue == null && newValue instanceof Service) { serviceAdded((Service) newValue); serviceRemoved((Service) oldValue); if (source instanceof StandardEngine) { if (oldValue == null && newValue instanceof StandardHost) { hostAdded((StandardHost) newValue); hostRemoved((StandardHost) oldValue); contextAdded((StandardContext) newValue); contextRemoved((StandardContext) oldValue);
/** * Service is added. * * @param service tomcat service */ private void serviceAdded(final Service service) { final Container container = service.getContainer(); if (container instanceof StandardEngine) { final StandardEngine engine = (StandardEngine) container; engineAdded(engine); } }
/** * Engine is added. * * @param engine tomcat engine */ private void engineAdded(final StandardEngine engine) { addContextListener(engine); for (final Container child : engine.findChildren()) { if (child instanceof StandardHost) { final StandardHost host = (StandardHost) child; hostAdded(host); } } }
/** * Service removed. * * @param service tomcat service */ private void serviceRemoved(Service service) { Container container = service.getContainer(); if (container instanceof StandardEngine) { StandardEngine engine = (StandardEngine) container; engineRemoved(engine); } }
/** * Starts operation. */ public void start() { // hook the hosts so we get notified before contexts are started standardServer.addPropertyChangeListener(this); standardServer.addLifecycleListener(this); for (final Service service : standardServer.findServices()) { serviceAdded(service); } }
/** * Engine is removed. * * @param engine tomcat engine */ private void engineRemoved(StandardEngine engine) { for (Container child : engine.findChildren()) { if (child instanceof StandardHost) { StandardHost host = (StandardHost) child; hostRemoved(host); } } }
/** * New context is added. * * @param context tomcat context */ private void contextAdded(final StandardContext context) { // put this class as the first listener so we can process the application before any classes are loaded forceFirstLifecycleListener(context); }
/** * Host is removed. * * @param host tomcat host */ private void hostRemoved(StandardHost host) { for (Container child : host.findChildren()) { if (child instanceof StandardContext) { StandardContext context = (StandardContext) child; contextRemoved(context); } } }
globalListenerSupport = new GlobalListenerSupport(standardServer, this);
/** * Engine is added. * * @param engine tomcat engine */ private void engineAdded(StandardEngine engine) { addContextListener(engine); for (Container child : engine.findChildren()) { if (child instanceof StandardHost) { StandardHost host = (StandardHost) child; hostAdded(host); } } }
/** * Service removed. * * @param service tomcat service */ private void serviceRemoved(final Service service) { final Container container = service.getContainer(); if (container instanceof StandardEngine) { final StandardEngine engine = (StandardEngine) container; engineRemoved(engine); } }
/** * Starts operation. */ public void start() { // hook the hosts so we get notified before contexts are started standardServer.addPropertyChangeListener(this); standardServer.addLifecycleListener(this); for (Service service : standardServer.findServices()) { serviceAdded(service); } }
/** * Engine is removed. * * @param engine tomcat engine */ private void engineRemoved(final StandardEngine engine) { for (final Container child : engine.findChildren()) { if (child instanceof StandardHost) { final StandardHost host = (StandardHost) child; hostRemoved(host); } } }
/** * New context is added. * * @param context tomcat context */ private void contextAdded(StandardContext context) { // put this class as the first listener so we can process the application before any classes are loaded forceFirstLifecycleListener(context); }
/** * Host is removed. * * @param host tomcat host */ private void hostRemoved(final StandardHost host) { for (final Container child : host.findChildren()) { if (child instanceof StandardContext) { final StandardContext context = (StandardContext) child; contextRemoved(context); } } }
globalListenerSupport = new GlobalListenerSupport(standardServer, this);
final Object newValue = event.getNewValue(); if (oldValue == null && newValue instanceof Service) { serviceAdded((Service) newValue); serviceRemoved((Service) oldValue); if (source instanceof StandardEngine) { if (oldValue == null && newValue instanceof StandardHost) { hostAdded((StandardHost) newValue); hostRemoved((StandardHost) oldValue); contextAdded((StandardContext) newValue); contextRemoved((StandardContext) oldValue);
/** * Host is added. * * @param host tomcat host. */ private void hostAdded(StandardHost host) { addContextListener(host); host.addLifecycleListener(this); for (Container child : host.findChildren()) { if (child instanceof StandardContext) { StandardContext context = (StandardContext) child; contextAdded(context); } } }
/** * Service is added. * * @param service tomcat service */ private void serviceAdded(Service service) { Container container = service.getContainer(); if (container instanceof StandardEngine) { StandardEngine engine = (StandardEngine) container; engineAdded(engine); } }