ObjectNameHelper.javaAPI DocGlassfish v2 API6886Fri May 04 22:33:16 BST 2007com.sun.enterprise.admin.common


public class ObjectNameHelper extends Object
A Class to derive cues for Bean in Config API from ObjectName.

Fields Summary
Constructors Summary
Methods Summary
public static java.lang.StringgetApplicationName( objectName)

		String app = null;
		app = objectName.getKeyProperty(ObjectNames.kApplicationNameKeyName);
		return ( app );
public static java.lang.StringgetClassId( objectName)

        String classId = objectName.getKeyProperty(ObjectNames.kClassIdKeyName);
        return ( classId );
public static java.lang.StringgetGroupId( objectName)

		String moduleType = null;
		moduleType = objectName.getKeyProperty(ObjectNames.kGroupIdKeyName);
		return ( moduleType );
public static java.lang.StringgetHttpListenerId( objectName)

        String listenerId = null;
        listenerId = objectName.getKeyProperty(ObjectNames.kHTTPListenerIdKeyName);
        return ( listenerId );
public static[]getInstanceRelatedMBeans( mbs, java.lang.String instanceName)
Returns array of config MBeans created for given server instance

        final ObjectName pattern = ObjectNames.getAllObjectNamesPattern();  //aka "ias:*"
        final Set names  = mbs.queryMBeans(pattern, null);
        /* gets all the mbeans in the "ias" domain */
        final Iterator iter = names.iterator();
        final ArrayList arr = new ArrayList();
        while(iter.hasNext()) {
            final ObjectInstance objectInstance = (ObjectInstance);
            final ObjectName objectName = objectInstance.getObjectName();
            final String name = ObjectNameHelper.getServerInstanceName(objectName);
            if(instanceName.equals(name)) {
        return (ObjectName [])arr.toArray(new ObjectName[arr.size()]);
public static java.lang.StringgetModuleType( objectName)

		String moduleType = null;
		moduleType = objectName.getKeyProperty(ObjectNames.kModuleTypeKeyName);
		return ( moduleType );
public static java.lang.StringgetName( objectName)
Returns the name of the MBean denoted by this ObjectName. Name is the value of property with name "name" in key properties.

        String name = objectName.getKeyProperty(ObjectNames.kNameKeyName);
        return ( name );
public static java.lang.StringgetServerId( objectName)

        String serverId = objectName.getKeyProperty(ObjectNames.kServerIdKeyName);
        return ( serverId );
public static java.lang.StringgetServerInstanceName( objectName)

        String instanceName = null;

        if (getType(objectName) != null) {
		if (getType(objectName).equals(ObjectNames.kServerInstance))
			instanceName = getName(objectName);
			instanceName = objectName.getKeyProperty(ObjectNames.kServerInstanceKeyName);

        return ( instanceName );
public static java.lang.StringgetType( objectName)
A static method that returns type of the MBean as indicated in com.sun.enterprise.admin.common.ObjectNames class. The given ObjectName may not be null. Returns null, if the ObjectName does not contain a property with name "type" in its property name value set.

       String type = objectName.getKeyProperty(ObjectNames.kTypeKeyName);
       //type has to one of the declared ones and hence this should be asserted.
       return ( type );
public static java.lang.StringgetVirtualServerClassId( objectName)

        String classId = objectName.getKeyProperty(
        return ( classId );
public static java.lang.StringgetVirtualServerId( objectName)

        String virtualServerId = objectName.getKeyProperty(
        return ( virtualServerId );
public static booleanisMonitorMBean( objectName)
Returns true if this MBean is of type monitor. Useful to decide whether the persistent storage check should be performed.

        boolean isMonitor = false;
        String monitorKeyValue = null;

        monitorKeyValue = objectName.getKeyProperty(
        if (monitorKeyValue != null)
            isMonitor = monitorKeyValue.
        return ( isMonitor );