public class MessageEndpointListener extends Object
Constructor and Description |
---|
MessageEndpointListener(MessageEndpointListenerConfiguration config) |
Modifier and Type | Method and Description |
---|---|
void |
accept(MessageEndpointConnection connection)
Accept a new connection.
|
ListenerToken |
addChangeListener(Executor queue,
MessageEndpointListenerChangeListener listener)
Add a change listener with the given dispatch queue.
|
ListenerToken |
addChangeListener(MessageEndpointListenerChangeListener listener)
Add a change listener.
|
void |
close(MessageEndpointConnection connection)
Close the given connection.
|
void |
closeAll()
Close all connections active at the time of the call.
|
void |
removeChangeListener(ListenerToken token)
Remove a change listener.
|
public MessageEndpointListener(@NonNull MessageEndpointListenerConfiguration config)
public void accept(@NonNull MessageEndpointConnection connection)
connection
- new incoming connectionpublic void close(@NonNull MessageEndpointConnection connection)
connection
- the connection to be closedpublic void closeAll()
@NonNull public ListenerToken addChangeListener(@NonNull MessageEndpointListenerChangeListener listener)
listener
- the listener@NonNull public ListenerToken addChangeListener(@Nullable Executor queue, @NonNull MessageEndpointListenerChangeListener listener)
queue
- the executor on which the listener will runlistener
- the listenerpublic void removeChangeListener(@NonNull ListenerToken token)
token
- identifier for the listener to be removed