|
eXo Kernel :: Component :: Common Service 2.4.0-CR2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exoplatform.services.listener.ListenerService
public class ListenerService
Created by The eXo Platform SAS Author : Nhu Dinh Thuan nhudinhthuan@exoplatform.com Apr 6, 2007
| Nested Class Summary | |
|---|---|
protected class |
ListenerService.AsynchronousListener<S,D>
This AsynchronousListener is a wrapper for original listener, that executes wrapped listeners onEvent() in separate thread. |
protected class |
ListenerService.RunListener<S,D>
This thread executes listener.onEvent(event) method. |
| Constructor Summary | |
|---|---|
ListenerService(ExoContainerContext ctx)
Construct a listener service. |
|
ListenerService(ExoContainerContext ctx,
InitialContextInitializer initializer)
Construct a listener service. |
|
ListenerService(ExoContainerContext ctx,
InitialContextInitializer initializer,
InitParams params)
Construct a listener service. |
|
ListenerService(ExoContainerContext ctx,
InitParams params)
Construct a listener service. |
|
| Method Summary | ||
|---|---|---|
void |
addListener(Listener listener)
This method is used to register a ListenerService.AsynchronousListener to the events of the same
name. |
|
void |
addListener(String eventName,
Listener listener)
This method is used to register a new ListenerService.AsynchronousListener. |
|
|
broadcast(String name,
S source,
D data)
This method is used to broadcast an event. |
|
|
broadcast(T event)
This method is used when a developer want to implement his own event object and broadcast the event. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ListenerService(ExoContainerContext ctx)
public ListenerService(ExoContainerContext ctx,
InitialContextInitializer initializer)
public ListenerService(ExoContainerContext ctx,
InitParams params)
public ListenerService(ExoContainerContext ctx,
InitialContextInitializer initializer,
InitParams params)
| Method Detail |
|---|
public void addListener(Listener listener)
ListenerService.AsynchronousListener to the events of the same
name. It is similar to addListener(listener.getName(), listener)
listener - the listener to notify any time an even of the same name is
triggered
public void addListener(String eventName,
Listener listener)
ListenerService.AsynchronousListener. Any time an
event of the given event name has been triggered, the ListenerService.AsynchronousListener will be
notified.
This method will:
eventName - The name of the event to listen tolistener - The Listener to notify any time the event with the given
name is triggered
public final <S,D> void broadcast(String name,
S source,
D data)
throws Exception
S - The type of the source that broacast the eventD - The type of the data that the source object is working onname - The name of the eventsource - The source object instancedata - The data object instance
Exception - if an exception occurs
public final <T extends Event> void broadcast(T event)
throws Exception
T - The type of the event object, the type of the event object has
to be extended from the Event typeevent - The event instance
Exception
|
eXo Kernel :: Component :: Common Service 2.4.0-CR2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||