Package org.ow2.joram.mom.amqp
Class AMQPAgent
- java.lang.Object
-
- fr.dyade.aaa.agent.Agent
-
- org.ow2.joram.mom.amqp.AMQPAgent
-
- All Implemented Interfaces:
AgentMBean,Encodable,Serializable
public class AMQPAgent extends Agent
AnAMQPAgentis responsible of the communications with other Joram AMQP servers.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static Map<Long,Long>lockerscontains the lock Object to notify.private static Loggerloggerloggerprivate static Map<Long,Object>responsescontains the async response.private static longserialVersionUIDserialVersionUIDstatic StubAgentInstubAgentInstatic StubAgentOutstubAgentOut-
Fields inherited from class fr.dyade.aaa.agent.Agent
agentProfiling, DEBUG, emptyString, fixed, logmon
-
Fields inherited from interface fr.dyade.aaa.common.encoding.Encodable
BOOLEAN_ENCODED_SIZE, BYTE_ENCODED_SIZE, DOUBLE_ENCODED_SIZE, FLOAT_ENCODED_SIZE, INT_ENCODED_SIZE, LONG_ENCODED_SIZE, SHORT_ENCODED_SIZE
-
-
Constructor Summary
Constructors Constructor Description AMQPAgent()Empty constructor for newInstance().
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidagentFinalize(boolean lastTime)Finalizes the agent before it is garbaged.protected voidagentInitialize(boolean firstTime)Gives this agent an opportunity to initialize after having been deployed, and each time it is loaded into memory.static AgentIdgetAMQPId(short serverId)get destination AgentId of AMQPAgent.static ObjectgetResponse(long lock)static voidputResponse(AgentId from, long lock, Object response)voidreact(AgentId from, Notification not)Distributes the received notifications to the appropriate reactions.static voidsendRequestTo(Object request, short serverId, long proxyId, Long keyLock)send AMQP request to serverId AMQP agent.private voidsendRestart()-
Methods inherited from class fr.dyade.aaa.agent.Agent
agentSave, decode, delete, delete, delete, deploy, deploy, doAdminSyncNotification, encode, getAgentId, getCommitTime, getEncodableClassId, getEncodedSize, getId, getLogTopic, getName, getReactNb, getReactTime, hasName, incWorkInProgress, isAgentProfiling, isDeployed, isFixed, isUpdated, load, needToBeCommited, resetCommitTime, resetReactTime, resetTimer, save, sendTo, sendTo, sendTo, setAgentProfiling, setName, setNoSave, setSave, toString
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
serialVersionUID- See Also:
- Constant Field Values
-
logger
private static final Logger logger
logger
-
stubAgentIn
public static StubAgentIn stubAgentIn
-
stubAgentOut
public static StubAgentOut stubAgentOut
-
-
Method Detail
-
agentInitialize
protected void agentInitialize(boolean firstTime) throws ExceptionGives this agent an opportunity to initialize after having been deployed, and each time it is loaded into memory.- Overrides:
agentInitializein classAgent- Parameters:
firstTime- true when first called by the factory- Throws:
Exception- unspecialized exception
-
agentFinalize
public void agentFinalize(boolean lastTime)
Finalizes the agent before it is garbaged.- Overrides:
agentFinalizein classAgent- Parameters:
lastTime- true when last called by the factory on agent deletion.
-
react
public void react(AgentId from, Notification not) throws Exception
Distributes the received notifications to the appropriate reactions.
-
getAMQPId
public static AgentId getAMQPId(short serverId)
get destination AgentId of AMQPAgent.- Parameters:
serverId- destination server Id.- Returns:
- destination AgentId of AMQPAgent.
-
sendRequestTo
public static void sendRequestTo(Object request, short serverId, long proxyId, Long keyLock)
send AMQP request to serverId AMQP agent. and store keyLock.- Parameters:
request- the request to sendserverId- destination server Id.keyLock- the locker Object for synchronous call or null for async.
-
putResponse
public static void putResponse(AgentId from, long lock, Object response)
- Parameters:
lock-response-
-
getResponse
public static Object getResponse(long lock)
- Parameters:
lock-- Returns:
-
sendRestart
private void sendRestart()
-
-