All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ocap.system.event.SystemEventManager.html Maven / Gradle / Ivy

There is a newer version: 1.3.1
Show newest version






SystemEventManager














org.ocap.system.event
Class SystemEventManager

java.lang.Object
  extended by 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.

See Also:
setEventListener(int, org.ocap.system.event.SystemEventListener), Constant Field Values

REBOOT_EVENT_LISTENER

public static final int REBOOT_EVENT_LISTENER
Identifies the reboot event listener.

See Also:
setEventListener(int,org.ocap.system.event.SystemEventListener), Constant Field Values

RESOURCE_DEPLETION_EVENT_LISTENER

public static final int RESOURCE_DEPLETION_EVENT_LISTENER
Identifies the system resource depletion event listener.

See Also:
setEventListener(int,org.ocap.system.event.SystemEventListener), Constant Field Values

DEFERRED_DOWNLOAD_EVENT_LISTENER

public static final int DEFERRED_DOWNLOAD_EVENT_LISTENER
Identifies the deferred download event listener.

See Also:
setEventListener(int, org.ocap.system.event.SystemEventListener), Constant Field Values
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, or DEFERRED_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 of ERROR_EVENT_LISTENER, REBOOT_EVENT_LISTENER, RESOURCE_DEPLETION_EVENT_LISTENER, or DEFERRED_DOWNLOAD_EVENT_LISTENER.

unsetEventListener

public abstract void unsetEventListener(int type)
Unset the system event handler specified by type.

Parameters:
type - - One of ERROR_EVENT_LISTENER, REBOOT_EVENT_LISTENER, RESOURCE_DEPLETION_EVENT_LISTENER, or DEFERRED_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).






© 2015 - 2024 Weber Informatics LLC | Privacy Policy