Class TaskResultEvent<T>
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 EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionTaskResultEvent(ServerChannel channel, T value, Throwable thrown, RequestEvent request) Constructs a newTaskResultEventinstance. -
Method Summary
Methods inherited from class EventObject
getSource, toString
-
Constructor Details
-
TaskResultEvent
Constructs a newTaskResultEventinstance.- 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- ifchannelisnull.
-
-
Method Details
-
getServerChannel
Returns the server channel of this event.- Returns:
- the server channel of this event.
-
getValue
-
getError
Returns the exception thrown by the task. It returnsnullif the task returned a value and did not throw an exception.- Returns:
- the exception or
nullif no exception was thrown. - See Also:
-
getRequest
Returns the request that executed the server task.- Returns:
- the request or
nullif none specified.
-