|
Spring Integration | |||||||||
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,
String destinationName,
boolean isPubSub)
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
|
String |
getName()
|
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 |
setAcceptMessagesWhileStopping(boolean acceptMessagesWhileStopping)
|
void |
setAutoStartup(boolean autoStartup)
|
void |
setBeanName(String beanName)
|
void |
setCacheLevelName(String cacheLevelName)
|
void |
setClientId(String clientId)
|
void |
setConcurrentConsumers(int concurrentConsumers)
|
void |
setConnectionFactory(javax.jms.ConnectionFactory connectionFactory)
|
void |
setContainerType(Class<? extends AbstractMessageListenerContainer> containerType)
|
void |
setDeliveryPersistent(boolean deliveryPersistent)
|
void |
setDestination(javax.jms.Destination destination)
|
void |
setDestinationName(String destinationName)
|
void |
setDestinationResolver(DestinationResolver destinationResolver)
|
void |
setDurableSubscriptionName(String durableSubscriptionName)
|
void |
setErrorHandler(ErrorHandler errorHandler)
|
void |
setExceptionListener(javax.jms.ExceptionListener exceptionListener)
|
void |
setExplicitQosEnabled(boolean explicitQosEnabled)
|
void |
setExposeListenerSession(boolean exposeListenerSession)
|
void |
setIdleTaskExecutionLimit(int idleTaskExecutionLimit)
|
void |
setMaxConcurrentConsumers(int maxConcurrentConsumers)
|
void |
setMaxMessagesPerTask(int maxMessagesPerTask)
|
void |
setMessageConverter(MessageConverter messageConverter)
|
void |
setMessageIdEnabled(boolean messageIdEnabled)
|
void |
setMessageSelector(String messageSelector)
|
void |
setMessageTimestampEnabled(boolean messageTimestampEnabled)
|
void |
setPhase(int phase)
|
void |
setPriority(int priority)
|
void |
setPubSubDomain(boolean pubSubDomain)
|
void |
setPubSubNoLocal(boolean pubSubNoLocal)
|
void |
setReceiveTimeout(long receiveTimeout)
|
void |
setRecoveryInterval(long recoveryInterval)
|
void |
setSessionAcknowledgeMode(int sessionAcknowledgeMode)
|
void |
setSessionTransacted(boolean sessionTransacted)
|
void |
setSubscriptionDurable(boolean subscriptionDurable)
|
void |
setTaskExecutor(Executor taskExecutor)
|
void |
setTimeToLive(long timeToLive)
|
void |
setTransactionManager(PlatformTransactionManager transactionManager)
|
void |
setTransactionName(String transactionName)
|
void |
setTransactionTimeout(int transactionTimeout)
|
void |
start()
|
void |
stop()
|
void |
stop(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. |
boolean |
waitRegisteredWithDestination(long timeout)
Blocks until the listener container has subscribed; if the container does not support this test, or the caching mode is incompatible, true is returned. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.springframework.context.SmartLifecycle |
---|
isAutoStartup, stop |
Methods inherited from interface org.springframework.context.Lifecycle |
---|
isRunning, start, stop |
Methods inherited from interface org.springframework.context.Phased |
---|
getPhase |
Constructor Detail |
---|
public JmsDestinationBackedMessageChannel(javax.jms.ConnectionFactory connectionFactory, javax.jms.Destination destination)
public JmsDestinationBackedMessageChannel(javax.jms.ConnectionFactory connectionFactory, String destinationName, boolean isPubSub)
Method Detail |
---|
public void setConnectionFactory(javax.jms.ConnectionFactory connectionFactory)
public void setDestination(javax.jms.Destination destination)
public void setDestinationName(String destinationName)
public void setDestinationResolver(DestinationResolver destinationResolver)
public void setPubSubDomain(boolean pubSubDomain)
public void setDeliveryPersistent(boolean deliveryPersistent)
public void setExplicitQosEnabled(boolean explicitQosEnabled)
public void setMessageConverter(MessageConverter messageConverter)
public void setMessageIdEnabled(boolean messageIdEnabled)
public void setMessageTimestampEnabled(boolean messageTimestampEnabled)
public void setPriority(int priority)
public void setPubSubNoLocal(boolean pubSubNoLocal)
public void setSessionAcknowledgeMode(int sessionAcknowledgeMode)
public void setSessionTransacted(boolean sessionTransacted)
public void setTimeToLive(long timeToLive)
public void setBeanName(String beanName)
setBeanName
in interface BeanNameAware
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface InitializingBean
Exception
public String getName()
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 void setAcceptMessagesWhileStopping(boolean acceptMessagesWhileStopping)
public void setAutoStartup(boolean autoStartup)
public void setCacheLevelName(String cacheLevelName)
public void setClientId(String clientId)
public void setConcurrentConsumers(int concurrentConsumers)
public void setContainerType(Class<? extends AbstractMessageListenerContainer> containerType)
public void setDurableSubscriptionName(String durableSubscriptionName)
public void setErrorHandler(ErrorHandler errorHandler)
public void setExceptionListener(javax.jms.ExceptionListener exceptionListener)
public void setExposeListenerSession(boolean exposeListenerSession)
public void setIdleTaskExecutionLimit(int idleTaskExecutionLimit)
public void setMaxConcurrentConsumers(int maxConcurrentConsumers)
public void setMaxMessagesPerTask(int maxMessagesPerTask)
public void setMessageSelector(String messageSelector)
public void setPhase(int phase)
public void setReceiveTimeout(long receiveTimeout)
public void setRecoveryInterval(long recoveryInterval)
public void setSubscriptionDurable(boolean subscriptionDurable)
public void setTaskExecutor(Executor taskExecutor)
public void setTransactionManager(PlatformTransactionManager transactionManager)
public void setTransactionName(String transactionName)
public void setTransactionTimeout(int transactionTimeout)
public int getPhase()
public boolean isAutoStartup()
public boolean isRunning()
public boolean waitRegisteredWithDestination(long timeout)
timeout
- Timeout in milliseconds.
DefaultMessageListenerContainer.isRegisteredWithDestination()
public void start()
public void stop()
public void stop(Runnable callback)
|
Spring Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |