Spring Integration

org.springframework.integration.channel
Class AbstractSubscribableChannel

java.lang.Object
  extended by org.springframework.integration.context.IntegrationObjectSupport
      extended by org.springframework.integration.channel.AbstractMessageChannel
          extended by org.springframework.integration.channel.AbstractSubscribableChannel
All Implemented Interfaces:
BeanFactoryAware, BeanNameAware, InitializingBean, MessageChannel, SubscribableChannel, NamedComponent
Direct Known Subclasses:
DirectChannel, ExecutorChannel, PublishSubscribeChannel

public abstract class AbstractSubscribableChannel
extends AbstractMessageChannel
implements SubscribableChannel

Base implementation of MessageChannel that invokes the subscribed handler(s) by delegating to a MessageDispatcher.

Author:
Mark Fisher

Nested Class Summary
 
Nested classes/interfaces inherited from class org.springframework.integration.channel.AbstractMessageChannel
AbstractMessageChannel.ChannelInterceptorList
 
Constructor Summary
AbstractSubscribableChannel()
           
 
Method Summary
protected  boolean doSend(Message<?> message, long timeout)
          Subclasses must implement this method.
protected abstract  MessageDispatcher getDispatcher()
           
 boolean subscribe(MessageHandler handler)
          Register a MessageHandler as a subscriber to this channel.
 boolean unsubscribe(MessageHandler handle)
          Remove a MessageHandler from the subscribers of this channel.
 
Methods inherited from class org.springframework.integration.channel.AbstractMessageChannel
addInterceptor, getComponentType, getInterceptors, getSendErrorCount, getSendSuccessCount, send, send, setConversionService, setDatatypes, setInterceptors
 
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, getBeanFactory, getChannelResolver, getComponentName, getConversionService, getTaskScheduler, onInit, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setTaskScheduler, toString, writeMessageHistory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.springframework.integration.core.MessageChannel
send, send
 

Constructor Detail

AbstractSubscribableChannel

public AbstractSubscribableChannel()
Method Detail

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 handle)
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 timeout)
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

getDispatcher

protected abstract MessageDispatcher getDispatcher()

Spring Integration

Copyright © 2010. All Rights Reserved.