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

ManagementRulesMBean

public class ManagementRulesMBean extends com.sun.enterprise.admin.config.BaseConfigMBean

Fields Summary
Constructors Summary
Methods Summary
public voidaddActionToManagementRule(java.lang.String ruleName, java.lang.String actionMbeanName)
Add Action element to maagement rule

param
ruleName name of the management rule
param
actionMbeanNames actionMbeanNames associated with rule
throws
ConfigException

    ManagementRules rules = (ManagementRules)getBaseConfigBean();
    ManagementRule  rule = rules.getManagementRuleByName(ruleName);
    Action action = new Action();
    action.setActionMbeanName(actionMbeanName);
    rule.setAction(action);
public javax.management.ObjectNamecreateManagementRule(java.lang.String ruleName, java.lang.Boolean bRuleEnabled, java.lang.String ruleDescription, java.lang.String eventType, java.lang.String eventLevel, java.lang.Boolean eventRecordEvent, java.lang.String eventDescription, java.util.Properties eventProperties, java.lang.String actionMbeanName)
Create new self management rule with contained event and action(optional)

param
ruleName name of the management rule. Required.
param
bRuleEnabled enabled/disabled rule state.
param
ruleDescription textual decription of the rule.
param
eventType one of the predefined event types. Required.
param
eventLevel events severety level (default "INFO")
param
eventDescription textual decription of the evant
param
eventRecordEvent whether the event is to be logged or not ("true")
param
eventProperties event's properties
param
actionMbeanName actionMbeanNames associated with rule
returns
ObjectName of created management-rule
throws
Exception

    ManagementRule  newRule = new ManagementRule();
    //Rule attrs
    newRule.setName(ruleName);
    if(ruleDescription!=null)
       newRule.setDescription(ruleDescription);
    if(bRuleEnabled!=null)
       newRule.setEnabled(bRuleEnabled.booleanValue());
    //Event
    Event event = new Event();
    event.setType(eventType);
    if(eventRecordEvent!=null)
       event.setRecordEvent(eventRecordEvent.booleanValue());
    if(eventLevel!=null)
       event.setLevel(eventLevel);
    if(eventDescription!=null)
       event.setDescription(eventDescription);
    //Event properties
    if (null != eventProperties)
        {
            Enumeration keys = eventProperties.keys();
            while (keys.hasMoreElements())
            {
                final String key = (String)keys.nextElement();
                ElementProperty prop = new ElementProperty();
                prop.setName(key);
                prop.setValue((String)eventProperties.get(key));
                event.addElementProperty(prop);
            }
        }
    newRule.setEvent(event);
    
    //Action
    if(actionMbeanName!=null)
    {
        Action action = new Action();
        action.setActionMbeanName(actionMbeanName);
        newRule.setAction(action);
        
    }
    // insert new rule to config tree
    ManagementRules rules = (ManagementRules)getBaseConfigBean();
    rules.addManagementRule(newRule);
    return ConfigMBeanHelper.getChildObjectName(super.m_registry, super.info, newRule);
public java.util.ListgetAllActionMBeans(boolean enabled)
Gets the registred actions in the domain.

param
enabled if true, gets only enabled actions, otherwise all actions.
returns
registered actions
throws
ConfigException

    return ManagementRulesMBeanHelper.getAllActionMBeans(enabled);
java.util.ListgetAllNotificationEmitterMbeans(boolean enabled)
Gets the registred custom mbeans which can be notification emitters.

param
enabled if true, gets only enabled emitters, otherwise all emitters.
returns
custom mbeans which are notification emitters
throws
ConfigException

    return ManagementRulesMBeanHelper.getAllNotificationEmitterMbeans(enabled);
public java.util.ListgetAttributes(java.lang.String dottedName)

 return null; 
public java.util.ListgetAttributes(javax.management.ObjectName objName)
Gets the attributes for a given ObjectName.

param
objName ObjectName for which the attributes are required.
returns
list of attributes
throws
InstanceNotFoundException,IntrospectionException, ReflectionException

    return ManagementRulesMBeanHelper.getAttributes(objName);
public java.util.ListgetDottedNames(java.lang.String dottedName)

 return null; 
public java.util.ListgetEventProperties(java.lang.String eventType)
Gets the associated propertied for a given event.

param
eventType for a given event type, gets the associated property names.
returns
list of property names associated with an event type

    return ManagementRulesMBeanHelper.getEventProperties(eventType);
public java.util.ListgetEventPropertyValues(java.lang.String eventType, java.lang.String propertyName)
Gets the possible values for a given event type and property name.

param
eventType event type to which the propertyName belongs.
param
propertyName name of the property
returns
list of property values associated with a property name.

    return ManagementRulesMBeanHelper.getEventPropertyValues(eventType, propertyName);
public java.util.ListgetEventTypes(boolean isEE)
Gets the list of event types.

param
isEE if true, gets events for EE, otherwise gets events for PE.
returns
list of event types

    return ManagementRulesMBeanHelper.getEventTypes(isEE);
public java.util.ListgetMBeanAttributes(java.lang.String objectNameStr)
Gets the attributes for a given ObjectName in a string form.

param
objNameStr ObjectName for which the attributes are required.
returns
list of attributes
throws
InstanceNotFoundException,IntrospectionException, ReflectionException
throws
MalformedObjectNameException

    return ManagementRulesMBeanHelper.getMBeanAttributes(objectNameStr);
public java.util.ListgetNotificationTypes(javax.management.ObjectName objName)
Gets the Notifications for a given ObjectName.

param
objName ObjectName for which the Notifications are required.
returns
list of Notifications
throws
InstanceNotFoundException,IntrospectionException, ReflectionException

    return ManagementRulesMBeanHelper.getNotificationTypes(objName);
public java.util.ListgetNotificationTypes(java.lang.String objectNameStr)
Gets the notifications for a given ObjectName in a string form.

param
objectNameStr objectNameStr for which the notifications are required.
returns
list of notifications
throws
InstanceNotFoundException,IntrospectionException, ReflectionException
throws
MalformedObjectNameException

    return ManagementRulesMBeanHelper.getNotificationTypes(objectNameStr);
public java.util.SetgetRegisteredMBeans(java.lang.String filter)
Gets the registred MBeans registered in the server's MBean server.

param
filter ObjectName filter for quering MBean server.
returns
list of registered mbeans
throws
MalformedObjectNameException

    return ManagementRulesMBeanHelper.getRegisteredMBeans(filter);