|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.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.BeanNameAwarepublic void setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)
public void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.Exceptionpublic java.lang.String getName()
MessageChannel
getName in interface MessageChannelpublic boolean subscribe(MessageHandler handler)
SubscribableChannelMessageHandler as a subscriber to this channel.
subscribe in interface SubscribableChannelpublic boolean unsubscribe(MessageHandler handler)
SubscribableChannelMessageHandler from the subscribers of this channel.
unsubscribe in interface SubscribableChannelpublic boolean send(Message<?> message)
MessageChannelMessage 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 MessageChannelmessage - the Message to send
public boolean send(Message<?> message,
long timeout)
MessageChannel
send in interface MessageChannelmessage - 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 interruptedpublic void onMessage(javax.jms.Message message)
onMessage in interface javax.jms.MessageListenerpublic int getPhase()
getPhase in interface org.springframework.context.Phasedpublic boolean isAutoStartup()
isAutoStartup in interface org.springframework.context.SmartLifecyclepublic boolean isRunning()
isRunning in interface org.springframework.context.Lifecyclepublic void start()
start in interface org.springframework.context.Lifecyclepublic void stop()
stop in interface org.springframework.context.Lifecyclepublic 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 | ||||||||