textbender.g.rmi
Class RegistryX

java.lang.Object
  extended by RegistryX

public class RegistryX
extends Object

RMI boot-registry utilities and definitions.

Note that Sun's implementation of the registry is supposed to restrict binding/rebinding to local (same host) callers. Although other hosts cannot bind, they can do lookups.


Field Summary
static int STANDARD_REGISTRY_PORT
          Default port for the RMI boot-registry.
 
Method Summary
static Registry ensureRegistry()
          Ensures a boot-registry exists on the local host at the standard port, and returns a reference to it.
static Registry getRegistryOrNull()
          Returns a remote reference to the boot-registry on the local host at the standard port, but only if one exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STANDARD_REGISTRY_PORT

public static final int STANDARD_REGISTRY_PORT
Default port for the RMI boot-registry.

See Also:
Constant Field Values
Method Detail

ensureRegistry

public static Registry ensureRegistry()
                               throws RemoteException
Ensures a boot-registry exists on the local host at the standard port, and returns a reference to it. The same as LocateRegistry.getRegistry(), except that it creates the registry, if necessary.

Throws:
RemoteException

getRegistryOrNull

public static Registry getRegistryOrNull()
                                  throws RemoteException
Returns a remote reference to the boot-registry on the local host at the standard port, but only if one exists. Otherwise the same as LocateRegistry.getRegistry().

Returns:
remote reference to the boot-registry, or null if no registry exists
Throws:
RemoteException