|
|||||||||
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.adapter.AgentMBeanAdapter<T>
public class AgentMBeanAdapter<T extends IAgent>
Class for exporting arbitrary agents as managed MBeans.
Field Summary | |
---|---|
static java.lang.String |
AGENT_NAME_FLAG_NAME
|
static java.lang.String |
AGENT_STATE_FLAG_NAME
|
Constructor Summary | |
---|---|
AgentMBeanAdapter(T agent,
javax.management.ObjectName objectName,
javax.management.MBeanServer mbs)
|
Method Summary | |
---|---|
protected T |
getAgent()
|
java.lang.String |
getComponentId()
Returns id of the agent - unique across the JVMs. |
java.lang.String |
getName()
Returns human readable name. |
javax.management.ObjectName |
getObjectName(java.lang.String domain)
Returns JMX object name of the MBean. |
IAgentState |
getState()
Returns the state of the agent (whether it's running / dead / etc.). |
void |
kill()
Stops the agent (unconditionally), closing whatever connection it may have, this method must be non-blocking + interrupting all the communication, logic or whatever threads the agent may have. |
void |
pause()
This should pause the the agent. |
void |
resume()
This should resume the logic of the agent. |
void |
start()
Attempt to launch the agent. |
void |
stop()
Attempt to stop the agent, usually meaning dropping all running flags and see whether it will stop automatically. |
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 AGENT_STATE_FLAG_NAME
public static final java.lang.String AGENT_NAME_FLAG_NAME
Constructor Detail |
---|
public AgentMBeanAdapter(T agent, javax.management.ObjectName objectName, javax.management.MBeanServer mbs) throws javax.management.MalformedObjectNameException, javax.management.InstanceAlreadyExistsException, javax.management.MBeanRegistrationException, javax.management.NotCompliantMBeanException
javax.management.MalformedObjectNameException
javax.management.InstanceAlreadyExistsException
javax.management.MBeanRegistrationException
javax.management.NotCompliantMBeanException
Method Detail |
---|
protected T getAgent()
public javax.management.ObjectName getObjectName(java.lang.String domain) throws javax.management.MalformedObjectNameException
IAgentMBeanAdapter
getObjectName
in interface IAgentMBeanAdapter
domain
- jmx domain
javax.management.MalformedObjectNameException
public java.lang.String getComponentId()
IAgentMBeanAdapter
getComponentId
in interface IAgentMBeanAdapter
public IAgentState getState()
IAgentMBeanAdapter
Note that the type AgentState wraps two things:
getState
in interface IAgentMBeanAdapter
public void start() throws AgentException
IAgentMBeanAdapter
start
in interface IAgentMBeanAdapter
AgentException
public void pause() throws AgentException
IAgentMBeanAdapter
pause
in interface IAgentMBeanAdapter
AgentException
public void resume() throws AgentException
IAgentMBeanAdapter
resume
in interface IAgentMBeanAdapter
AgentException
public void stop() throws AgentException
IAgentMBeanAdapter
If the stop can not complete - it must automatically call kill() method.
stop
in interface IAgentMBeanAdapter
AgentException
public void kill()
IAgentMBeanAdapter
After calling kill() method, the only method that may be called is getState() to examine state of the agent.
This also equals to "exception happened outside the agent" and "IFatalErrorEvent
should be propagated inside
the agent"
kill
in interface IAgentMBeanAdapter
public java.lang.String getName()
IAgentMBeanAdapter
getName
in interface IAgentMBeanAdapter
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |