|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.dvb.event.EventManager
The event manager allows an application to receive events coming from the user. These events can be sent exclusively to an application or can be shared between applications. The Event Manager allows also the application to ask for exclusive access to some events, these events being received either from the standard java.awt event mechanism or by the mechanism defined in this package. The EventManager is either a singleton for each MHP application or a singleton for the MHP terminal.
The right to receive events is considered as the same resource regardless of whether it is being handled exclusively or shared. An application successfully obtaining exclusive access to an event results in all other applications losing access to that event, whether the access of those applications was shared or exclusive.
Constructor Summary | |
protected |
EventManager()
Constructor for instances of this class. |
Method Summary | |
boolean |
addExclusiveAccessToAWTEvent(ResourceClient client,
UserEventRepository userEvents)
An application should use this method to express its intend to have exclusive access to some events, but for these events to be received through the java.awt mechanism. |
void |
addResourceStatusEventListener(ResourceStatusListener listener)
Adds the specified resource status listener so that an application can be aware of any changes regarding exclusive access to some events. |
boolean |
addUserEventListener(UserEventListener listener,
ResourceClient client,
UserEventRepository userEvents)
Adds the specified listener to receive events coming from the user in an exclusive manner. |
void |
addUserEventListener(UserEventListener listener,
UserEventRepository userEvents)
Adds the specified listener to receive events coming from the user. |
static EventManager |
getInstance()
This method returns the sole instance of the EventManager class. |
void |
removeExclusiveAccessToAWTEvent(ResourceClient client)
The application should use this method to release its exclusive access to user events defined by the means of the addExclusiveAccessToAWTEvent method. |
void |
removeResourceStatusEventListener(ResourceStatusListener listener)
Removes the specified resource status listener. |
void |
removeUserEventListener(UserEventListener listener)
Removes the specified listener so that it will no longer receives user events. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected EventManager()
Method Detail |
public boolean addUserEventListener(UserEventListener listener, ResourceClient client, UserEventRepository userEvents)
The effect of multiple calls to this method by the same application with different instances of UserEventRepository shall be cumulative. If multiple calls to this method succeed in acquiring the events in the specified repositories then the semantics of each successful method call shall be obeyed as specified. Note that this can result in applications receiving the same event through more than one event listener.
listener
- the listener to receive the user events.client
- resource client.userEvents
- a class which contains the user events it wants to be
informed of.
java.lang.IllegalArgumentException
- if the client argument is set to
null.public void addUserEventListener(UserEventListener listener, UserEventRepository userEvents)
The effect of multiple calls to this method by the same application with different instances of UserEventRepository shall be cumulative. If multiple calls to this method succeed in acquiring the events in the specified repositories then the semantics of each successful method call shall be obeyed as specified. Note that this can result in applications receiving the same event through more than one event listener.
listener
- the listener to receive the user events.userEvents
- a class which contains the user events it wants to be
informed of.public boolean addExclusiveAccessToAWTEvent(ResourceClient client, UserEventRepository userEvents)
The effect of multiple calls to this method by the same application with different instances of UserEventRepository shall be cumulative. If multiple calls to this method succeed in acquiring the events in the specified repositories then the semantics of each successful method call shall be obeyed as specified.
client
- resource client.userEvents
- the user events the application wants to be inform of.
java.lang.IllegalArgumentException
- if the client argument is set to
null.public void removeUserEventListener(UserEventListener listener)
listener
- the user event listener.public void removeExclusiveAccessToAWTEvent(ResourceClient client)
client
- the client that is no longer interested in events
previously registered.public static EventManager getInstance()
public void addResourceStatusEventListener(ResourceStatusListener listener)
addResourceStatusEventListener
in interface ResourceServer
listener
- the resource status listener.public void removeResourceStatusEventListener(ResourceStatusListener listener)
removeResourceStatusEventListener
in interface ResourceServer
listener
- the listener to remove.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |