|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectcz.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 String |
AGENT_NAME_FLAG_NAME
|
static String |
AGENT_STATE_FLAG_NAME
|
| Constructor Summary | |
|---|---|
AgentMBeanAdapter(T agent,
ObjectName objectName,
MBeanServer mbs)
|
|
| Method Summary | |
|---|---|
protected T |
getAgent()
|
String |
getComponentId()
Returns id of the agent - unique across the JVMs. |
String |
getName()
Returns human readable name. getDisplayName is set by agent and doesn't have to be unique, while getName is machine assigned and is unique. |
ObjectName |
getObjectName(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 String AGENT_STATE_FLAG_NAME
public static final String AGENT_NAME_FLAG_NAME
| Constructor Detail |
|---|
public AgentMBeanAdapter(T agent,
ObjectName objectName,
MBeanServer mbs)
throws MalformedObjectNameException,
InstanceAlreadyExistsException,
MBeanRegistrationException,
NotCompliantMBeanException
MalformedObjectNameException
InstanceAlreadyExistsException
MBeanRegistrationException
NotCompliantMBeanException| Method Detail |
|---|
protected T getAgent()
public ObjectName getObjectName(String domain)
throws MalformedObjectNameException
IAgentMBeanAdapter
getObjectName in interface IAgentMBeanAdapterdomain - jmx domain
MalformedObjectNameExceptionpublic String getComponentId()
IAgentMBeanAdapter
getComponentId in interface IAgentMBeanAdapterpublic IAgentState getState()
IAgentMBeanAdapterNote that the type AgentState wraps two things:
getState in interface IAgentMBeanAdapter
public void start()
throws AgentException
IAgentMBeanAdapter
start in interface IAgentMBeanAdapterAgentException
public void pause()
throws AgentException
IAgentMBeanAdapter
pause in interface IAgentMBeanAdapterAgentException
public void resume()
throws AgentException
IAgentMBeanAdapter
resume in interface IAgentMBeanAdapterAgentException
public void stop()
throws AgentException
IAgentMBeanAdapterIf the stop can not complete - it must automatically call kill() method.
stop in interface IAgentMBeanAdapterAgentExceptionpublic void kill()
IAgentMBeanAdapterAfter 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 IAgentMBeanAdapterpublic String getName()
IAgentMBeanAdapter
getName in interface IAgentMBeanAdapter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||