net.rmi.utils
Class ParametricSingletonRmiRegistry

java.lang.Object
  extended by net.rmi.utils.ParametricSingletonRmiRegistry

public final class ParametricSingletonRmiRegistry
extends java.lang.Object

DocJava, Inc. http://www.docjava.com Programmer: Francisco Castellanos & Douglas Lyon Date: March 14, 2006 net.rmi.utils.RmiRegistryUtils Is a Parametric singleton pattern that enables the creation of one and only one instance of the registry given a set of ports. Once the registry exists on a given port, it is not created again.


Method Summary
static java.rmi.registry.Registry getRegistry()
          Overloaded method for default port.
static java.rmi.registry.Registry getRegistry(java.lang.Integer port)
          Restart the registry, if needed.
static void listNames(java.lang.Integer port)
           
static void listNamesForAllRegistries()
           
static void main(java.lang.String[] args)
           
static void print(java.lang.Object[] o)
           
static void restart()
          Overloaded method for default port.
static void restart(int port)
          Checks whether a Registry has been started on this host in the specified port.
static void restart(java.lang.Integer port)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

listNames

public static void listNames(java.lang.Integer port)

listNamesForAllRegistries

public static void listNamesForAllRegistries()

print

public static void print(java.lang.Object[] o)

restart

public static void restart(int port)
Checks whether a Registry has been started on this host in the specified port. If not, it tries to start one. when it fails to start a Registry, it exits the program with exit code 1.


restart

public static void restart(java.lang.Integer port)

restart

public static void restart()
Overloaded method for default port. Checks whether a Registry has been started on this host. If not, it tries to start one. when it fails to start a Registry, it exits the program with exit code 1.


getRegistry

public static java.rmi.registry.Registry getRegistry(java.lang.Integer port)
Restart the registry, if needed. Return the only instance of the registry for consistent global using by making use of the Singleton Design Pattern

Returns:
the internally held registry instance.

getRegistry

public static java.rmi.registry.Registry getRegistry()
Overloaded method for default port. Restart the registry, if needed. Return the only instance of the registry for consistent global using by making use of the Singleton Design Pattern

Returns:
the internally held registry instance.

main

public static void main(java.lang.String[] args)
                 throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException