java.lang.Object
java.util.EventObject
cl.netswitch.lib.server.TaskResultEvent<T>
- Type Parameters:
T
- the type of the value computed by the task.
- All Implemented Interfaces:
Serializable
TaskResultEvent is used to notify that a task has computed a result.
- See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorsConstructorDescriptionTaskResultEvent
(ServerChannel channel, T value, Throwable thrown, RequestEvent request) Constructs a newTaskResultEvent
instance. -
Method Summary
Methods inherited from class java.util.EventObject
getSource, toString
-
Constructor Details
-
TaskResultEvent
Constructs a newTaskResultEvent
instance.- Parameters:
channel
- the object on which the event occurred.value
- the value computed by the task (can be null).thrown
- exception thrown by the task (can be null).request
- the request that executed the task (can be null).- Throws:
NullPointerException
- ifchannel
isnull
.
-
-
Method Details
-
getServerChannel
Returns the server channel of this event.- Returns:
- the server channel of this event.
-
getValue
Returns the value computed by the task. If the task completed by throwing an exception, this method throws that exception.- Returns:
- the value computed by the task (can be null).
- Throws:
Exception
- the exception thrown by the task.- See Also:
-
getError
Returns the exception thrown by the task. It returnsnull
if the task returned a value and did not throw an exception.- Returns:
- the exception or
null
if no exception was thrown. - See Also:
-
getRequest
Returns the request that executed the server task.- Returns:
- the request or
null
if none specified.
-