|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ocap.system.event.SystemEvent
org.ocap.system.event.ErrorEvent
public class ErrorEvent
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. |
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 |
---|
public static final int APP_INFO_GENERAL_EVENT
public static final int APP_REC_GENERAL_ERROR
public static final int APP_REC_JAVA_THROWABLE
public static final int APP_CAT_GENERAL_ERROR
public static final int SYS_INFO_GENERAL_EVENT
public static final int SYS_REC_GENERAL_ERROR
public static final int SYS_CAT_GENERAL_ERROR
public static final int SYS_CAT_JAVA_THROWABLE
Constructor Detail |
---|
public ErrorEvent(int typeCode, java.lang.String message)
typeCode
- - Unique error type code.message
- - Readable error message.
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
.public ErrorEvent(int typeCode, java.lang.Throwable throwable)
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.
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
.public ErrorEvent(int typeCode, java.lang.String message, java.lang.String stacktrace, java.lang.String[] throwableClasses, long date, AppID appId)
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.
java.lang.SecurityException
- if this constructor is called by any application.Method Detail |
---|
public java.lang.String getStackTrace()
public java.lang.String getMessage()
getMessage
in class SystemEvent
public java.lang.String[] getThrowableClasses()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |