SystemEventManager

Overview | Package | Class | Use | 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 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.

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
`equals, 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

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)
                                   throws IllegalArgumentException

  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:
    `SecurityException` - if the application does not have MonitorAppPermission("systemevent")
    `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:
    `SecurityException` - if the application does not have MonitorAppPermission("systemevent")

### log

    public abstract void log(SystemEvent event)
                      throws IllegalArgumentException

  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:
    `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).

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD