net.sf.doolin.bus
Interface IBus

All Known Implementing Classes:
DefaultBus

public interface IBus

Defines a bus that will handle the messages synchronously.


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
 void publish(Object message)
          Publishes a message on this bus and waits for all subscribers to have completed the treatment of this message.
 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.
 

Method Detail

publish

void publish(Object message)
Publishes a message on this bus and waits for all subscribers to have completed the treatment of this message.

Parameters:
message - Message which is published.

subscribe

<M> void subscribe(Subscriber<M> subscriber)
Subscribes to this bus.

Type Parameters:
M - Type of message
Parameters:
subscriber - Details of the subscription.

unsubscribe

<M> void unsubscribe(Subscriber<M> subscriber)
Unsubscribes to this bus.

Type Parameters:
M - Type of message
Parameters:
subscriber - Details of the subscription.

clear

void clear()
Clears all subscriptions from the bus, use with care!


getBusInfo

IBusInfo getBusInfo()
Gets information about the bus


getLog

BusLog getLog()
Gets the log associated with this bus


setLog

void setLog(BusLog log)
Sets the log associated with this bus



Copyright © 2011. All Rights Reserved.