|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.jms.core.support.JmsGatewaySupport org.figure8.join.core.messaging.JMSConsumerBeanSpringWrapper
public class JMSConsumerBeanSpringWrapper
This is a base class for JMS messages consumer implementations, based on Spring
JMS templates. This class defines lifecyle methods (start()
and
stop()
) that deals by connecting/deconnecting to JMS provider and
listened destination.
Subclasses should only have to implement the processMessage()
method where real work has to be done. This last method should not throw any
exception. This means that implementation should handle every errors.
Field Summary | |
---|---|
protected static org.apache.commons.logging.Log |
log
Commons logger. |
Fields inherited from class org.springframework.jms.core.support.JmsGatewaySupport |
---|
logger |
Constructor Summary | |
---|---|
JMSConsumerBeanSpringWrapper()
Default constructor. |
Method Summary | |
---|---|
void |
destroy()
Invoked by a BeanFactory on destruction of a singleton. |
JMSConsumerBean |
getConsumerBean()
|
javax.jms.Destination |
getDestination()
|
java.lang.String |
getSelector()
|
protected void |
initGateway()
Gets called after population of this instance's bean properties, just call start() method. |
void |
setConsumerBean(JMSConsumerBean consumerBean)
|
void |
setDestination(javax.jms.Destination destination)
|
void |
setSelector(java.lang.String selector)
|
void |
start()
Lifecycle method. |
void |
stop()
Lifecycle method. |
Methods inherited from class org.springframework.jms.core.support.JmsGatewaySupport |
---|
afterPropertiesSet, createJmsTemplate, getConnectionFactory, getJmsTemplate, setConnectionFactory, setJmsTemplate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.apache.commons.logging.Log log
Constructor Detail |
---|
public JMSConsumerBeanSpringWrapper()
Method Detail |
---|
public java.lang.String getSelector()
public void setSelector(java.lang.String selector)
selector
- Message selector expression to use for filtering messagespublic javax.jms.Destination getDestination()
public void setDestination(javax.jms.Destination destination)
destination
- JMS destination to consume messages forpublic JMSConsumerBean getConsumerBean()
public void setConsumerBean(JMSConsumerBean consumerBean)
consumerBean
- public void start() throws javax.jms.JMSException
javax.jms.JMSException
- if connection to provider or registration as a listener
is not possiblepublic void stop() throws javax.jms.JMSException
javax.jms.JMSException
- if closing a resource is not possiblepublic void destroy() throws java.lang.Exception
destroy
in interface org.springframework.beans.factory.DisposableBean
java.lang.Exception
- in case of shutdown errors.protected void initGateway() throws java.lang.Exception
start()
method. Convenience method for testing with Spring.
initGateway
in class org.springframework.jms.core.support.JmsGatewaySupport
java.lang.Exception
- if initialization fails
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |