public interface

OnAccept

implements TrapDelegate
com.ericsson.research.trap.delegates.OnAccept
Known Indirect Subclasses

Class Overview

Interface to be implemented by the object responsible for dealing with new incoming Trap connections. This delegate will only be called for new incoming connections; reconnects to existing transports will be handled automatically by the Trap library.

Summary

Public Methods
abstract void incomingTrapConnection(TrapEndpoint endpoint, TrapListener listener, Object context)
Called on an incoming Trap connection.

Public Methods

public abstract void incomingTrapConnection (TrapEndpoint endpoint, TrapListener listener, Object context)

Called on an incoming Trap connection. The new endpoint is in OPEN, and can immediately be used to send messages. Messages will not begin to be dispatched to this endpoint until after this method has returned. Like most other callbacks, this should execute and return quickly.

The endpoint received using this method is only weakly referenced by Trap, and is thus eligible for garbage collection. Delegates must store a strong reference to the endpoint if they wish to use it.

While the endpoint is ready-to-use, it is blocked until the method returns. Consequently, all potentially-destructive operations on the endpoint, such as TrapEndpoint#setQueue(com.ericsson.research.trap.spi.MessageQueue) can safely be performed at this time. These methods should not be called after this method has returned, however.

Parameters
endpoint The new TrapEndpoint representing the created connection.
listener The TrapListener that called this delegate. Useful for when a delegate manages multiple listeners.
context Caller-specific context that was supplied when the delegate was registered.