FileDocCategorySizeDatePackage
ModuleMonitoringLevelsMBean.javaAPI DocGlassfish v2 API5628Fri May 04 22:24:10 BST 2007com.sun.enterprise.admin.mbeans

ModuleMonitoringLevelsMBean

public class ModuleMonitoringLevelsMBean extends com.sun.enterprise.admin.config.BaseConfigMBean
The MBean is used for overriding the setAttribute functionality of the BaseConfigMBean. When the monitoring-level of one of the following changes, the others are should also be impacted. This is a special case that impact only the following components: connector-service jms-service connector-connection-pool

Fields Summary
public static final String
CONNECTOR_SERVICE_ATTR_NAME
public static final String
JMS_SERVICE_ATTR_NAME
public static final String
CONNECTOR_CONNPOOL_ATTR_NAME
public static final Logger
sLogger
Constructors Summary
public ModuleMonitoringLevelsMBean()
Creates a new instance of ModuleMonitoringLevelsMBean


               
      
    
    
Methods Summary
public voidsetAttribute(javax.management.Attribute attr)

 
        try {
            super.setAttribute(attr);
            String attrName = attr.getName();
            AttributeList otherAttrs = new AttributeList();
            sLogger.log(Level.FINE, "modulemonitoringlevelsmbean.attribute_name", attrName);
            if(attrName.equals(CONNECTOR_SERVICE_ATTR_NAME)) {
                
                otherAttrs.add(new Attribute(JMS_SERVICE_ATTR_NAME, attr.getValue()));
                otherAttrs.add(new Attribute(CONNECTOR_CONNPOOL_ATTR_NAME, attr.getValue()));
            }
            else if(attrName.equals(JMS_SERVICE_ATTR_NAME))
            {
                
                otherAttrs.add(new Attribute(CONNECTOR_CONNPOOL_ATTR_NAME, attr.getValue()));
                otherAttrs.add(new Attribute(CONNECTOR_SERVICE_ATTR_NAME, attr.getValue()));
            }
            else if(attrName.equals(CONNECTOR_CONNPOOL_ATTR_NAME)) 
            {
                
                otherAttrs.add(new Attribute(CONNECTOR_SERVICE_ATTR_NAME, attr.getValue()));
                otherAttrs.add(new Attribute(JMS_SERVICE_ATTR_NAME, attr.getValue()));
            }
            super.setAttributes(otherAttrs);
        } catch(AFRuntimeException afe) {
            throw afe;
        } catch(Exception e) {
            sLogger.log(Level.WARNING, "modulemonitoringlevelsmbean.set_failed");
            sLogger.log(Level.WARNING, e.getLocalizedMessage(), e);
        }
    
public javax.management.AttributeListsetAttributes(javax.management.AttributeList attrs)

        
        AttributeList attrList = new AttributeList();
        Iterator it = attrs.iterator();
        Attribute attr = null;
        while(it.hasNext()) {
            try {
                attr = (Attribute)it.next();
                setAttribute(attr);
            } catch(AFRuntimeException afe) {
                throw afe;
            } catch(Exception e) {
                sLogger.log(Level.WARNING, "modulemonitoringlevelsmbean.set_failed");
                sLogger.log(Level.WARNING, e.getLocalizedMessage(), e);
            }
            attrList.add(attr);
        }
        return attrList;