public interface

TrapEndpointDelegate

com.ericsson.research.trap.TrapEndpointDelegate

This interface is deprecated.
Renamed to TrapEndpointDelegate

Class Overview

This interface has been superseded by the corresponding delegate in the com.ericsson.research.trap.delegates package. The trapData signature has also been renamed. Code should be updated correspondingly.

Summary

Public Methods
abstract void trapData(byte[] data, TrapEndpoint endpoint, Object context)
Called when the Trap endpoint has received byte data from the other end.
abstract void trapFailedSending(Collection<?> datas, TrapEndpoint endpoint, Object context)
Called when a Trap Endpoint knows it has failed to send some messages.
abstract void trapStateChange(TrapState newState, TrapState oldState, TrapEndpoint endpoint, Object context)
Called when Trap changes state.

Public Methods

public abstract void trapData (byte[] data, TrapEndpoint endpoint, Object context)

Called when the Trap endpoint has received byte data from the other end. This method executes in a Trap thread, so it should only perform minimal operations before returning, in order to allow for maximum throughput.

If asynchronous, this method may be called concurrently for each channel, but it may only be called simultaneously by one thread per channel. If the application does not explicitly utilise channels when sending messages, this function will only be called by one thread at a time.

Parameters
data The data received. The ownership of this array is transferred to the receiver. It will not be overwritten by Trap, and Trap will not read any changes off of it.
endpoint The TrapEndpoint that received the data.
context The original context object supplied to the TrapEndpoint for this delegate.

public abstract void trapFailedSending (Collection<?> datas, TrapEndpoint endpoint, Object context)

Called when a Trap Endpoint knows it has failed to send some messages. This can occur when the Trap Endpoint is killed forcibly, loses all its transports while still having an outgoing buffer, or fails to wake up a client that has disconnected all its transports normally.

Note that there are conditions when Trap may unwittingly lose data (such as data sent during a switch from unauthenticated -> authenticated session, when the authentication is triggered from the remote side), so the sum of data received by the other end, and called on this method, may be different. Additionally, there may be instances where data supplied by this method was received on the other side, but the successful transfer was not acknowledged.

In most cases, the objects in datas have most probably failed to be sent properly, and are supplied back to the application. The application may then inspect to see what failed, or discard it all.

Parameters
datas A collection of transportable objects that failed sending. Usually byte arrays, but may contain TrapObject instances.
endpoint The TrapEndpoint that failed sending.
context An application-supplied context for this listener.

public abstract void trapStateChange (TrapState newState, TrapState oldState, TrapEndpoint endpoint, Object context)

Called when Trap changes state. Includes both the new state, and the previous one.

Parameters
newState The new state of the TrapEndpoint endpoint.
oldState The previous state (the one right before the change). The combination of new/old state yields useful information on what the context is of the endpoint.
endpoint The TrapEndpoint instance that changed its state. Useful for when a single delegate manages multiple endpoints.
context The caller-specific context that was provided when the delegate was registered.