|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.pogamut.base.agent.jmx.AgentJMXComponents<T>
public class AgentJMXComponents<T extends IAgent>
Wraps a few methods into one place so it won't plague the public method space of the agent. (Make things a bit clear...).
Contains list of IJMXEnabled components that should be enabled when the whole JMX feature of the agent is fired up.
Note that jmx domain is taken from the java property "pogamut.jmx.domain".
Field Summary | |
---|---|
static java.lang.String |
JMX_SERVER_AGENT_NAME_DELIM
Separates JMX server address and the agent's MBean object name in address exported to the outside. |
static java.lang.String |
LOG_CATEGORY_NAME
|
Constructor Summary | |
---|---|
AgentJMXComponents(T agent)
|
Method Summary | |
---|---|
void |
addComponent(IJMXEnabled component)
Adding new IJMXEnabled component to the list - registering it so it will be notified when the enableJMX() is called. |
protected AgentMBeanAdapter |
createAgentMBean(javax.management.ObjectName objectName,
javax.management.MBeanServer mbs)
Factory method for creating agent MBean. |
java.lang.String |
enableJMX()
This enables the JMX feature on the whole agent notifying all IJMXEnabled components to register itself to provided mBeanServer. |
javax.management.ObjectName |
getAgentJMXName()
Returns ObjectName of the agent. |
java.lang.String |
getJMXDomain()
JMX domain of the whole agent - used to construct ObjectName instances. |
javax.management.MBeanServer |
getMBeanServer()
MBeanServer, if null the jmx is not enabled. |
boolean |
isJMXEnabled()
Whether the JMX is enabled or not. |
void |
registerJMX()
Re-register all agent's MBeans / Listener into the MBeanServer again. |
void |
unregisterJMX()
Unregister all agent's MBeans / Listeners from MBeanServer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String LOG_CATEGORY_NAME
public static final java.lang.String JMX_SERVER_AGENT_NAME_DELIM
Constructor Detail |
---|
@Inject public AgentJMXComponents(T agent)
Method Detail |
---|
public void addComponent(IJMXEnabled component)
component
- public javax.management.MBeanServer getMBeanServer()
public java.lang.String getJMXDomain()
public boolean isJMXEnabled()
public javax.management.ObjectName getAgentJMXName()
public java.lang.String enableJMX() throws JMXAlreadyEnabledException, CantStartJMXException
Note that jmxDomain must be well-formed in JMX Object Name sense.
mBeanServer
- jmxDomain
-
JMXAlreadyEnabledException
CantStartJMXException
protected AgentMBeanAdapter createAgentMBean(javax.management.ObjectName objectName, javax.management.MBeanServer mbs) throws javax.management.MalformedObjectNameException, javax.management.InstanceAlreadyExistsException, javax.management.InstanceAlreadyExistsException, javax.management.MBeanRegistrationException, javax.management.NotCompliantMBeanException
objectName
- mbs
-
javax.management.MalformedObjectNameException
javax.management.InstanceAlreadyExistsException
javax.management.MBeanRegistrationException
javax.management.NotCompliantMBeanException
public void unregisterJMX()
public void registerJMX()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |