|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.integration.jms.JmsDestinationBackedMessageChannel
public class JmsDestinationBackedMessageChannel
A MessageChannel
implementation that is actually backed by a JMS
Destination. This class is useful as a drop-in replacement for any
Spring Integration channel. The benefit of using this channel is that
the full power of any JMS provider is available with only minimal
configuration changes and without requiring any code changes. The most
obvious benefit is the ability to delegate message persistence to the
JMS provider.
Constructor Summary | |
---|---|
JmsDestinationBackedMessageChannel(javax.jms.ConnectionFactory connectionFactory,
javax.jms.Destination destination)
|
|
JmsDestinationBackedMessageChannel(javax.jms.ConnectionFactory connectionFactory,
java.lang.String destinationName,
boolean isPubSub)
|
|
JmsDestinationBackedMessageChannel(javax.jms.ConnectionFactory connectionFactory,
java.lang.String destinationName,
boolean isPubSub,
org.springframework.jms.support.destination.DestinationResolver destinationResolver)
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
|
java.lang.String |
getName()
Return the name of this channel. |
int |
getPhase()
|
boolean |
isAutoStartup()
|
boolean |
isRunning()
|
void |
onMessage(javax.jms.Message message)
|
boolean |
send(Message<?> message)
Send a Message to this channel. |
boolean |
send(Message<?> message,
long timeout)
Send a message, blocking until either the message is accepted or the specified timeout period elapses. |
void |
setBeanName(java.lang.String beanName)
|
void |
setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)
|
void |
start()
|
void |
stop()
|
void |
stop(java.lang.Runnable callback)
|
boolean |
subscribe(MessageHandler handler)
Register a MessageHandler as a subscriber to this channel. |
boolean |
unsubscribe(MessageHandler handler)
Remove a MessageHandler from the subscribers of this channel. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JmsDestinationBackedMessageChannel(javax.jms.ConnectionFactory connectionFactory, javax.jms.Destination destination)
public JmsDestinationBackedMessageChannel(javax.jms.ConnectionFactory connectionFactory, java.lang.String destinationName, boolean isPubSub)
public JmsDestinationBackedMessageChannel(javax.jms.ConnectionFactory connectionFactory, java.lang.String destinationName, boolean isPubSub, org.springframework.jms.support.destination.DestinationResolver destinationResolver)
Method Detail |
---|
public void setBeanName(java.lang.String beanName)
setBeanName
in interface org.springframework.beans.factory.BeanNameAware
public void setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)
public void afterPropertiesSet() throws java.lang.Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
java.lang.Exception
public java.lang.String getName()
MessageChannel
getName
in interface MessageChannel
public boolean subscribe(MessageHandler handler)
SubscribableChannel
MessageHandler
as a subscriber to this channel.
subscribe
in interface SubscribableChannel
public boolean unsubscribe(MessageHandler handler)
SubscribableChannel
MessageHandler
from the subscribers of this channel.
unsubscribe
in interface SubscribableChannel
public boolean send(Message<?> message)
MessageChannel
Message
to this channel. May throw a RuntimeException for
non-recoverable errors. Otherwise, if the Message cannot be sent for a
non-fatal reason this method will return 'false', and if the Message is
sent successfully, it will return 'true'.
Depending on the implementation, this method may block indefinitely.
To provide a maximum wait time, use MessageChannel.send(Message, long)
.
send
in interface MessageChannel
message
- the Message
to send
public boolean send(Message<?> message, long timeout)
MessageChannel
send
in interface MessageChannel
message
- the Message
to sendtimeout
- the timeout in milliseconds
true
if the message is sent successfully,
false if the specified timeout period elapses or
the send is interrupted
public void onMessage(javax.jms.Message message)
onMessage
in interface javax.jms.MessageListener
public int getPhase()
getPhase
in interface org.springframework.context.Phased
public boolean isAutoStartup()
isAutoStartup
in interface org.springframework.context.SmartLifecycle
public boolean isRunning()
isRunning
in interface org.springframework.context.Lifecycle
public void start()
start
in interface org.springframework.context.Lifecycle
public void stop()
stop
in interface org.springframework.context.Lifecycle
public void stop(java.lang.Runnable callback)
stop
in interface org.springframework.context.SmartLifecycle
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |