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

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

There is a newer version: 1.3.1
Show newest version






ErrorEvent














org.ocap.system.event
Class ErrorEvent

java.lang.Object
  extended by org.ocap.system.event.SystemEvent
      extended by org.ocap.system.event.ErrorEvent

public class ErrorEvent
extends SystemEvent

This class represents an event returned by the system when an uncaught exception or implementation error is encountered, or by an application that wishes to log an error or an informational event. Error event type codes are defined in this class. Applications may use the error type codes in this class or proprietary class codes that are understood by the network.

The class takes a Throwable object parameter in one constructor, but the Throwable object cannot be returned from this class due to implementation and security issues. The Throwable object attributes (i.e., message and stacktrace) can be retrieved from this class by calling corresponding get methods, which in-turn call the Throwable object get methods. However, the implementation MUST NOT allow the Throwable object get methods to block indefinitely when called and MUST NOT wait longer than 30 seconds for them to return.


Field Summary
static int APP_CAT_GENERAL_ERROR
          Application catastrophic error that doesn't fit into any other given category.
static int APP_INFO_GENERAL_EVENT
          Application informational event that doesn't fit into any other given category.
static int APP_REC_GENERAL_ERROR
          Application recoverable error that doesn't fit into any other given category.
static int APP_REC_JAVA_THROWABLE
          Application recoverable error - a Java Throwable caught by an exception, but that can be recovered from by the application, or a Throwable that was created by an application due to detection of a recoverable event.
static int SYS_CAT_GENERAL_ERROR
          System catastrophic error that doesn't fit into any other given category.
static int SYS_CAT_JAVA_THROWABLE
          Java Throwable thrown by a call made by an application but not caught by the application.
static int SYS_INFO_GENERAL_EVENT
          System informational event that doesn't fit into any other given category.
static int SYS_REC_GENERAL_ERROR
          System error that doesn't fit into any other given category.
 
Fields inherited from class org.ocap.system.event.SystemEvent
BEGIN_APP_CAT_ERROR_EVENT_TYPES, BEGIN_APP_CAT_ERROR_RESERVED_EVENT_TYPES, BEGIN_APP_INFO_EVENT_TYPES, BEGIN_APP_INFO_RESERVED_EVENT_TYPES, BEGIN_APP_REC_ERROR_EVENT_TYPES, BEGIN_APP_REC_ERROR_RESERVED_EVENT_TYPES, BEGIN_SYS_CAT_ERROR_EVENT_TYPES, BEGIN_SYS_CAT_ERROR_RESERVED_EVENT_TYPES, BEGIN_SYS_DNLD_EVENT_TYPES, BEGIN_SYS_INFO_EVENT_TYPES, BEGIN_SYS_INFO_RESERVED_EVENT_TYPES, BEGIN_SYS_REBOOT_EVENT_TYPES, BEGIN_SYS_REBOOT_RESERVED_EVENT_TYPES, BEGIN_SYS_REC_ERROR_EVENT_TYPES, BEGIN_SYS_REC_ERROR_RESERVED_EVENT_TYPES, BEGIN_SYS_RES_DEP_EVENT_TYPES, BEGIN_SYS_RES_DEP_RESERVED_EVENT_TYPES, END_APP_CAT_ERROR_EVENT_TYPES, END_APP_INFO_EVENT_TYPES, END_APP_REC_ERROR_EVENT_TYPES, END_SYS_CAT_ERROR_EVENT_TYPES, END_SYS_DNLD_EVENT_TYPES, END_SYS_INFO_EVENT_TYPES, END_SYS_REBOOT_EVENT_TYPES, END_SYS_REC_ERROR_EVENT_TYPES, END_SYS_RES_DEP_EVENT_TYPES
 
Constructor Summary
ErrorEvent(int typeCode, java.lang.String message)
          Class constructor specifying the event type code and readable message.
ErrorEvent(int typeCode, java.lang.String message, java.lang.String stacktrace, java.lang.String[] throwableClasses, long date, AppID appId)
          This constructor is provided for internal use by OCAP implementations; applications SHOULD NOT call it.
ErrorEvent(int typeCode, java.lang.Throwable throwable)
          Class constructor specifying the event type code, and throwable condition.
 
Method Summary
 java.lang.String getMessage()
          Gets the readable message String that was passed to a constructor explicitly or within a Throwable object.
 java.lang.String getStackTrace()
          Gets the stack trace from the Throwable object if a Throwable object was passed to the appropriate constructor.
 java.lang.String[] getThrowableClasses()
          Gets the class hierarchy from the Throwable object that was passed to the corresponding constructor.
 
Methods inherited from class org.ocap.system.event.SystemEvent
getAppID, getDate, getTypeCode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

APP_INFO_GENERAL_EVENT

public static final int APP_INFO_GENERAL_EVENT
Application informational event that doesn't fit into any other given category.

See Also:
Constant Field Values

APP_REC_GENERAL_ERROR

public static final int APP_REC_GENERAL_ERROR
Application recoverable error that doesn't fit into any other given category.

See Also:
Constant Field Values

APP_REC_JAVA_THROWABLE

public static final int APP_REC_JAVA_THROWABLE
Application recoverable error - a Java Throwable caught by an exception, but that can be recovered from by the application, or a Throwable that was created by an application due to detection of a recoverable event.

See Also:
Constant Field Values

APP_CAT_GENERAL_ERROR

public static final int APP_CAT_GENERAL_ERROR
Application catastrophic error that doesn't fit into any other given category.

See Also:
Constant Field Values

SYS_INFO_GENERAL_EVENT

public static final int SYS_INFO_GENERAL_EVENT
System informational event that doesn't fit into any other given category.

See Also:
Constant Field Values

SYS_REC_GENERAL_ERROR

public static final int SYS_REC_GENERAL_ERROR
System error that doesn't fit into any other given category.

See Also:
Constant Field Values

SYS_CAT_GENERAL_ERROR

public static final int SYS_CAT_GENERAL_ERROR
System catastrophic error that doesn't fit into any other given category.

See Also:
Constant Field Values

SYS_CAT_JAVA_THROWABLE

public static final int SYS_CAT_JAVA_THROWABLE
Java Throwable thrown by a call made by an application but not caught by the application. This event is generated by the implementation, but indicates that an application cannot continue normal operations.

See Also:
Constant Field Values
Constructor Detail

ErrorEvent

public ErrorEvent(int typeCode,
                  java.lang.String message)
Class constructor specifying the event type code and readable message.

Parameters:
typeCode - - Unique error type code.
message - - Readable error message.
Throws:
java.lang.IllegalArgumentException - when called by an application and the typeCode is not in one of the following ranges: SystemEvent.BEGIN_APP_INFO_EVENT_TYPES to SystemEvent.END_APP_INFO_EVENT_TYPES, or SystemEvent.BEGIN_APP_REC_ERROR_EVENT_TYPES to SystemEvent.END_APP_REC_ERROR_EVENT_TYPES, or SystemEvent.BEGIN_APP_CAT_ERROR_EVENT_TYPES to SystemEvent.END_APP_CAT_ERROR_EVENT_TYPES.

ErrorEvent

public ErrorEvent(int typeCode,
                  java.lang.Throwable throwable)
Class constructor specifying the event type code, and throwable condition. The message is derived from the Throwable object. The

Parameters:
typeCode - - The unique error type code.
throwable - - A throwable object that was generated by the implementation or an application in response to an informational or error event, or by the implementation when a call made by an application throws an exception that isn't caught by the application.
Throws:
java.lang.IllegalArgumentException - when called by an application and the typeCode is not in one of the following ranges: SystemEvent.BEGIN_APP_INFO_EVENT_TYPES to SystemEvent.END_APP_INFO_EVENT_TYPES, or SystemEvent.BEGIN_APP_REC_ERROR_EVENT_TYPES to SystemEvent.END_APP_REC_ERROR_EVENT_TYPES, or SystemEvent.BEGIN_APP_CAT_ERROR_EVENT_TYPES to SystemEvent.END_APP_CAT_ERROR_EVENT_TYPES.

ErrorEvent

public ErrorEvent(int typeCode,
                  java.lang.String message,
                  java.lang.String stacktrace,
                  java.lang.String[] throwableClasses,
                  long date,
                  AppID appId)
This constructor is provided for internal use by OCAP implementations; applications SHOULD NOT call it.

Parameters:
typeCode - - The unique error type code.
message - - Readable message specific to the event generator.
stacktrace - - Stacktrace taken from a Throwable object or null if no Throwable used.
throwableClasses - - The class hierarchy list from a Throwable object or null if no Throwable used.
date - - Event date in milli-seconds from midnight January 1, 1970 GMT.
appId - - The Id of the application logging the event.
Throws:
java.lang.SecurityException - if this constructor is called by any application.
Method Detail

getStackTrace

public java.lang.String getStackTrace()
Gets the stack trace from the Throwable object if a Throwable object was passed to the appropriate constructor.

Returns:
The stack trace from the Throwable object, or null if no Throwable object is available, or if the message cannot be extracted from the Throwable object (perhaps Throwable.printStackTrace() threw an exception or blocked).

getMessage

public java.lang.String getMessage()
Gets the readable message String that was passed to a constructor explicitly or within a Throwable object.

Overrides:
getMessage in class SystemEvent
Returns:
The readable message, if the message cannot be extracted from the Throwable object (perhaps Throwable.getMessage() threw an exception or blocked).

getThrowableClasses

public java.lang.String[] getThrowableClasses()
Gets the class hierarchy from the Throwable object that was passed to the corresponding constructor. Each String in the array will be a fully qualified class name. The first will be the full class name (with package name) of the Throwable object passed to this class. Each subsequent String shall contain the name of a super class up to but not including java.lang.Object.

Returns:
The stack trace from the Throwable object, or null if no Throwable object is available.






© 2015 - 2024 Weber Informatics LLC | Privacy Policy