public abstract class RemoteEventManager
extends java.lang.Object
implements java.io.Closeable
Modifier and Type | Class and Description |
---|---|
protected static class |
RemoteEventManager.InternalCall |
Modifier | Constructor and Description |
---|---|
protected |
RemoteEventManager(SocketWrapper socket) |
Modifier and Type | Method and Description |
---|---|
protected void |
addToSendingQueue(java.io.Serializable object) |
void |
close() |
protected void |
connectListenerAndObject(java.lang.Object obj,
RemoteListener listener)
This method should be used to match the objects and the listeners.
|
abstract void |
connectRemoteListeners()
This method connects the remote listeners to the appropriate object.
|
protected java.util.List<RemoteListener> |
getRemoteListeners()
This method returns the remote listeners.
|
protected void |
registerListeners(java.util.List<java.util.EventListener> listeners)
This class register the local listeners and sends the associated remote listeners through
the socket.
|
void |
sendLocalListeners(java.util.List<java.util.EventListener> listeners)
This method sends the local listeners.
|
protected void |
waitForCloseCall()
This method makes the main thread waits for the receiver and the sender threads to die.
|
protected void |
whatShouldIDoWithThisObjectIJustReceived(java.lang.Object obj)
This method already handles object that are either RemoteEvent instance and
List of RemoteListener instances.
|
protected RemoteEventManager(SocketWrapper socket)
protected void registerListeners(java.util.List<java.util.EventListener> listeners) throws java.io.IOException
listeners
- a List of Event Listenerjava.io.IOException
- if the remote listeners cannot be sent through the socketprotected java.util.List<RemoteListener> getRemoteListeners() throws java.lang.InterruptedException
java.lang.InterruptedException
- if the lock is interrupted for unknown reasonprotected void whatShouldIDoWithThisObjectIJustReceived(java.lang.Object obj)
obj
- an instance from unknown instancepublic void sendLocalListeners(java.util.List<java.util.EventListener> listeners) throws java.io.IOException
listeners
- a List of EventListener instancesjava.io.IOException
public abstract void connectRemoteListeners() throws java.lang.Exception
java.lang.Exception
protected void connectListenerAndObject(java.lang.Object obj, RemoteListener listener) throws java.lang.Exception
obj
- the object that produces the eventslistener
- a RemoteListener instancejava.lang.Exception
- if the method does not exist or cannot be accessed.protected void addToSendingQueue(java.io.Serializable object)
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
protected void waitForCloseCall() throws java.lang.InterruptedException
java.lang.InterruptedException
java.io.IOException