Package VASSAL.tools.ipc
Class IPCMessenger
java.lang.Object
VASSAL.tools.ipc.IPCMessenger
public class IPCMessenger extends Object
-
Field Summary
Fields Modifier and Type Field Description protected ObjectInputStream
in
protected MultiEventListenerSupport
lsup
protected AtomicLong
next_id
protected ObjectOutputStream
out
protected BlockingQueue<IPCMessage>
outqueue
protected Map<Long,CompletableFuture<IPCMessage>>
waiting
-
Constructor Summary
Constructors Constructor Description IPCMessenger(InputStream in, OutputStream out)
IPCMessenger(InputStream in, OutputStream out, MultiEventListenerSupport lsup)
IPCMessenger(Socket sock)
-
Method Summary
Modifier and Type Method Description <T> void
addEventListener(Class<T> c, EventListener<? super T> l)
Adds anEventListener
.<T> List<EventListener<? super T>>
getEventListeners(Class<T> c)
Notify the listeners of an event.boolean
hasEventListeners(Class<?> c)
Checks whether there are anyEventListener
s.<T> void
removeEventListener(Class<T> c, EventListener<? super T> l)
Removes anEventListener
.Future<IPCMessage>
send(IPCMessage msg)
void
start()
void
stop()
-
Field Details
-
next_id
-
waiting
-
outqueue
-
in
-
out
-
lsup
-
-
Constructor Details
-
IPCMessenger
public IPCMessenger(InputStream in, OutputStream out, MultiEventListenerSupport lsup) throws IOException- Throws:
IOException
-
IPCMessenger
- Throws:
IOException
-
IPCMessenger
- Throws:
IOException
-
-
Method Details
-
start
- Throws:
IOException
-
stop
- Throws:
IOException
-
send
- Throws:
IOException
-
addEventListener
Adds anEventListener
.- Parameters:
c
- the class to listen forl
- the listener to add
-
removeEventListener
Removes anEventListener
.- Parameters:
c
- the class to checkl
- the listener to remove
-
hasEventListeners
Checks whether there are anyEventListener
s.- Parameters:
c
- the class to check- Returns:
true
if there are any listeners for the given class
-
getEventListeners
Notify the listeners of an event.- Parameters:
event
- the event to send
-