ContainerMBean (Apache Tomcat 7.0.104 API Documentation)

org.apache.catalina.mbeans

## Class ContainerMBean

- java.lang.Object
- - org.apache.tomcat.util.modeler.BaseModelMBean
  - - org.apache.catalina.mbeans.ContainerMBean

- All Implemented Interfaces:
    DynamicMBean, MBeanRegistration, ModelMBeanNotificationBroadcaster, NotificationBroadcaster
  Direct Known Subclasses:
    ContextMBean

      public class ContainerMBean
      extends BaseModelMBean

- - ### Field Summary

    - ### Fields inherited from class org.apache.tomcat.util.modeler.BaseModelMBean

      `attributeBroadcaster, generalBroadcaster, managedBean, oname, resource, resourceType`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ContainerMBean()` Construct a `ModelMBean` with default `ModelMBeanInfo` information.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addChild(String type, String name)` Add a new child Container to those associated with this Container, if supported.
    `void` | `addLifeCycleListener(String type)` Add a LifecycleEvent listener to this component.
    `String` | `addValve(String valveType)` Adds a valve to this Container instance.
    `String[]` | `findContainerListenerNames()` List the class name of each of the container listeners added to this container.
    `String[]` | `findLifecycleListenerNames()` List the class name of each of the lifecycle listeners added to this container.
    `void` | `removeChild(String name)` Remove an existing child Container from association with this parent Container.
    `void` | `removeLifeCycleListeners(String type)` Remove a LifecycleEvent listeners from this component.
    `void` | `removeValve(String valveName)` Remove an existing Valve.

    - ### Methods inherited from class org.apache.tomcat.util.modeler.BaseModelMBean

      `addAttributeChangeNotificationListener, addNotificationListener, getAttribute, getAttributes, getClassName, getJmxName, getManagedResource, getMBeanInfo, getModelerType, getNotificationInfo, getObjectName, invoke, postDeregister, postRegister, preDeregister, preRegister, removeAttributeChangeNotificationListener, removeAttributeChangeNotificationListener, removeNotificationListener, removeNotificationListener, removeNotificationListener, sendAttributeChangeNotification, sendAttributeChangeNotification, sendNotification, sendNotification, setAttribute, setAttributes, setManagedBean, setManagedResource, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### ContainerMBean

          public ContainerMBean()
                         throws MBeanException,
                                RuntimeOperationsException

      Construct a `ModelMBean` with default `ModelMBeanInfo` information.
      Throws:
        `MBeanException` - if the initializer of an object throws an exception
        `RuntimeOperationsException` - if an IllegalArgumentException occurs

  - ### Method Detail

    - #### addChild

          public void addChild(String type,
                      String name)
                        throws MBeanException

      Add a new child Container to those associated with this Container, if supported. Won't start the child yet. Has to be started with a call to Start method after necessary configurations are done.
      Parameters:
        `type` - ClassName of the child to be added
        `name` - Name of the child to be added
      Throws:
        `MBeanException` - if the child cannot be added

    - #### removeChild

          public void removeChild(String name)
                           throws MBeanException

      Remove an existing child Container from association with this parent Container.
      Parameters:
        `name` - Name of the existing child Container to be removed
      Throws:
        `MBeanException` - if the child cannot be removed

    - #### addValve

          public String addValve(String valveType)
                          throws MBeanException

      Adds a valve to this Container instance.
      Parameters:
        `valveType` - ClassName of the valve to be added
      Returns:
        the MBean name of the new valve
      Throws:
        `MBeanException` - if adding the valve failed

    - #### removeValve

          public void removeValve(String valveName)
                           throws MBeanException

      Remove an existing Valve.
      Parameters:
        `valveName` - MBean Name of the Valve to remove
      Throws:
        `MBeanException` - if a component cannot be removed

    - #### addLifeCycleListener

          public void addLifeCycleListener(String type)
                                    throws MBeanException

      Add a LifecycleEvent listener to this component.
      Parameters:
        `type` - ClassName of the listener to add
      Throws:
        `MBeanException` - if adding the listener failed

    - #### removeLifeCycleListeners

          public void removeLifeCycleListeners(String type)
                                        throws MBeanException

      Remove a LifecycleEvent listeners from this component.
      Parameters:
        `type` - The ClassName of the listeners to be removed. Note that all the listeners having given ClassName will be removed.
      Throws:
        `MBeanException` - propagated from the managed resource access

    - #### findLifecycleListenerNames

          public String[] findLifecycleListenerNames()
                                              throws MBeanException

      List the class name of each of the lifecycle listeners added to this container.
      Returns:
        the lifecycle listeners class names
      Throws:
        `MBeanException` - propagated from the managed resource access

    - #### findContainerListenerNames

          public String[] findContainerListenerNames()
                                              throws MBeanException

      List the class name of each of the container listeners added to this container.
      Returns:
        the container listeners class names
      Throws:
        `MBeanException` - propagated from the managed resource access

Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.