com.ericsson.research.trap.delegates.OnObject |
Optional interface to be implemented by applications that wish to use the optimised loopback transport. This feature allows the application to send and receive objects directly when possible. Such usage completely eliminates the serialisation and deserialisation step of objects, providing a significant performance increase for applications.
Trap will use the callback method in this function when it receives a TrapObject from the remote side. This is
generally only applicable within the same JVM, although an RMI transport is possible. Trap does not have any logic to
deserialise objects; as such, if a TrapObject needs to be serialized as part of the transfer from the sending to
receiving endpoint, it will be received on the OnData
delegate.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Called when the Trap endpoint has received an object (i.e.
|
Called when the Trap endpoint has received an object (i.e. non-serialized data) from a loopback or other form of function call.
Only one of trapData(byte[], int, TrapEndpoint, Object)
and
trapObject(TrapObject, int, TrapEndpoint, Object)
will be called by Trap for each incoming message.
Thus:
object | The object sent from the other endpoint. |
---|---|
channel | The channel ID on which this object was received. |
endpoint | The TrapEndpoint object that received the object |
context | An application-supplied context for this listener. |