|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openbandy.event.EventSourceBroker
public class EventSourceBroker
The EventSourceBroker holds all references to event sources that are registered at the
event service and is thus able to create new instances if necessary.
Since sources may provide several types of events, they will consequently be referenced
by multiple EventSourceControllers. Furthermore, sources are going to be newly instantiated
from time to time in order to be restarted. Thus, we need a another level of abstraction to
administer the references to the event sources. For this purpose, the EventSourceBroker
manages a static list of event sources registered at the EventService.
(c) Copyright Philipp Bolliger 2007, ALL RIGHTS RESERVED.
Constructor Summary | |
---|---|
EventSourceBroker()
|
Method Summary | |
---|---|
java.lang.Integer |
addEventSource(EventSource eventSource)
Add an EventSource instance to the broker's pool |
EventSource |
getEventSource(java.lang.Integer index)
Return the reference to an EventSource from the pool |
java.lang.Integer |
getEventSourceIndex(EventSource eventSource)
Return the index of an EventSource instance in the pool |
EventSource |
getNewEventSourceInstance(java.lang.Integer index)
Creates a new instance of the EventSource that is stored with the given index and replaces the old with the new instance. |
java.util.Enumeration |
getSources()
List of all EventSource references currently in the pool |
boolean |
removeEventSource(EventSource eventSource)
Remove an EventSource from the pool |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EventSourceBroker()
Method Detail |
---|
public java.lang.Integer addEventSource(EventSource eventSource)
eventSource
- EventSource to be added
public EventSource getEventSource(java.lang.Integer index)
index
- Index of the EventSource in the pool
public java.lang.Integer getEventSourceIndex(EventSource eventSource)
eventSource
- Reference to the EventSource
public java.util.Enumeration getSources()
public boolean removeEventSource(EventSource eventSource)
eventSource
- Reference to the EventSource
public EventSource getNewEventSourceInstance(java.lang.Integer index)
index
- Index of the EventSource in the pool
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |