net.sf.doolin.bus.support
Class DefaultBus

java.lang.Object
  extended by net.sf.doolin.bus.support.DefaultBus
All Implemented Interfaces:
IBus

public class DefaultBus
extends Object
implements IBus


Constructor Summary
DefaultBus()
           
 
Method Summary
 void clear()
          Clears all subscriptions from the bus, use with care!
 IBusInfo getBusInfo()
          Gets information about the bus
 BusLog getLog()
          Gets the log associated with this bus
protected
<M> void
messageAccepted(M message, Subscriber<M> subscriber)
           
protected  void messageReceived(Object message)
           
protected
<M> void
process(M message)
          Processes one message
protected  void processContinue()
          Continue the processing
 void publish(Object message)
          Pushes the message on the queue.
 void setLog(BusLog log)
          Sets the log associated with this bus
<M> void
subscribe(Subscriber<M> subscriber)
          Subscribes to this bus.
<M> void
unsubscribe(Subscriber<M> subscriber)
          Unsubscribes to this bus.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultBus

public DefaultBus()
Method Detail

getLog

public BusLog getLog()
Description copied from interface: IBus
Gets the log associated with this bus

Specified by:
getLog in interface IBus

setLog

public void setLog(BusLog log)
Description copied from interface: IBus
Sets the log associated with this bus

Specified by:
setLog in interface IBus

publish

public void publish(Object message)
Pushes the message on the queue.

Specified by:
publish in interface IBus
Parameters:
message - Message which is published.

processContinue

protected void processContinue()
Continue the processing


subscribe

public <M> void subscribe(Subscriber<M> subscriber)
Description copied from interface: IBus
Subscribes to this bus.

Specified by:
subscribe in interface IBus
Type Parameters:
M - Type of message
Parameters:
subscriber - Details of the subscription.

unsubscribe

public <M> void unsubscribe(Subscriber<M> subscriber)
Description copied from interface: IBus
Unsubscribes to this bus.

Specified by:
unsubscribe in interface IBus
Type Parameters:
M - Type of message
Parameters:
subscriber - Details of the subscription.

process

protected <M> void process(M message)
Processes one message

Parameters:
message - Message to process

messageAccepted

protected <M> void messageAccepted(M message,
                                   Subscriber<M> subscriber)

messageReceived

protected void messageReceived(Object message)

clear

public void clear()
Description copied from interface: IBus
Clears all subscriptions from the bus, use with care!

Specified by:
clear in interface IBus

getBusInfo

public IBusInfo getBusInfo()
Description copied from interface: IBus
Gets information about the bus

Specified by:
getBusInfo in interface IBus


Copyright © 2011. All Rights Reserved.