FileDocCategorySizeDatePackage
ContextEnvironmentMBean.javaAPI DocApache Tomcat 6.0.143723Fri Jul 20 04:20:32 BST 2007org.apache.catalina.mbeans

ContextEnvironmentMBean

public class ContextEnvironmentMBean extends org.apache.tomcat.util.modeler.BaseModelMBean

A ModelMBean implementation for the org.apache.catalina.deploy.ContextEnvironment component.

author
Amy Roh
version
$Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $

Fields Summary
Constructors Summary
public ContextEnvironmentMBean()
Construct a ModelMBean with default ModelMBeanInfo information.

exception
MBeanException if the initializer of an object throws an exception
exception
RuntimeOperationsException if an IllegalArgumentException occurs


        super();

    
Methods Summary
public voidsetAttribute(javax.management.Attribute attribute)
Set the value of a specific attribute of this MBean.

param
attribute The identification of the attribute to be set and the new value
exception
AttributeNotFoundException if this attribute is not supported by this MBean
exception
MBeanException if the initializer of an object throws an exception
exception
ReflectionException if a Java reflection exception occurs when invoking the getter


        super.setAttribute(attribute);
        
        ContextEnvironment ce = null;
        try {
            ce = (ContextEnvironment) getManagedResource();
        } catch (InstanceNotFoundException e) {
            throw new MBeanException(e);
        } catch (InvalidTargetObjectTypeException e) {
             throw new MBeanException(e);
        }
        
        // cannot use side-efects.  It's removed and added back each time 
        // there is a modification in a resource.
        NamingResources nr = ce.getNamingResources();
        nr.removeEnvironment(ce.getName());
        nr.addEnvironment(ce);