public interface

OnObject

implements TrapDelegate
com.ericsson.research.trap.delegates.OnObject

Class Overview

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.

Summary

Public Methods
abstract void trapObject(TrapObject object, int channel, TrapEndpoint endpoint, Object context)
Called when the Trap endpoint has received an object (i.e.

Public Methods

public abstract void trapObject (TrapObject object, int channel, TrapEndpoint endpoint, Object context)

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:

  • If the message received contains a TrapObject, this method will be called; else
  • If the message received contains binary data, trapData will be called.

Parameters
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.