/** * Add a LifecycleEvent listener to this component. * * @param type ClassName of the listener to add * @throws MBeanException if adding the listener failed */ public void addLifecycleListener(String type) throws MBeanException{ LifecycleListener listener = (LifecycleListener) newInstance(type); Container container = doGetManagedResource(); container.addLifecycleListener(listener); }
/** * Add a LifecycleEvent listener to this component. * * @param type ClassName of the listener to add * @throws MBeanException if adding the listener failed */ public void addLifecycleListener(String type) throws MBeanException{ LifecycleListener listener = (LifecycleListener) newInstance(type); Container container = doGetManagedResource(); container.addLifecycleListener(listener); }
/** * Adds a valve to this Container instance. * * @param valveType ClassName of the valve to be added * @return the MBean name of the new valve * @throws MBeanException if adding the valve failed */ public String addValve(String valveType) throws MBeanException{ Valve valve = (Valve) newInstance(valveType); Container container = doGetManagedResource(); container.getPipeline().addValve(valve); if (valve instanceof JmxEnabled) { return ((JmxEnabled)valve).getObjectName().toString(); } else { return null; } }
/** * Adds a valve to this Container instance. * * @param valveType ClassName of the valve to be added * @return the MBean name of the new valve * @throws MBeanException if adding the valve failed */ public String addValve(String valveType) throws MBeanException{ Valve valve = (Valve) newInstance(valveType); Container container = doGetManagedResource(); container.getPipeline().addValve(valve); if (valve instanceof JmxEnabled) { return ((JmxEnabled)valve).getObjectName().toString(); } else { return null; } }
Container contained = (Container) newInstance(type); contained.setName(name);
Container contained = (Container) newInstance(type); contained.setName(name);