|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ls.lars.communication.Messenger | +--com.ls.lars.communication.RemoteMessenger | +--com.ls.lars.communication.JMSMessenger
JMSMessenger is used by Agent to communicate with the LARS platform over a JMS provider. This can be used by applets or other clients, and for platform synchronization. It is obtained by calling the getMessenger method of class ClientMessengerFactory. In order to use this messenger, a JMS provider has to be started up, for example, JBoss server.
Field Summary | |
protected String |
messengerType
every remote messenger does in fact know what kind of messenger it is |
protected ArrayList |
outbox
outbox stores messages which should be sent to the remote side |
Constructor Summary | |
protected |
JMSMessenger(String agentName,
Map parameterList)
constructs a JMSMessenger object and intializes it with the given parameters. The given parameterList should contain the following information: 1). |
Method Summary | |
void |
closeConnection()
calls closeConnection method with the parameter EVALUATE_CONNECTION_STATUS |
void |
closeConnection(boolean statusEvaluation)
Behaviour depends on the connection status: If connection status is CommunicationTemplate.STATUS_NOT_CONNECTED: returns after writing a warning in the system log file. |
protected void |
emptyOutbox()
Waits until outbox is empty. |
protected boolean |
isOutboxInUse()
set status of the outbox usage |
void |
processMessage(Message message)
Usually calls sendMessage(message) |
protected Message |
receiveBlockedMessage()
Waits until a message arrives from the JMS server and returns it. |
void |
run()
This method is responsible for connecting this JMSMessenger to the JMS Server. |
void |
sendMessageToRemoteSide(Message message)
Sends a message to the LARS platform via JMS provider. |
protected void |
setMessengerName()
Sets the name of this messenger. |
protected void |
setOutboxInUse(boolean status)
set status of the outbox usage |
void |
start()
Starts an own thread for this agent running on the server. |
String |
toString()
returns a well formed string from the content of the inbox (The synchronization is guaranteed with help of the inbox object.) |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected String messengerType
protected ArrayList outbox
Constructor Detail |
protected JMSMessenger(String agentName, Map parameterList) throws ConnectionException
agentName
- agent name of the clientparameterList
- connection parametersConnectionException
- if the provided parameters are not enough for connecting to a JMS serverMethod Detail |
public void start()
public void run()
run
in class com.ls.lars.communication.Messenger
public void processMessage(Message message)
sendMessage(message)
message
- message that has to be transferredpublic void sendMessageToRemoteSide(Message message)
message
- Message that has to be transferredpublic void closeConnection()
public void closeConnection(boolean statusEvaluation)
statusEvaluation
- EVALUATE_CONNECTION_STATUS or IGNORE_CONNECTION_STATUSprotected void setMessengerName()
protected Message receiveBlockedMessage()
protected void emptyOutbox()
protected void setOutboxInUse(boolean status)
status
- true, if the outbox shall be used; false elseprotected boolean isOutboxInUse()
public String toString()
toString
in class Object
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |