org.springframework.integration.bus
Class SubscriptionManager

java.lang.Object
  extended by org.springframework.integration.bus.SubscriptionManager

public class SubscriptionManager
extends java.lang.Object

Manages subscriptions for Targets to a MessageChannel including the creation, scheduling, and lifecycle management of dispatchers.

Author:
Mark Fisher

Field Summary
private  MessageChannel channel
           
private  Schedule defaultSchedule
           
private  java.util.concurrent.ConcurrentMap<Schedule,PollingDispatcherTask> dispatcherTasks
           
private  java.lang.Object lifecycleMonitor
           
private  java.util.List<org.springframework.context.Lifecycle> lifecycleTargets
           
private  org.apache.commons.logging.Log logger
           
private  boolean running
           
private  MessagingTaskScheduler scheduler
           
 
Constructor Summary
SubscriptionManager(MessageChannel channel, MessagingTaskScheduler scheduler)
           
 
Method Summary
 void addTarget(Target target)
           
 void addTarget(Target target, Schedule schedule)
           
 boolean isRunning()
           
 boolean removeTarget(Target target)
           
private  void scheduleDispatcherTask(Schedule schedule)
           
 void setDefaultSchedule(Schedule defaultSchedule)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

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

channel

private final MessageChannel channel

scheduler

private final MessagingTaskScheduler scheduler

defaultSchedule

private volatile Schedule defaultSchedule

dispatcherTasks

private final java.util.concurrent.ConcurrentMap<Schedule,PollingDispatcherTask> dispatcherTasks

lifecycleTargets

private final java.util.List<org.springframework.context.Lifecycle> lifecycleTargets

running

private volatile boolean running

lifecycleMonitor

private final java.lang.Object lifecycleMonitor
Constructor Detail

SubscriptionManager

public SubscriptionManager(MessageChannel channel,
                           MessagingTaskScheduler scheduler)
Method Detail

setDefaultSchedule

public void setDefaultSchedule(Schedule defaultSchedule)

addTarget

public void addTarget(Target target)

addTarget

public void addTarget(Target target,
                      Schedule schedule)

removeTarget

public boolean removeTarget(Target target)

isRunning

public boolean isRunning()

start

public void start()

scheduleDispatcherTask

private void scheduleDispatcherTask(Schedule schedule)

stop

public void stop()