org.oddjob.beanbus.drivers
Class IterableBusDriver<T>

java.lang.Object
  extended by org.oddjob.beanbus.AbstractBusComponent<T>
      extended by org.oddjob.beanbus.drivers.IterableBusDriver<T>
Type Parameters:
T -
All Implemented Interfaces:
Runnable, ServiceProvider, BusServiceProvider, Outbound<T>, Stoppable

public class IterableBusDriver<T>
extends AbstractBusComponent<T>
implements Runnable, Stoppable

A Runnable that can be used as an Oddjob job to take beans from an iterable (collection) and drive them into an BeanBus.

Author:
rob

Constructor Summary
IterableBusDriver()
           
 
Method Summary
 Iterable<? extends T> getBeans()
           
 int getCount()
           
 String getName()
           
 void reset()
           
 void run()
           
 void setBeans(Iterable<? extends T> iterable)
          The beans to iterate over.
 void setName(String name)
           
 void stop()
          Stop executing.
protected  void stopTheBus()
          Implementation override this to perform the action of stopping the bus.
 String toString()
           
 
Methods inherited from class org.oddjob.beanbus.AbstractBusComponent
accept, getServices, getTo, requestBusStop, setTo, startBus, stopBus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IterableBusDriver

public IterableBusDriver()
Method Detail

reset

public void reset()

run

public void run()
Specified by:
run in interface Runnable

stop

public void stop()
Description copied from interface: Stoppable
Stop executing. This method should not return until the Stoppable has actually stopped.

Specified by:
stop in interface Stoppable

stopTheBus

protected void stopTheBus()
Description copied from class: AbstractBusComponent
Implementation override this to perform the action of stopping the bus.

Specified by:
stopTheBus in class AbstractBusComponent<T>

getBeans

public Iterable<? extends T> getBeans()

setBeans

public void setBeans(Iterable<? extends T> iterable)
The beans to iterate over.

Parameters:
iterable -

getName

public String getName()

setName

public void setName(String name)

getCount

public int getCount()

toString

public String toString()
Overrides:
toString in class Object