org.oddjob.beanbus
Class BasicBeanBus<T>

java.lang.Object
  extended by org.oddjob.beanbus.AbstractDestination<T>
      extended by org.oddjob.beanbus.BasicBeanBus<T>
All Implemented Interfaces:
Iterable<T>, Collection<T>, BeanBus<T>

public class BasicBeanBus<T>
extends AbstractDestination<T>
implements BeanBus<T>


Constructor Summary
BasicBeanBus()
          Constructor for an unstoppable bus.
BasicBeanBus(Runnable stopBusCommand)
          Constructor for a stoppable bus.
 
Method Summary
 boolean add(T bean)
           
 BusConductor getBusConductor()
           
 Runnable getStopBusCommand()
           
 Collection<? super T> getTo()
           
protected  void onBusCrash()
           
protected  void onTripBegin()
           
protected  void onTripEnd()
           
 void setTo(Collection<? super T> to)
           
 void startBus()
           
 void stopBus()
           
 
Methods inherited from class org.oddjob.beanbus.AbstractDestination
addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Collection
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Constructor Detail

BasicBeanBus

public BasicBeanBus()
Constructor for an unstoppable bus.


BasicBeanBus

public BasicBeanBus(Runnable stopBusCommand)
Constructor for a stoppable bus.

Parameters:
stopBusCommand -
Method Detail

startBus

public void startBus()
              throws BusCrashException
Specified by:
startBus in interface BeanBus<T>
Throws:
BusCrashException

stopBus

public void stopBus()
             throws BusCrashException
Specified by:
stopBus in interface BeanBus<T>
Throws:
BusCrashException

add

public boolean add(T bean)
Specified by:
add in interface Collection<T>

onTripBegin

protected void onTripBegin()

onTripEnd

protected void onTripEnd()

onBusCrash

protected void onBusCrash()

getTo

public Collection<? super T> getTo()

setTo

public void setTo(Collection<? super T> to)

getStopBusCommand

public Runnable getStopBusCommand()

getBusConductor

public BusConductor getBusConductor()