org.ocap.system.event.SystemEventManager.html Maven / Gradle / Ivy
SystemEventManager
Overview
Package
Class
Tree
Deprecated
Index
Help
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
org.ocap.system.event
Class SystemEventManager
java.lang.Object
org.ocap.system.event.SystemEventManager
public abstract class SystemEventManager
- extends java.lang.Object
Registration mechanism for trusted applications to set the error handler.
Field Summary | |
---|---|
static int |
DEFERRED_DOWNLOAD_EVENT_LISTENER
Identifies the deferred download event listener. |
static int |
ERROR_EVENT_LISTENER
Identifies the system error event listener. |
static int |
REBOOT_EVENT_LISTENER
Identifies the reboot event listener. |
static int |
RESOURCE_DEPLETION_EVENT_LISTENER
Identifies the system resource depletion event listener. |
Constructor Summary | |
---|---|
protected |
SystemEventManager()
This constructor must not be used by OCAP applications. |
Method Summary | |
---|---|
static SystemEventManager |
getInstance()
Gets the singleton instance of the system event manager. |
abstract void |
log(SystemEvent event)
Logs an event. |
abstract void |
setEventListener(int type,
SystemEventListener sel)
Set the system event listener specified by type and the new handler. |
abstract void |
unsetEventListener(int type)
Unset the system event handler specified by type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
ERROR_EVENT_LISTENER
public static final int ERROR_EVENT_LISTENER
- Identifies the system error event listener.
REBOOT_EVENT_LISTENER
public static final int REBOOT_EVENT_LISTENER
- Identifies the reboot event listener.
RESOURCE_DEPLETION_EVENT_LISTENER
public static final int RESOURCE_DEPLETION_EVENT_LISTENER
- Identifies the system resource depletion event listener.
DEFERRED_DOWNLOAD_EVENT_LISTENER
public static final int DEFERRED_DOWNLOAD_EVENT_LISTENER
- Identifies the deferred download event listener.
Constructor Detail |
---|
SystemEventManager
protected SystemEventManager()
- This constructor must not be used by OCAP applications. It is only provided for
implementors of the OCAP APIs.
Method Detail |
---|
getInstance
public static SystemEventManager getInstance()
- Gets the singleton instance of the system event manager.
- Returns:
- The system event manager instance.
setEventListener
public abstract void setEventListener(int type, SystemEventListener sel)
- Set the system event listener specified by type and the new handler.
On a successful call, any previously set SystemEventListener for the same
type is discarded. By default no SystemEventListener is set for any type.
- Parameters:
type
- -ERROR_EVENT_LISTENER
,REBOOT_EVENT_LISTENER
,RESOURCE_DEPLETION_EVENT_LISTENER
, orDEFERRED_DOWNLOAD_EVENT_LISTENER
.sel
- - System event listener created by the registering application.- Throws:
java.lang.SecurityException
- if the application does not have MonitorAppPermission("systemevent")java.lang.IllegalArgumentException
- if type is not one ofERROR_EVENT_LISTENER
,REBOOT_EVENT_LISTENER
,RESOURCE_DEPLETION_EVENT_LISTENER
, orDEFERRED_DOWNLOAD_EVENT_LISTENER
.
unsetEventListener
public abstract void unsetEventListener(int type)
- Unset the system event handler specified by type.
- Parameters:
type
- - One ofERROR_EVENT_LISTENER
,REBOOT_EVENT_LISTENER
,RESOURCE_DEPLETION_EVENT_LISTENER
, orDEFERRED_DOWNLOAD_EVENT_LISTENER
- Throws:
java.lang.SecurityException
- if the application does not have MonitorAppPermission("systemevent")
log
public abstract void log(SystemEvent event)
- Logs an event. Checks the instance of the event and calls the appropriate error,
reboot, or resource depletion handler and passes the even to it.
- Parameters:
event
- - The event to log.- Throws:
java.lang.IllegalArgumentException
- if the event parameter is an instance of an application defined class (i.e., applications cannot define their own subclasses of SystemEvent and use them with this method. This is due to implementation and security issues).
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |