destroyMBeans((Connector) oldValue, service); createMBeans((Connector) newValue); destroyMBeans((Engine) oldValue); createMBeans((Engine) newValue);
/** * Handle a <code>ContainerEvent</code> from one of the Containers we are * interested in. * * @param event The event that has occurred */ public void containerEvent(ContainerEvent event) { try { String type = event.getType(); if (Container.ADD_CHILD_EVENT.equals(type)) { processContainerAddChild(event.getContainer(), (Container) event.getData()); } else if (Container.REMOVE_CHILD_EVENT.equals(type)) { processContainerRemoveChild(event.getContainer(), (Container) event.getData()); } } catch (Exception e) { log.error("Exception processing event " + event, e); } }
processContainerPropertyChange((Container) event.getSource(), event.getPropertyName(), event.getOldValue(), processNamingResourcesPropertyChange ((NamingResources) event.getSource(), event.getPropertyName(), processServerPropertyChange((Server) event.getSource(), event.getPropertyName(), event.getOldValue(), processServicePropertyChange((Service) event.getSource(), event.getPropertyName(), event.getOldValue(),
/** * Process the addition of a new child Container to a parent Container. * * @param parent Parent container * @param child Child container */ protected void processContainerAddChild(Container parent, Container child) { if (log.isDebugEnabled()) log.debug("Process addChild[parent=" + parent + ",child=" + child + "]"); try { if (child instanceof Context) { createMBeans((Context) child); } else if (child instanceof Engine) { createMBeans((Engine) child); } else if (child instanceof Host) { createMBeans((Host) child); } } catch (MBeanException t) { Exception e = t.getTargetException(); if (e == null) e = t; log.error("processContainerAddChild: MBeanException", e); } catch (Throwable t) { log.error("processContainerAddChild: Throwable", t); } }
/** * Deregister the MBeans for the specified Service and its nested * components. * * @param service Service for which to destroy MBeans * * @exception Exception if an exception is thrown during MBean destruction */ protected void destroyMBeans(Service service) throws Exception { // Deregister the MBeans for the associated Engine Engine engine = (Engine) service.getContainer(); if (engine != null) { destroyMBeans(engine); } // Deregister the MBeans for the corresponding Connectors Connector connectors[] = service.findConnectors(); for (int j = 0; j < connectors.length; j++) { destroyMBeans(connectors[j], service); } if (service instanceof StandardService) { ((StandardService) service).removePropertyChangeListener(this); } }
/** * Create the MBeans that correspond to every existing node of our tree. */ protected void createMBeans() { try { MBeanFactory factory = new MBeanFactory(); createMBeans(factory); createMBeans(ServerFactory.getServer()); } catch (MBeanException t) { Exception e = t.getTargetException(); if (e == null) e = t; log.error("createMBeans: MBeanException", e); } catch (Throwable t) { log.error("createMBeans: Throwable", t); } }
/** * Deregister the MBeans for the specified Service and its nested * components. * * @param service Service for which to destroy MBeans * * @exception Exception if an exception is thrown during MBean destruction */ protected void destroyMBeans(Service service) throws Exception { // Deregister the MBeans for the associated Engine Engine engine = (Engine) service.getContainer(); if (engine != null) { destroyMBeans(engine); } // Deregister the MBeans for the corresponding Connectors Connector connectors[] = service.findConnectors(); for (int j = 0; j < connectors.length; j++) { destroyMBeans(connectors[j], service); } if (service instanceof StandardService) { ((StandardService) service).removePropertyChangeListener(this); } }
destroyMBeans((NamingResources) oldValue); createMBeans((NamingResources) newValue); destroyMBeans((Service) oldValue); createMBeans((Service) newValue);
processContainerPropertyChange((Container) event.getSource(), event.getPropertyName(), event.getOldValue(), processNamingResourcesPropertyChange ((NamingResources) event.getSource(), event.getPropertyName(), processServerPropertyChange((Server) event.getSource(), event.getPropertyName(), event.getOldValue(), processServicePropertyChange((Service) event.getSource(), event.getPropertyName(), event.getOldValue(),
/** * Create the MBeans for the specified Service and its nested components. * * @param service Service for which to create MBeans * * @exception Exception if an exception is thrown during MBean creation */ protected void createMBeans(Service service) throws Exception { // Create the MBean for the Service itself if (log.isDebugEnabled()) log.debug("Creating MBean for Service " + service); //MBeanUtils.createMBean(service); if (service instanceof StandardService) { ((StandardService) service).addPropertyChangeListener(this); } // Create the MBeans for the corresponding Connectors Connector connectors[] = service.findConnectors(); for (int j = 0; j < connectors.length; j++) { createMBeans(connectors[j]); } // Create the MBean for the associated Engine and friends Engine engine = (Engine) service.getContainer(); if (engine != null) { createMBeans(engine); } }
/** * Deregister the MBeans for the specified Service and its nested * components. * * @param service Service for which to destroy MBeans * * @exception Exception if an exception is thrown during MBean destruction */ protected void destroyMBeans(Service service) throws Exception { // Deregister the MBeans for the associated Engine Engine engine = (Engine) service.getContainer(); if (engine != null) { destroyMBeans(engine); } // Deregister the MBeans for the corresponding Connectors Connector connectors[] = service.findConnectors(); for (int j = 0; j < connectors.length; j++) { destroyMBeans(connectors[j], service); } if (service instanceof StandardService) { ((StandardService) service).removePropertyChangeListener(this); } }
/** * Handle a <code>ContainerEvent</code> from one of the Containers we are * interested in. * * @param event The event that has occurred */ public void containerEvent(ContainerEvent event) { try { String type = event.getType(); if (Container.ADD_CHILD_EVENT.equals(type)) { processContainerAddChild(event.getContainer(), (Container) event.getData()); } else if (Container.REMOVE_CHILD_EVENT.equals(type)) { processContainerRemoveChild(event.getContainer(), (Container) event.getData()); } } catch (Exception e) { log.error("Exception processing event " + event, e); } }
destroyMBeans((ContextEnvironment) oldValue); createMBeans((ContextEnvironment) newValue); destroyMBeans((ContextResource) oldValue); createMBeans((ContextResource) newValue); destroyMBeans((ContextResourceLink) oldValue); createMBeans((ContextResourceLink) newValue);
processContainerPropertyChange((Container) event.getSource(), event.getPropertyName(), event.getOldValue(), processNamingResourcesPropertyChange ((NamingResources) event.getSource(), event.getPropertyName(), processServerPropertyChange((Server) event.getSource(), event.getPropertyName(), event.getOldValue(), processServicePropertyChange((Service) event.getSource(), event.getPropertyName(), event.getOldValue(),
/** * Create the MBeans for the specified Service and its nested components. * * @param service Service for which to create MBeans * * @exception Exception if an exception is thrown during MBean creation */ protected void createMBeans(Service service) throws Exception { if (service instanceof StandardService) { ((StandardService) service).addPropertyChangeListener(this); } // Create the MBeans for the corresponding Connectors Connector connectors[] = service.findConnectors(); for (int j = 0; j < connectors.length; j++) { createMBeans(connectors[j]); } // Create the MBean for the associated Engine and friends Engine engine = (Engine) service.getContainer(); if (engine != null) { createMBeans(engine); } }
destroyMBeans(resources); destroyMBeans(services[i]);
/** * Handle a <code>ContainerEvent</code> from one of the Containers we are * interested in. * * @param event The event that has occurred */ public void containerEvent(ContainerEvent event) { try { String type = event.getType(); if (Container.ADD_CHILD_EVENT.equals(type)) { processContainerAddChild(event.getContainer(), (Container) event.getData()); } else if (Container.REMOVE_CHILD_EVENT.equals(type)) { processContainerRemoveChild(event.getContainer(), (Container) event.getData()); } } catch (Exception e) { log.error("Exception processing event " + event, e); } }
destroyMBeans((ContextEnvironment) oldValue); createMBeans((ContextEnvironment) newValue); destroyMBeans((ContextResource) oldValue); createMBeans((ContextResource) newValue); destroyMBeans((ContextResourceLink) oldValue); createMBeans((ContextResourceLink) newValue);
processContainerPropertyChange((Container) event.getSource(), event.getPropertyName(), event.getOldValue(), processNamingResourcesPropertyChange ((NamingResources) event.getSource(), event.getPropertyName(), processServerPropertyChange((Server) event.getSource(), event.getPropertyName(), event.getOldValue(), processServicePropertyChange((Service) event.getSource(), event.getPropertyName(), event.getOldValue(),
/** * Create the MBeans for the specified Service and its nested components. * * @param service Service for which to create MBeans * * @exception Exception if an exception is thrown during MBean creation */ protected void createMBeans(Service service) throws Exception { if (service instanceof StandardService) { ((StandardService) service).addPropertyChangeListener(this); } // Create the MBeans for the corresponding Connectors Connector connectors[] = service.findConnectors(); for (int j = 0; j < connectors.length; j++) { createMBeans(connectors[j]); } // Create the MBean for the associated Engine and friends Engine engine = (Engine) service.getContainer(); if (engine != null) { createMBeans(engine); } }