|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.activemath.events.impl.EventManager
public class EventManager
Event Manager Singleton
The central place to publish events and subscribe listeners.
| Field Summary | |
|---|---|
protected static Logger |
log
|
| Constructor Summary | |
|---|---|
EventManager(Subconfiguration config)
|
|
| Method Summary | |
|---|---|
static EventManager |
getInstance()
|
XmlrpcEventService |
getService()
|
void |
publishEvent(ActivemathEvent event)
Publish an event to all subscribers. |
void |
subscribe(ActivemathEventListener listener)
Subscribe a listener for all events. |
void |
subscribe(ActivemathEventListener listener,
EventFilterList include,
EventFilterList exclude)
Subscribe a listener with an include and exclude event filter list. |
void |
unsubscribe(ActivemathEventListener listener)
Unsubscribe a listener. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static Logger log
| Constructor Detail |
|---|
public EventManager(Subconfiguration config)
| Method Detail |
|---|
public static EventManager getInstance()
public XmlrpcEventService getService()
public void subscribe(ActivemathEventListener listener)
ActivemathEventSubscriptionService
This will replace any previous subscription of listener.
subscribe in interface ActivemathEventSubscriptionService
public void subscribe(ActivemathEventListener listener,
EventFilterList include,
EventFilterList exclude)
ActivemathEventSubscriptionServiceExample usage for event filters:
EventFilterList includeFilter = new EventFilterList();
includeFilter.add(UserLoggedInEvent.EVENT_TYPE); // subscribe by String...
includeFilter.add("ExerciseFinished"); // also by String
includeFilter.add(UserLoggedOutEvent.class); // or subscribe by Class
includeFilter.add(ItemEvent.class); // or subscribe by event tag
EventManager.getInstance().subscribe(this, includeFilter, null);
This will replace any previous subscription of listener.
subscribe in interface ActivemathEventSubscriptionServicelistener - - listener to send events toinclude - - events to include, or null (will include all)exclude - - events to exclude, or null (will exclude none)public void unsubscribe(ActivemathEventListener listener)
ActivemathEventSubscriptionService
unsubscribe in interface ActivemathEventSubscriptionServicepublic void publishEvent(ActivemathEvent event)
publishEvent in interface ActivemathEventPublisher
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||