List of usage examples for java.rmi NotBoundException NotBoundException
public NotBoundException(String s)
NotBoundException
with the specified detail message. From source file:com.vmware.identity.SharedUtils.java
private ILoginManager getLoginManager() throws NotBoundException, MalformedURLException, RemoteException { String endpointURL = String.format("rmi://%s:%d/IdentityManager", this._realIdmHostName, Tenant.RMI_PORT); boolean bNotBound = false; boolean bRemoteException = false; for (int i = 0; i < RETRY_COUNT; i++) { bNotBound = false;// w w w.j a v a 2 s . c o m bRemoteException = false; try { return (ILoginManager) Naming.lookup(endpointURL); } catch (NotBoundException e) { bNotBound = true; } catch (RemoteException e) { bRemoteException = true; } try { Thread.sleep(RETRY_TIMEOUT_SECS * 1000); } catch (InterruptedException e) { } } if (bNotBound) { throw new NotBoundException( String.format("Failed to bind to [%s] after [%d] attempts", endpointURL, RETRY_COUNT)); } else if (bRemoteException) { throw new RemoteException( String.format("Failed due to remote exception when looking up " + "[%s] after [%d] attempts", endpointURL, RETRY_COUNT)); } else { throw new RuntimeException( String.format("Failed to contact [%s] after [%d] attempts", endpointURL, RETRY_COUNT)); } }