Package org.scictrl.csshell
Class ResponseEvent<C extends AbstractConnector<?>>
java.lang.Object
java.util.EventObject
org.scictrl.csshell.ResponseEvent<C>
- Type Parameters:
C
- connector implementation
- All Implemented Interfaces:
Serializable
A base class for events used in asynchronous mode notifications.
Whenever a class declares the
AsynchronousAccess
interface, it
must provide listener registration and deregistration methods for
ResponseListeenrs
to which events of this type are delivered.
These events contain the reference to the request object for which they are
being dispatched, along with the associated response that is being deliverd
by this event notification.This class must be subclassed to have its abstract method implemented; in addition, the subtype may provide additional access to the containing request / response pair or other functions specific to the underlying implementation.
- Author:
- igor@scictrl.com
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionVariable holding a reference to the request object.Variable holding a reference to the response object.Fields inherited from class java.util.EventObject
source
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the request specified as a constructor parameter.Implementations of this method must return the response object that is causing this notification to be delivered.boolean
isLast()
Returnstrue
if this event is the last event in the series.boolean
isSuccess.Methods inherited from class java.util.EventObject
getSource, toString
-
Field Details
-
request
Variable holding a reference to the request object. The request contained by this field is the request for which a new response is being delivered. -
response
Variable holding a reference to the response object.
-
-
Constructor Details
-
ResponseEvent
Creates a new instance of the event, by specifying theAsynchronousAccess
source that generated the event and the request object which caused the notification to occur.- Parameters:
source
- the source firing the eventreq
- request the status of which has changedres
- aResponse
object
-
-
Method Details
-
getRequest
Returns the request specified as a constructor parameter. This event instance is delivering a response for the request returned by this method.- Returns:
- Object the request object
-
getResponse
Implementations of this method must return the response object that is causing this notification to be delivered. The response object should contain the reason for this event, for example new value delivered, timeout, error, successful completion etc.- Returns:
- Object the response object that is causing this event
-
isLast
public boolean isLast()Returnstrue
if this event is the last event in the series. In other words,true
indicates that no more events are forthcoming from the given request.- Returns:
true
if no more events will be delivered for the request contained in this event
-
isSuccess
public boolean isSuccess()isSuccess.
- Returns:
- a boolean
-