org.springframework.integration.dispatcher
Class SimpleDispatcher

java.lang.Object
  extended by org.springframework.integration.dispatcher.SimpleDispatcher
All Implemented Interfaces:
MessageDispatcher, Subscribable
Direct Known Subclasses:
DefaultPollingDispatcher

public class SimpleDispatcher
extends java.lang.Object
implements MessageDispatcher, Subscribable

Basic implementation of MessageDispatcher.

Author:
Mark Fisher

Field Summary
protected  DispatcherPolicy dispatcherPolicy
           
protected  org.apache.commons.logging.Log logger
           
private  long sendTimeout
           
private  java.util.List<Target> targets
           
 
Constructor Summary
SimpleDispatcher(DispatcherPolicy dispatcherPolicy)
           
 
Method Summary
 boolean dispatch(Message<?> message)
           
 void setSendTimeout(long sendTimeout)
           
 boolean subscribe(Target target)
          Register a Target as a subscriber to this source.
 boolean unsubscribe(Target target)
          Remove a Target from the subscribers of this source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger

targets

private final java.util.List<Target> targets

dispatcherPolicy

protected final DispatcherPolicy dispatcherPolicy

sendTimeout

private volatile long sendTimeout
Constructor Detail

SimpleDispatcher

public SimpleDispatcher(DispatcherPolicy dispatcherPolicy)
Method Detail

setSendTimeout

public void setSendTimeout(long sendTimeout)
Specified by:
setSendTimeout in interface MessageDispatcher

subscribe

public boolean subscribe(Target target)
Description copied from interface: Subscribable
Register a Target as a subscriber to this source.

Specified by:
subscribe in interface Subscribable

unsubscribe

public boolean unsubscribe(Target target)
Description copied from interface: Subscribable
Remove a Target from the subscribers of this source.

Specified by:
unsubscribe in interface Subscribable

dispatch

public boolean dispatch(Message<?> message)
Specified by:
dispatch in interface MessageDispatcher