|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbiz.hammurapi.config.ComponentBase
biz.hammurapi.jms.MessageProcessor
public abstract class MessageProcessor
Base class for JMS message processors.
Field Summary | |
---|---|
protected int |
acknowledgeMode
|
protected javax.jms.Connection |
connection
|
protected javax.jms.ConnectionFactory |
connectionFactory
|
protected javax.naming.Context |
initialContext
|
protected boolean |
isTransacted
|
protected biz.hammurapi.logging.Logger |
logger
|
protected biz.hammurapi.config.RestartCommand |
restartCommand
|
protected biz.hammurapi.util.Worker |
worker
|
Fields inherited from class biz.hammurapi.config.ComponentBase |
---|
owner |
Constructor Summary | |
---|---|
MessageProcessor()
|
Method Summary | |
---|---|
protected void |
_processMessage(javax.jms.Message request,
javax.jms.Session session)
|
protected javax.jms.Session |
borrowSession()
This implementation simply creates a new session. |
protected java.lang.Object |
getChild(java.lang.String name)
Provides access to destination, initial context, connection, and worker. |
protected abstract void |
processMessage(javax.jms.Message request,
javax.jms.Session session)
Processes request message |
protected void |
releaseSession(javax.jms.Session session)
This implementation simply closes the session. |
void |
setAcknowledgeMode(java.lang.String acknowledgeModeName)
Acknoledge mode. |
void |
setConnection(javax.jms.Connection connection)
Explicitly sets connection. |
void |
setConnectionFactory(java.lang.String connectionFactoryName)
JMS connection name |
void |
setDestination(java.lang.String destinationName)
Request destination (queue or topic) name |
void |
setInitialContext(javax.naming.Context initialContext)
|
void |
setListeners(int listeners)
Number of message listening threads. |
void |
setLogger(biz.hammurapi.logging.Logger logger)
Sets logger. |
void |
setMessageSelector(java.lang.String messageSelector)
Message selector |
void |
setNoLocal(boolean noLocal)
If true and destination is topic then messages produced by this connection are not consumed by the message processor. |
void |
setPassword(java.lang.String pwd)
JMS Connection password. |
void |
setRestartCommand(biz.hammurapi.config.RestartCommand command)
|
void |
setTransacted(boolean isTransacted)
Transactional attribute of JMS Session. |
void |
setUser(java.lang.String user)
JMS Connection user name. |
void |
setWorker(biz.hammurapi.util.Worker worker)
Worker to process requests. |
void |
start()
|
void |
stop()
Stops worker (thread pool), if any, and connection. |
Methods inherited from class biz.hammurapi.config.ComponentBase |
---|
addMeasurement, get, getMeasurementConsumer, getOwner, getOwner, setMeasurementConsumer, setOwner |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected biz.hammurapi.logging.Logger logger
protected javax.naming.Context initialContext
protected javax.jms.Connection connection
protected boolean isTransacted
protected int acknowledgeMode
protected biz.hammurapi.util.Worker worker
protected javax.jms.ConnectionFactory connectionFactory
protected biz.hammurapi.config.RestartCommand restartCommand
Constructor Detail |
---|
public MessageProcessor()
Method Detail |
---|
public void setLogger(biz.hammurapi.logging.Logger logger)
logger
- public void setListeners(int listeners)
listeners
- public void setInitialContext(javax.naming.Context initialContext)
public void setDestination(java.lang.String destinationName)
destinationName
- public void setConnectionFactory(java.lang.String connectionFactoryName)
connectionName
- public void setWorker(biz.hammurapi.util.Worker worker)
worker
- public void setAcknowledgeMode(java.lang.String acknowledgeModeName)
acknowledgeModeName
- public void setConnection(javax.jms.Connection connection)
connection
- public void setTransacted(boolean isTransacted)
isTransacted
- public void setUser(java.lang.String user)
user
- public void setPassword(java.lang.String pwd)
pwd
- public void start() throws biz.hammurapi.config.ConfigurationException
start
in interface biz.hammurapi.config.Component
biz.hammurapi.config.ConfigurationException
protected abstract void processMessage(javax.jms.Message request, javax.jms.Session session)
request
- Request messagesession
- Session if message is processed in the message listener thread (worker is null or cannot process jobs), null otherwise.protected void _processMessage(javax.jms.Message request, javax.jms.Session session)
public void stop() throws biz.hammurapi.config.ConfigurationException
stop
in interface biz.hammurapi.config.Component
biz.hammurapi.config.ConfigurationException
protected javax.jms.Session borrowSession() throws javax.jms.JMSException
javax.jms.JMSException
protected void releaseSession(javax.jms.Session session) throws javax.jms.JMSException
javax.jms.JMSException
protected java.lang.Object getChild(java.lang.String name)
getChild
in class biz.hammurapi.config.ComponentBase
public void setMessageSelector(java.lang.String messageSelector)
messageSelector
- public void setNoLocal(boolean noLocal)
noLocal
- public void setRestartCommand(biz.hammurapi.config.RestartCommand command)
setRestartCommand
in interface biz.hammurapi.config.Restartable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |