public class ManagerEventListenerProxy extends Object implements ManagerEventListener
Use this proxy to prevent the reader thread from being blocked while your
application processes ManagerEvents.
If you want to use the ManagerConnection for
sending actions in your ManagerEventListener
using a proxy like this one is mandatory; otherwise you will always run into
a timeout because the reader thread that is supposed to read the response to
your action is still blocked processing the event.
If in doubt use the proxy as it won't hurt.
Example:
ManagerConnection connection; ManagerEventListener myListener; ... connection.addEventListener(new ManagerEventListenerProxy(myListener));
| Modifier and Type | Class and Description |
|---|---|
static class |
ManagerEventListenerProxy.Access |
| Constructor and Description |
|---|
ManagerEventListenerProxy(ManagerEventListener target)
Creates a new ManagerEventListenerProxy that notifies the given target
asynchronously when new events are received.
|
| Modifier and Type | Method and Description |
|---|---|
void |
onManagerEvent(ManagerEvent event)
This method is called when an event is received.
|
void |
shutdown() |
public ManagerEventListenerProxy(ManagerEventListener target)
target - the target listener to invoke.Executors.newSingleThreadExecutor(ThreadFactory)public void onManagerEvent(ManagerEvent event)
ManagerEventListeneronManagerEvent in interface ManagerEventListenerevent - the event that has been receivedpublic void shutdown()
Copyright © 2004–2022. All rights reserved.