<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Wed Jul 28 01:21:15 GMT 1999 -->
<title>
  Class java.rmi.registry.LocateRegistry
</title>
</head>
<body>
<a name="_top_"></a>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.rmi.registry.html">This Package</a>  <a href="Package-java.rmi.registry.html">Previous</a>  <a href="Package-java.rmi.registry.html">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class java.rmi.registry.LocateRegistry
</h1>
<pre>
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
   |
   +----java.rmi.registry.LocateRegistry
</pre>
<hr>
<dl>
  <dt> public final class <b>LocateRegistry</b>
  <dt> extends <a href="java.lang.Object.html#_top_">Object</a>
</dl>
This class is used to obtain the bootstrap Registry on a particular
 host (including your local host). The following example demonstrates usage
 (minus exception handling):
 <br> Server wishes to make itself available to others:
	<br> SomeService service = ...; // remote object for service
	<br> Registry registry = LocateRegistry.getRegistry();
	<br> registry.bind("I Serve", service);
 <br> The client wishes to make requests of the above service:
	<br> Registry registry = LocateRegistry.getRegistry("foo.services.com");
	<br> SomeService service = (SomeService)registry.lookup("I Serve");
	<br> service.requestService(...);
<p>
<dl>
    <dt> <b>See Also:</b>
    <dd> <a href="java.rmi.registry.Registry.html#_top_">Registry</a>
</dl>
<hr>
<a name="index"></a>
<h2>
  <img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#createRegistry(int)"><b>createRegistry</b></a>(int)
  <dd>  Create and export a registry on the local host.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getRegistry()"><b>getRegistry</b></a>()
  <dd>  Returns the remote object Registry for the local host.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getRegistry(int)"><b>getRegistry</b></a>(int)
  <dd>  Returns the remote object Registry on the current host at the
 specified port.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getRegistry(java.lang.String)"><b>getRegistry</b></a>(String)
  <dd>  Returns the remote object Registry on the specified host at a
 default (i.e., well-known) port number.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getRegistry(java.lang.String, int)"><b>getRegistry</b></a>(String, int)
  <dd>  Returns the remote object Registry on the specified host at the
 specified port.
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="getRegistry()"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getRegistry"><b>getRegistry</b></a>
<pre>
 public static <a href="java.rmi.registry.Registry.html#_top_">Registry</a> getRegistry() throws <a href="java.rmi.RemoteException.html#_top_">RemoteException</a>
</pre>
<dl>
  <dd> Returns the remote object Registry for the local host.
<p>
</dl>
<a name="getRegistry(int)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getRegistry"><b>getRegistry</b></a>
<pre>
 public static <a href="java.rmi.registry.Registry.html#_top_">Registry</a> getRegistry(int port) throws <a href="java.rmi.RemoteException.html#_top_">RemoteException</a>
</pre>
<dl>
  <dd> Returns the remote object Registry on the current host at the
 specified port.
<p>
</dl>
<a name="getRegistry(java.lang.String)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getRegistry"><b>getRegistry</b></a>
<pre>
 public static <a href="java.rmi.registry.Registry.html#_top_">Registry</a> getRegistry(<a href="java.lang.String.html#_top_">String</a> host) throws <a href="java.rmi.RemoteException.html#_top_">RemoteException</a>, <a href="java.rmi.UnknownHostException.html#_top_">UnknownHostException</a>
</pre>
<dl>
  <dd> Returns the remote object Registry on the specified host at a
 default (i.e., well-known) port number.  If the host
 <code>String</code> reference is <code>null</code>, the local
 host is used.
<p>
</dl>
<a name="getRegistry(java.lang.String, int)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getRegistry"><b>getRegistry</b></a>
<pre>
 public static <a href="java.rmi.registry.Registry.html#_top_">Registry</a> getRegistry(<a href="java.lang.String.html#_top_">String</a> host,
                                    int port) throws <a href="java.rmi.RemoteException.html#_top_">RemoteException</a>, <a href="java.rmi.UnknownHostException.html#_top_">UnknownHostException</a>
</pre>
<dl>
  <dd> Returns the remote object Registry on the specified host at the
 specified port.  If port <= 0, the default Registry port number
 is used.  If the host <code>String</code> reference is
 <code>null</code>, the local host is used.
<p>
  <dd><dl>
    <dt> <b>Throws:</b> <a href="java.rmi.UnknownHostException.html#_top_">UnknownHostException</a>
    <dd> If the host is not known.
  </dl></dd>
</dl>
<a name="createRegistry(int)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="createRegistry"><b>createRegistry</b></a>
<pre>
 public static <a href="java.rmi.registry.Registry.html#_top_">Registry</a> createRegistry(int port) throws <a href="java.rmi.RemoteException.html#_top_">RemoteException</a>
</pre>
<dl>
  <dd> Create and export a registry on the local host.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> port - the port on which the registry is to be exported
    <dt> <b>Throws:</b> <a href="java.rmi.RemoteException.html#_top_">RemoteException</a>
    <dd> If failure occurs during remote
 object creation.
  </dl></dd>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.rmi.registry.html">This Package</a>  <a href="Package-java.rmi.registry.html">Previous</a>  <a href="Package-java.rmi.registry.html">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
