ReplyType
- The type of data produced as replies to the implemented
functionality.RequestType
- The type of data required as request parameterpublic abstract class DataCallback<ReplyType,RequestType> extends Object implements Callback
LocalServer
method with a simple
signature without events. This makes implementing callbacks simple, because
no RSB Event
instances need to be used. However, this e.g. prevents
setting timestamps or further meta data of events. If you need such a
behavior, please use EventCallback
.
In case you either do not need a request paramter or do not return any data,
specify the respective java generics parameter as Void
. You can then
safely return null
if you have no result. In other cases,
null
is explicitly not allowed. TODO check the null assumptionCallback.UserCodeException
Constructor and Description |
---|
DataCallback() |
Modifier and Type | Method and Description |
---|---|
Event |
internalInvoke(Event request)
Method to invoke the
Callback 's functionality. |
abstract ReplyType |
invoke(RequestType request)
This method is called to invoke the actual behavior of an exposed method.
|
public Event internalInvoke(Event request) throws Callback.UserCodeException
Callback
Callback
's functionality. This method can be
considered an internal implementation detail.internalInvoke
in interface Callback
request
- the request received from a RemoteServer
method callCallback.UserCodeException
- any exception in the user code invoked by the callbackpublic abstract ReplyType invoke(RequestType request) throws Exception
request
- The argument passed to the associated method by the remote
caller.Exception
- Can throw anything.Copyright © 2018 CoR-Lab. All rights reserved.