net.groboclown.eventbus.v2.rmi
Class RemoteEventBus
java.lang.Object
|
+--java.rmi.server.RemoteObject
|
+--java.rmi.server.RemoteServer
|
+--java.rmi.server.UnicastRemoteObject
|
+--net.groboclown.eventbus.v2.rmi.RemoteEventBus
- All Implemented Interfaces:
- IRemoteEventBus, Remote, Serializable
- public class RemoteEventBus
- extends UnicastRemoteObject
- implements IRemoteEventBus
Master control unit which is in charge of registering event listeners,
deregistering event listeners, and distributing events. There are
no default distributors, so those must be manually added, or
specified as external distributors through the command-line.
This has been redesigned to allow for multiple busses to co-exist within
the same VM.
- Version:
- Alpha 0.9.0
- Author:
- Matt Albrecht
- See Also:
- Serialized Form
serialVersionUID
static final long serialVersionUID
localBus
private EventBus localBus
DEBUG
private static final boolean DEBUG
RemoteEventBus
private RemoteEventBus()
throws RemoteException
RemoteEventBus
public RemoteEventBus(EventBus busToRegister)
throws RemoteException
registerEventBus
public static void registerEventBus(EventBus busToBeRemoted,
String bindName)
throws RemoteException,
MalformedURLException
- Register a local bus as accessible from an outside VM.
- Parameters:
bindName
- the RMI lookup name to bind the event bus to. Must be
of the form "//hostname/rmi name".
getRegisteredEventBus
public static IRemoteEventBus getRegisteredEventBus(String bindName)
throws RemoteException,
MalformedURLException,
NotBoundException
- Loads a remote registered event bus into this VM.
- Parameters:
bindName
- the RMI lookup name to find the bounded event bus.
Must be of the form "//hostname/rmi name".
addRemoteListener
public void addRemoteListener(IRemoteListener listener)
throws RemoteException
- Add the given listener to the list, and generates a filter agent.
- Specified by:
addRemoteListener
in interface IRemoteEventBus
removeRemoteListener
public boolean removeRemoteListener(IRemoteListener listener)
throws RemoteException
- Deregister the given listener and its filter.
- Specified by:
removeRemoteListener
in interface IRemoteEventBus
- Returns:
- true if the listener was found and removed, or
false if it could not be found.
redirectEvent
public void redirectEvent(RemoteEventBusEvent rebe)
throws RemoteException
- Specified by:
redirectEvent
in interface IRemoteEventBus
getBusId
public String getBusId()
throws RemoteException
- Specified by:
getBusId
in interface IRemoteEventBus
Written under the LGPL