Package org.objectweb.joram.mom.util
Class SynchronousAgent
- java.lang.Object
-
- fr.dyade.aaa.agent.Agent
-
- org.objectweb.joram.mom.util.SynchronousAgent
-
- All Implemented Interfaces:
AgentMBean,Encodable,Serializable
@Deprecated public class SynchronousAgent extends Agent
Deprecated.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static booleanDEBUGDeprecated.private static SynchronousAgentINSTANCEDeprecated.private static LoggerloggerDeprecated.private intnextReqMsgIdDeprecated.private Map<String,Message>requestsDeprecated.private static longserialVersionUIDDeprecated.-
Fields inherited from class fr.dyade.aaa.agent.Agent
agentProfiling, 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 SynchronousAgent()Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidagentFinalize(boolean lastTime)Deprecated.Called to inform this agent that it is garbaged and that it should free any active resources that it has allocated.protected voidagentInitialize(boolean firstTime)Deprecated.Gives this agent an opportunity to initialize after having been deployed, and each time it is loaded into memory.booleanclearQueue(String queueName)Deprecated.Clears all pending message of a queuebooleanclearSubscription(String userName, String subName)Deprecated.Clears all pending message of a subscriptionbooleancreateDestination(short serverId, String name, String className, Properties props, byte expectedType)Deprecated.booleancreateUser(short serverId, String userName, String password, String identityClass, Properties props)Deprecated.booleandeleteDest(String agentId)Deprecated.booleandeleteQueueMessage(String queueName, String msgId)Deprecated.Delete a message in a queuebooleandeleteSubMessage(String userName, String subName, String msgId)Deprecated.Deletes a message in a subscriptionbooleandeleteUser(String userName, String agentId)Deprecated.static SynchronousAgentgetSynchronousAgent()Deprecated.private StringnextReqMsgId()Deprecated.voidreact(AgentId from, Notification not)Deprecated.Defines the reaction of the agent when receiving a notification.booleansetFreeReading(boolean freeReading, String destId)Deprecated.booleansetFreeWriting(boolean freeWriting, String destId)Deprecated.-
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
-
logger
private static final Logger logger
Deprecated.
-
DEBUG
private static final boolean DEBUG
Deprecated.
-
INSTANCE
private static SynchronousAgent INSTANCE
Deprecated.
-
serialVersionUID
private static final long serialVersionUID
Deprecated.- See Also:
- Constant Field Values
-
nextReqMsgId
private int nextReqMsgId
Deprecated.
-
-
Method Detail
-
getSynchronousAgent
public static SynchronousAgent getSynchronousAgent() throws IOException, InterruptedException
Deprecated.- Throws:
IOExceptionInterruptedException
-
agentInitialize
protected void agentInitialize(boolean firstTime) throws ExceptionDeprecated.Description copied from class:AgentGives this agent an opportunity to initialize after having been deployed, and each time it is loaded into memory.This function is first called by the factory agent, just after it deploys the agent.
This function is used by agents with a
fixedfield set totrueto initialize their transient variables, as it is called each time the agent server is restarted.This function is not declared
finalso that derived classes may change their reload policy. The implementation of this method provided by theAgentclass just registers the JMS MBean.- Overrides:
agentInitializein classAgent- Parameters:
firstTime- true when first called by the factory- Throws:
Exception- unspecialized exception
-
agentFinalize
public void agentFinalize(boolean lastTime)
Deprecated.Description copied from class:AgentCalled to inform this agent that it is garbaged and that it should free any active resources that it has allocated. A subclass ofAgentshould override this method if it has any operation that it wants to perform before it is garbaged. For example, an agent with threads (a ProxyAgent for example) would use the initialize method to create the threads and theagentFinalizemethod to stop them.Be careful, the notification sending is not allowed in this method.
The implementation of this method provided by the
Agentclass just unregister the JMX MBean if needed.- Overrides:
agentFinalizein classAgent- Parameters:
lastTime- true when last called by the factory on agent deletion.
-
createDestination
public boolean createDestination(short serverId, String name, String className, Properties props, byte expectedType) throws InterruptedExceptionDeprecated.- Throws:
InterruptedException
-
createUser
public boolean createUser(short serverId, String userName, String password, String identityClass, Properties props) throws ExceptionDeprecated.- Parameters:
serverId-userName-password-identityClass-props-- Returns:
- True if the request succeeds, false otherwise
- Throws:
ExceptionClassNotFoundExceptionInterruptedException
-
deleteUser
public boolean deleteUser(String userName, String agentId) throws Exception
Deprecated.- Throws:
Exception
-
deleteDest
public boolean deleteDest(String agentId) throws Exception
Deprecated.- Throws:
Exception
-
deleteQueueMessage
public boolean deleteQueueMessage(String queueName, String msgId) throws InterruptedException
Deprecated.Delete a message in a queue- Parameters:
queueName- Name of the queuemsgId- ID of the message to be deleted- Returns:
- Throws:
InterruptedException
-
deleteSubMessage
public boolean deleteSubMessage(String userName, String subName, String msgId) throws InterruptedException
Deprecated.Deletes a message in a subscription- Parameters:
userName- Subscriber's namesubName- Subscription namemsgId- ID of the message to be deleted- Returns:
- Throws:
InterruptedException
-
clearQueue
public boolean clearQueue(String queueName) throws InterruptedException
Deprecated.Clears all pending message of a queue- Parameters:
queueName- Name of the queue- Returns:
- Throws:
InterruptedException
-
clearSubscription
public boolean clearSubscription(String userName, String subName) throws InterruptedException
Deprecated.Clears all pending message of a subscription- Parameters:
userName- Subscriber's namesubName- Subscription name- Returns:
- Throws:
InterruptedException
-
setFreeWriting
public boolean setFreeWriting(boolean freeWriting, String destId) throws InterruptedExceptionDeprecated.- Throws:
InterruptedException
-
setFreeReading
public boolean setFreeReading(boolean freeReading, String destId) throws InterruptedExceptionDeprecated.- Throws:
InterruptedException
-
nextReqMsgId
private String nextReqMsgId()
Deprecated.
-
react
public void react(AgentId from, Notification not) throws Exception
Deprecated.Description copied from class:AgentDefines the reaction of the agent when receiving a notification. This member function implements the common reactive behavior of an agent, it is called by the execution engine (see Engine class).If there is no corresponding reaction, the agent send an
UnknownNotificationnotification to the sender.
-
-