public abstract class ServiceEvent
extends java.lang.Object
ThreadedStorageService
.
Every event has an event code that indicates the state of a process when the event was generated. The event code will also give a guide as to what information the event will contain.
The event codes, and their meanings, are:
getErrorCause()
getIgnoredErrors()
EVENT_STARTED and EVENT_IN_PROGRESS events may include a ThreadWatcher
object containing
detailed information about the progress of an operation, such as how many threads have
completed and, of uploads and downloads, how many bytes have been transferred at what speed and
how long until the transfer is complete.
See the event object specific to the operation you are performing for more details about the information available in service events.
Modifier and Type | Field and Description |
---|---|
static int |
EVENT_CANCELLED |
static int |
EVENT_COMPLETED |
static int |
EVENT_ERROR |
static int |
EVENT_IGNORED_ERRORS |
static int |
EVENT_IN_PROGRESS |
static int |
EVENT_STARTED |
Modifier | Constructor and Description |
---|---|
protected |
ServiceEvent(int eventCode,
java.lang.Object uniqueOperationId) |
Modifier and Type | Method and Description |
---|---|
java.lang.Throwable |
getErrorCause() |
int |
getEventCode() |
java.lang.Throwable[] |
getIgnoredErrors() |
ThreadWatcher |
getThreadWatcher() |
java.lang.Object |
getUniqueOperationId() |
protected void |
setErrorCause(java.lang.Throwable t) |
protected void |
setIgnoredErrors(java.lang.Throwable[] ignoredErrors) |
protected void |
setThreadWatcher(ThreadWatcher threadWatcher) |
java.lang.String |
toString() |
public static final int EVENT_ERROR
public static final int EVENT_STARTED
public static final int EVENT_COMPLETED
public static final int EVENT_IN_PROGRESS
public static final int EVENT_CANCELLED
public static final int EVENT_IGNORED_ERRORS
protected ServiceEvent(int eventCode, java.lang.Object uniqueOperationId)
protected void setThreadWatcher(ThreadWatcher threadWatcher)
protected void setErrorCause(java.lang.Throwable t)
protected void setIgnoredErrors(java.lang.Throwable[] ignoredErrors)
public java.lang.Object getUniqueOperationId()
public int getEventCode()
public java.lang.Throwable getErrorCause() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- an error cause can only be retrieved from an EVENT_ERROR event.public java.lang.Throwable[] getIgnoredErrors() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- ignored errors can only be retrieved from an EVENT_IGNORED_ERRORS event.public ThreadWatcher getThreadWatcher() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- a thread watcher can only be retrieved from an EVENET_STARTED or EVENT_IN_PROGRESS event.public java.lang.String toString()
toString
in class java.lang.Object