org.oddjob.beanbus
Class BasicBeanBus<T>
java.lang.Object
org.oddjob.beanbus.AbstractDestination<T>
org.oddjob.beanbus.BasicBeanBus<T>
- All Implemented Interfaces:
- Iterable<T>, Collection<T>, BeanBus<T>
public class BasicBeanBus<T>
- extends AbstractDestination<T>
- implements BeanBus<T>
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 |
BasicBeanBus
public BasicBeanBus()
- Constructor for an unstoppable bus.
BasicBeanBus
public BasicBeanBus(Runnable stopBusCommand)
- Constructor for a stoppable bus.
- Parameters:
stopBusCommand
-
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()