uk.ac.standrews.cs.nds.eventModel.eventBus
Class EventBus

java.lang.Object
  extended by uk.ac.standrews.cs.nds.eventModel.eventBus.EventBus
All Implemented Interfaces:
IEventBus

public class EventBus
extends java.lang.Object
implements IEventBus

Author:
stuart, graham

Constructor Summary
EventBus()
          Creates a new event bus.
 
Method Summary
 void publishEvent(IEvent event)
          Distributes the given event to all interested consumers.
 void register(IEventConsumer consumer)
          Registers a new consumer with the event bus.
 void unregister(IEventConsumer consumer)
          Removes a consumer from the event bus.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventBus

public EventBus()
Creates a new event bus.

Method Detail

publishEvent

public void publishEvent(IEvent event)
Distributes the given event to all interested consumers.

Specified by:
publishEvent in interface IEventBus
Parameters:
event - the event to be distributed

register

public void register(IEventConsumer consumer)
Registers a new consumer with the event bus.

Specified by:
register in interface IEventBus
Parameters:
consumer - the event consumer to be registered

unregister

public void unregister(IEventConsumer consumer)
Removes a consumer from the event bus.

Specified by:
unregister in interface IEventBus
Parameters:
consumer - the event consumer to be removed