
MBeans Object Names Proposal
Typically an ObjectName of any MBean has 2 parts,
- domain name and
- keyvalue pairs
Domain Name : The domain is used as a namespace to distinguish/group objects that are registered to MBean Server. To avoid collisions between MBeans supplied by different vendors, a useful convention is to begin the domain name with the reverse DNS name of the organization that specifies the MBeans, followed by a period and a string whose interpretation is determined by that organization. For example, MBeans specified by Sun Microsystems Inc., DNS name sun.com, would have domains such as com.sun.MyDomain. This is essentially the same convention as for Java-language package names.
Key value pairs : Are attributes that are used to classify and query MBeans based on Object names.
S/No | Attribute Name | Required | Recommended values | Comments | |
---|---|---|---|---|---|
1. | DomainName | Required | com.liferay.portal | All MBean registered by the liferay portal both external and internal should be registered under this domain, A domain helps identify a JMX client that this is a Liferay Portal MBean. | |
Attributes | |||||
1. | companyId | Optional | companyId=${value) | Helps JMX clients to query all MBeans for a given companyId | |
2. | instanceName | Required | instanceId=${value} | Identifies a unique web container instance on to which this MBean is running, Helps JMX clients to query all MBeans from a particular web container instance. 1. Recommended value for instanceId is instanceName=${hostname}_${port} -- For eg : instanceId=host.india.sun.com_8080 2. InstanceId should be configurable in the portal-ext.properties 3. Default value if not configured is just ${hostname} Note : There is no option to figure out the port on which liferay is running before the first request arrives -- Port is got from the first request and stored by PortalUtil.java -- However monitoring system initalizes itself upon server startup. | |
3. | classification | Required | classification=${value} | Currently there are 3 classification defined, All MBean registered by the portal should fall under one of these classification 1. classification=portal -- Specifies that this MBean is a Portal MBean that monitors a portal resource 2. classification=external -- Specifies that this MBean is a MBean from a 3rd party component that is used by portal, Eg : Java MBeans -- Inc case we decide to register Java MBean. 3. classification=plugin -- Specifies that this MBean monitors a plugin that is deployed on to the portal Eg : portlet | |
4. | type | Required | type=${classname} | A unique name that identifies a MBean, This helps JMX client to query for a particular type of MBean . For eg : If there is a loadbalanced instance of portal, This helps JMX client to query some thing like -- Show me the all the PortalCommunityMBeans. | |
5 | Other | Optional | ${name}=${value} | A MBean is free to add any other additional name value pairs. |
Sample ObjectNames based on the above proposal
- PortalInstanceMBean:
- com.liferay.portal : companyId=10112, instanceName=host.india.sun.com_8080, classification=portal, type=com.liferay.monitoring.mbeans.PortalInstance
- External MBean :A Java MemoryManagerMXBean:
- com.liferay.portal : instanceName=host.india.sun.com_8080, classfication=external, name=CodeCacheManager, type=MemoryManagerMXBean