FileDocCategorySizeDatePackage
MonitorSetCommand.javaAPI DocGlassfish v2 API4161Fri May 04 22:33:44 BST 2007com.sun.enterprise.admin.monitor

MonitorSetCommand

public class MonitorSetCommand extends MonitorCommand

Fields Summary
private String[]
params
private static final String
WILDCARD
private String
operationName
Constructors Summary
MonitorSetCommand(ObjectName mbeanName, MonitoredObjectType type, String operationName, String[] commandOperands)


         
            
        this.objectName = mbeanName;
        if (type != null) {
            this.monitoredObjectType = type.getTypeName();
        }
        this.operationName = operationName;
	if (commandOperands.length > 0) {
            params = commandOperands;
        }
        
        if (WILDCARD.equals(operationName)) {
            throw new UnsupportedOperationException(BaseMonitorMBean.UNSUPPORTED_ERRMSG);
        }
    
Methods Summary
java.lang.ObjectrunCommand()

        BaseMonitorMBean mbean = MonitoringHelper.getMonitorMBean(objectName);
        if (mbean == null) {
            throw new InstanceNotFoundException();
        }
        ArrayList mbeanList = null;
        
        if (monitoredObjectType != null) {
            mbeanList = mbean.getChildList(monitoredObjectType);
        } else {
            mbeanList = new ArrayList();
            mbeanList.add(mbean);
        }
        AttributeList result = new AttributeList();

        Object val = mbean.invoke(operationName, params, null);
        Attribute attr = new Attribute(operationName, val);
        result.add(attr);

        return result;