}
// First, look up the RMI registry
Registry registry = LocateRegistry.getRegistry(connectionInfo.getRmiServerHost(), connectionInfo.getRmiServerPort());
if (registry == null)
throw new OpenBPException("ServerConnection.Unvavailable", "Error connecting to server " + connectionInfo.getRmiServerHost()
+ ", port " + connectionInfo.getRmiServerPort() + ".");
// Next, get the service registry over RMI
try
{
server = (RemoteConnector) registry.lookup(CoreConstants.RMI_BINDING_NAME);
}
catch (NotBoundException e)
{
LogUtil.info(getClass(), "Connect to RMI server $0, port {1} failed.", connectionInfo.getRmiServerHost(), new Integer(connectionInfo.getRmiServerPort()));
throw new OpenBPException("ServerConnection.Unvavailable", "Error connecting to the RemoteConnector on the server", e);
}
LogUtil.info(getClass(), "Connected to RMI server.");
}
catch (RemoteException e)