|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.dvb.event.EventManager
org.ocap.event.EventManager
public class 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 EventManager allows an 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 a singleton, and the instance is gotten from the getInstance() method. (Note that a type cast is necessary to gain reference to object of type org.ocap.event.EventManager.)
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.
If an UserEventFilter instance is set via EventManager.setUserEventFilter(), EventManager shall call the UserEventFilter.filterUserEvent() method before delivering events to the listening applications that are specified by the UserEventFilter. Note that EventManager shall call the filterUserEvent() method for only the events specified by an UserEventRepository instance which is set via EventManager.setFilteredRepository(). EventFilter may modify the key value of the userEvent and/or may direct the platform to forward the userEvent to a specific set of applications. Then EventManager gets the (possibly modified) event via UserEventAction.getEvent() and the list of AppIDs of the applications to receive the forwarded event via UserEventAction.getAppIDs(). EventManager shall call the UserEventListener.userEventReceived() of the applications which have the AppIDs specified by UserEventAction.getAppIDs(). For this purpose, EventManager shall track and keep the AppID of the applications which call the addExclusiveAccessToAWTEvent() and addUserEventListener() methods in a proprietary manner (manufacture dependent).
Constructor Summary | |
---|---|
protected |
EventManager()
Constructor for an instance of this class. |
Method Summary | |
---|---|
UserEventRepository |
getFilteredRepository()
Get the current UserEventRepository which specify the events to be filtered. |
static EventManager |
getInstance()
This method returns the sole instance of the org.ocap.event.EventManager class. |
void |
setFilteredRepository(UserEventRepository repository)
Sets the repository which specifies the events to be filtered. |
void |
setUserEventFilter(UserEventFilter filter)
Set the specified UserEventFilter to modify or consume the event and/or change the applications to deliver the event to. |
Methods inherited from class org.dvb.event.EventManager |
---|
addExclusiveAccessToAWTEvent, addResourceStatusEventListener, addUserEventListener, addUserEventListener, removeExclusiveAccessToAWTEvent, removeResourceStatusEventListener, removeUserEventListener |
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 static EventManager getInstance()
public UserEventRepository getFilteredRepository()
public void setFilteredRepository(UserEventRepository repository)
repository
- a set of non-ordinary key events for calling
the UserEventFilter.filterUserEvent() method.
If null, the UserEventFilter.filterUserEvent()
method is called for all events except the
mandatory ordinary key events.
java.lang.SecurityException
- if the caller does not have
monitorapplication permission("filterUserEvents")
permission.
java.lang.IllegalArgumentException
- if UserEventRepository contains
Mandatory Ordinary keycodes.public void setUserEventFilter(UserEventFilter filter)
filter
- The filter to modify or consume the event and change
the application to be delivered to.
java.lang.SecurityException
- if the caller does not have
monitorapplication permission("filterUserEvents") permission.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |