com.ls.lars.server
Class AgentJMSListener
java.lang.Object
|
+--java.lang.Thread
|
+--com.ls.lars.communication.CommunicationTemplate
|
+--com.ls.lars.server.AgentTemplate
|
+--com.ls.lars.server.AgentListener
|
+--com.ls.lars.server.AgentJMSListener
- All Implemented Interfaces:
- ICommunication, IToLars, Runnable, Serializable
- public class AgentJMSListener
- extends AgentListener
This class is the wrapper agent needed for the communication of a JMS listener.
Its main purpose is to start up JMSListener.
to Class Specification
Incoming Messages
AgentJMSListener understands the following messages.
Input parameters to be specified are listed with the messages.
-----------------------------------------------------------------------
set_jms_parameters (Config)
-----------------------------------------------------------------------
Function: Configures the JMS communication.
Parameters: This message should contain a Map holding the following
key/value pairs:
java.naming.provider.url
the url of the JMS server
java.naming.factory.initial
the JNDI initial context factory
sendingQueueName
the queue for communicating from LARS to JMS
server
receivingQueueName
the queue for communicating from JMS server to
LARS
java.naming.security.principal
specifies the identity of the principal for
authentication
java.naming.security.credentials
specifies the credentials of the principal for
authentication
Responses: none
Example:
set_jms_parameters
localhost
org.exolab.jms.jndi.rmi.RmiJndiInitialContextFactory
jmsOutbox
jmsInbox
-----------------------------------------------------------------------
Config File
The AgentJMSListener's config file usually has only one entry
for configuring the JMS communication.
-----------------------------------------------------------------------
Notes
JMS (Java Message Service) is a standard Java communication technology
for distributed applications.
For AgentJMSListener to work, you have to run a JMS server, which is
configured to offer a QueueConnectionFactory. This factory has to be
provided using the logical name 'QueueConnectionFactory'.
- Version:
- $Revision: 1.10 $
- Author:
- Last modified by $Author: CReich $
- See Also:
- Serialized Form
Fields inherited from class com.ls.lars.server.AgentTemplate |
agentMaxPool, agentMessageRouterName, agentMinPool, defaultServiceAccessPermission, defaultServiceAccessPrivilege, dynamicObjectController, FULL_SERVICE_ACCESS, iXMLHandlerForConfigLoader, localPlatform, maxInvokeStackCounter, NO_SERVICE_ACCESS, RUN_LEVEL_ACTIONS_INITIALIZED, RUN_LEVEL_CONFIG_FILE_INTERPRETED, RUN_LEVEL_CONFIG_FILE_READ, RUN_LEVEL_EMBRYONIC, RUN_LEVEL_INTERPRET_METHODS_REGISTERED, RUN_LEVEL_POOL_INITIALIZED, RUN_LEVEL_RUNNING, RUN_LEVEL_STOPPED, RUN_LEVEL_TERMINATED |
Fields inherited from interface com.ls.lars.communication.ICommunication |
AUTHENTICATION_PASSWORD, AUTHENTICATION_USER, COMPRESSION_AUTO_COMPRESSION, COMPRESSION_AUTO_COMPRESSION_START_SIZE, COMPRESSION_LEVEL, COMPRESSION_TYPE, COMPRESSION_ZIP_ENTRY_NAME, CONNECTION_TYPE, HOST_ID, HOST_IP, HOST_PORT, HTTP, J_SECURE_SOCKET, J_SOCKET, JMS, JMS_INITIAL_CONTEXT_FACTORY, JMS_JMSMESSENGER_APPLICATION_LOCATION, JMS_PROVIDER_URL, JMS_RECEIVING_QUEUE_NAME, JMS_SECURITY_CREDENTIALS, JMS_SECURITY_PRINCIPAL, JMS_SENDING_QUEUE_NAME, MAXIMUM_MESSAGE_LENGTH, PROTOCOL, RMI, SOCKET, TIMEOUT, USE_OUTBOX |
Methods inherited from class com.ls.lars.server.AgentTemplate |
executeLifeCycle, executeWhileRunning, getAgentRevisionInformation, getIPKIHandler, getOwnPublicKeyCertificate, initializeAction, interpret, interpretAccessDenied, interpretAgentConnected, interpretCheckRegisteredServices, interpretCloseConnection, interpretDefineObject, interpretDeliveryFailed, interpretGetRevisionInformation, interpretInterpretationSuccessful, interpretLoadObject, interpretLogInbox, interpretMonitorLookup, interpretNotifiedAgent, interpretNotifyCanceled, interpretNotifyNotCanceled, interpretNotUnderstood, interpretPing, interpretRegisterService, interpretSendAsConfigured, interpretSetAccessPrivileges, interpretSetForeignPublicKeyCertificate, interpretSetLog, interpretSetOwnPublicKeyCertificate, interpretSetPkiEnvironment, interpretSetPkiMessages, interpretSetPrivateKey, interpretSetRunLevel, interpretSignatureNotValid, interpretStartupConstraint, loadConfigFile, performDefaultBehavior, reconnectAfterMigration, registerInterpretMethods, registerInterpretMethods, registerInterpretMethods, reInitializeAction, setAgentMessageRouterName, setIXMLHandler, setLocalPlatform, setPKIMessage, terminateAction, toString |
Methods inherited from class com.ls.lars.communication.CommunicationTemplate |
addConnectionParameter, checkSendSystemReply, connect, createReplyId, disconnect, disconnectForMigration, finalize, forwardMessage, forwardMessage, getAgentName, getConnectionParameters, getInboxSize, getLarsHost, getNumberOfProcessedMessages, getNumberOfProcessedMessagesPerMinute, getStartTime, isConnected, logInbox, receiveBlockedMessage, receiveBlockedMessage, run, sendMessage, sendSynchronousRequest, sendSynchronousRequest, setConnectionParameters, setLog, setMeantimeBetweenConnectionCheck, waitForConnection, waitForConnection |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, yield |
Methods inherited from interface com.ls.lars.communication.IToLars |
start |
revisionInformation
protected String revisionInformation
- Revision information string, managed by our version control system
JMS_DEFAULT_PORT
protected static final int JMS_DEFAULT_PORT
- Default port for JMS connections: 1073
AgentJMSListener
public AgentJMSListener(String agentName,
String homePlatform,
List agentConfigFiles)
- Constructor that only calls
AgentListener(agentName, homePlatform, agentConfigFiles)
- Parameters:
agentName
- name of the agent (example: xyz)homePlatform
- name of the home platform where the agent was created
(example: 195.52.158.233/lars)agentConfigFiles
- config file(s), which should be read by the agent
when it starts up.
getRevisionInformation
protected String getRevisionInformation()
- gets the revision information of this agent
- Overrides:
getRevisionInformation
in class AgentListener
- Returns:
- the revision information
interpretSetJmsParameters
protected boolean interpretSetJmsParameters(Message currentMessage)
- This method reads all of JMS relevant parameters
- Parameters:
currentMessage
- the set_jms_parameters message- Returns:
- true, if the message was interpreted successfully
setPort
protected boolean setPort(Message currentMessage)
- This method sets the JMS port
- Parameters:
currentMessage
- the set_jms_parameters message- Returns:
- true, if the message was interpreted successfully
initializeMessages
public void initializeMessages()
- calls
super.initializeMessages()
and
creates a connection to the configured JMS server.
- Overrides:
initializeMessages
in class AgentListener
setDefaultPort
protected void setDefaultPort()
- sets port to the default port (here:
JMS_DEFAULT_PORT
)
- Overrides:
setDefaultPort
in class AgentListener