T
- the type of value returned from the Operation
when it
is invokedpublic interface Operation<T>
Client
,
Server
,
OperationHandler
Modifier and Type | Method and Description |
---|---|
String |
getType()
The type of the operation.
|
T |
onInvoke(ObjectInputStream ois,
ObjectOutputStream oos)
Initiate and invoke an operation returning the result.
|
String getType()
T onInvoke(ObjectInputStream ois, ObjectOutputStream oos) throws IOException, ClassNotFoundException, ExecutionException
This method is executed by a Client
in response to a
Client.invoke(Operation)
request. The objective of this method
is to send/receive information to/from a Server
using the
provided streams. The actual execution of the Operation
is
performed by an appropriate OperationHandler
known to the
Server
of the required getType()
.
ois
- the ObjectInputStream
to read information from the
Server
, typically the result from the OperationHandler
oos
- the ObjectOutputStream
to send information to the
Server
, typically the parameters to the OperationHandler
Operation
IOException
- when the Operation can't read/write to the streamsClassNotFoundException
- when the operation can't load a required classExecutionException
- when an exception occurred invoking the operationCopyright © 2014. All Rights Reserved.