com.ericsson.research.trap.TrapEndpointDelegate |
This interface is deprecated.
Renamed to TrapEndpointDelegate
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.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Called when the Trap endpoint has received byte data from the other end.
| |||||||||||
Called when a Trap Endpoint knows it has failed to send some messages.
| |||||||||||
Called when Trap changes state.
|
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.
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. |
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.
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. |
Called when Trap changes state. Includes both the new state, and the previous one.
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. |