LocateRegistry is used to obtain a reference to a bootstrap
 remote object registry on a particular host (including the local host), or
 to create a remote object registry that accepts calls on a specific port.
  Note that a getRegistry call does not actually make a
 connection to the remote host.  It simply creates a local reference to
 the remote registry and will succeed even if no registry is running on
 the remote host.  Therefore, a subsequent method invocation to a remote
 registry returned as a result of this method may fail.
- Since:
- 1.1
- See Also:
- 
Method SummaryModifier and TypeMethodDescriptionstatic RegistrycreateRegistry(int port) Creates and exports aRegistryinstance on the local host that accepts requests on the specifiedport.static RegistrycreateRegistry(int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) Creates and exports aRegistryinstance on the local host that uses custom socket factories for communication with that instance.static RegistryReturns a reference to the remote objectRegistryfor the local host on the default registry port of 1099.static RegistrygetRegistry(int port) Returns a reference to the remote objectRegistryfor the local host on the specifiedport.static RegistrygetRegistry(String host) Returns a reference to the remote objectRegistryon the specifiedhoston the default registry port of 1099.static RegistrygetRegistry(String host, int port) Returns a reference to the remote objectRegistryon the specifiedhostandport.static RegistrygetRegistry(String host, int port, RMIClientSocketFactory csf) Returns a locally created remote reference to the remote objectRegistryon the specifiedhostandport.
- 
Method Details- 
getRegistryReturns a reference to the remote objectRegistryfor the local host on the default registry port of 1099.- Returns:
- reference (a stub) to the remote object registry
- Throws:
- RemoteException- if the reference could not be created
- Since:
- 1.1
 
- 
getRegistryReturns a reference to the remote objectRegistryfor the local host on the specifiedport.- Parameters:
- port- port on which the registry accepts requests
- Returns:
- reference (a stub) to the remote object registry
- Throws:
- RemoteException- if the reference could not be created
- Since:
- 1.1
 
- 
getRegistryReturns a reference to the remote objectRegistryon the specifiedhoston the default registry port of 1099. Ifhostisnull, the local host is used.- Parameters:
- host- host for the remote registry
- Returns:
- reference (a stub) to the remote object registry
- Throws:
- RemoteException- if the reference could not be created
- Since:
- 1.1
 
- 
getRegistryReturns a reference to the remote objectRegistryon the specifiedhostandport. Ifhostisnull, the local host is used.- Parameters:
- host- host for the remote registry
- port- port on which the registry accepts requests
- Returns:
- reference (a stub) to the remote object registry
- Throws:
- RemoteException- if the reference could not be created
- Since:
- 1.1
 
- 
getRegistrypublic static Registry getRegistry(String host, int port, RMIClientSocketFactory csf) throws RemoteException Returns a locally created remote reference to the remote objectRegistryon the specifiedhostandport. Communication with this remote registry will use the suppliedRMIClientSocketFactorycsfto createSocketconnections to the registry on the remotehostandport.- Parameters:
- host- host for the remote registry
- port- port on which the registry accepts requests
- csf- client-side- Socketfactory used to make connections to the registry. If- csfis null, then the default client-side- Socketfactory will be used in the registry stub.
- Returns:
- reference (a stub) to the remote registry
- Throws:
- RemoteException- if the reference could not be created
- Since:
- 1.2
 
- 
createRegistryCreates and exports aRegistryinstance on the local host that accepts requests on the specifiedport.The Registryinstance is exported as if the staticUnicastRemoteObject.exportObjectmethod is invoked, passing theRegistryinstance and the specifiedportas arguments, except that theRegistryinstance is exported with a well-known object identifier, anObjIDinstance constructed with the valueObjID.REGISTRY_ID.- Parameters:
- port- the port on which the registry accepts requests
- Returns:
- the registry
- Throws:
- RemoteException- if the registry could not be exported
- Since:
- 1.1
 
- 
createRegistrypublic static Registry createRegistry(int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) throws RemoteException Creates and exports aRegistryinstance on the local host that uses custom socket factories for communication with that instance. The registry that is created listens for incoming requests on the givenportusing aServerSocketcreated from the suppliedRMIServerSocketFactory.The Registryinstance is exported as if the staticUnicastRemoteObject.exportObjectmethod is invoked, passing theRegistryinstance, the specifiedport, the specifiedRMIClientSocketFactory, and the specifiedRMIServerSocketFactoryas arguments, except that theRegistryinstance is exported with a well-known object identifier, anObjIDinstance constructed with the valueObjID.REGISTRY_ID.- Parameters:
- port- port on which the registry accepts requests
- csf- client-side- Socketfactory used to make connections to the registry
- ssf- server-side- ServerSocketfactory used to accept connections to the registry
- Returns:
- the registry
- Throws:
- RemoteException- if the registry could not be exported
- Since:
- 1.2
 
 
-