org.springframework.integration.redis.channel
Class SubscribableRedisChannel
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.channel.AbstractMessageChannel
org.springframework.integration.redis.channel.SubscribableRedisChannel
- All Implemented Interfaces:
- org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle, NamedComponent, SubscribableChannel, TrackableComponent, MessageChannel
public class SubscribableRedisChannel
- extends AbstractMessageChannel
- implements SubscribableChannel, org.springframework.context.SmartLifecycle, org.springframework.beans.factory.DisposableBean
- Since:
- 2.0
- Author:
- Oleg Zhurakousky, Gary Russell
Constructor Summary |
SubscribableRedisChannel(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory,
java.lang.String topicName)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
SubscribableRedisChannel
public SubscribableRedisChannel(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory,
java.lang.String topicName)
setTaskExecutor
public void setTaskExecutor(java.util.concurrent.Executor taskExecutor)
setMessageConverter
public void setMessageConverter(MessageConverter messageConverter)
setSerializer
public void setSerializer(org.springframework.data.redis.serializer.RedisSerializer<?> serializer)
setMaxSubscribers
public void setMaxSubscribers(int maxSubscribers)
- Specify the maximum number of subscribers supported by the
channel's dispatcher.
- Parameters:
maxSubscribers
-
subscribe
public boolean subscribe(MessageHandler handler)
- Description copied from interface:
SubscribableChannel
- Register a
MessageHandler
as a subscriber to this channel.
- Specified by:
subscribe
in interface SubscribableChannel
unsubscribe
public boolean unsubscribe(MessageHandler handler)
- Description copied from interface:
SubscribableChannel
- Remove a
MessageHandler
from the subscribers of this channel.
- Specified by:
unsubscribe
in interface SubscribableChannel
doSend
protected boolean doSend(Message<?> message,
long arg1)
- Description copied from class:
AbstractMessageChannel
- Subclasses must implement this method. A non-negative timeout indicates
how long to wait if the channel is at capacity (if the value is 0, it
must return immediately with or without success). A negative timeout
value indicates that the method should block until either the message is
accepted or the blocking thread is interrupted.
- Specified by:
doSend
in class AbstractMessageChannel
onInit
public void onInit()
throws java.lang.Exception
- Description copied from class:
IntegrationObjectSupport
- Subclasses may implement this for initialization logic.
- Overrides:
onInit
in class IntegrationObjectSupport
- Throws:
java.lang.Exception
isAutoStartup
public boolean isAutoStartup()
- Specified by:
isAutoStartup
in interface org.springframework.context.SmartLifecycle
getPhase
public int getPhase()
- Specified by:
getPhase
in interface org.springframework.context.Phased
isRunning
public boolean isRunning()
- Specified by:
isRunning
in interface org.springframework.context.Lifecycle
start
public void start()
- Specified by:
start
in interface org.springframework.context.Lifecycle
stop
public void stop()
- Specified by:
stop
in interface org.springframework.context.Lifecycle
stop
public void stop(java.lang.Runnable callback)
- Specified by:
stop
in interface org.springframework.context.SmartLifecycle
destroy
public void destroy()
throws java.lang.Exception
- Specified by:
destroy
in interface org.springframework.beans.factory.DisposableBean
- Throws:
java.lang.Exception