Rio Project 4.2 API Documentation



org.rioproject.rmi
Class RegistryUtil

java.lang.Object
  extended by org.rioproject.rmi.RegistryUtil

public class RegistryUtil
extends Object

Utility for getting/creating the RMI Registry.

Configuration

The RegistryUtil class supports the following configuration entries; where each configuration entry name is associated with the component name org.rioproject.rmi.

Author:
Dennis Reedy

Field Summary
static int DEFAULT_PORT
           
static int DEFAULT_RETRY_COUNT
           
 
Constructor Summary
RegistryUtil()
           
 
Method Summary
static void checkRegistry(Configuration config)
          Check if RMI Registry has been started for the VM, if not start it.
static int getRegistry(Configuration config)
          Check if RMI Registry has been started for the VM, if not start it.
static int getRegistryRetries(Configuration config)
          Get the registryRetries property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PORT

public static final int DEFAULT_PORT
See Also:
Constant Field Values

DEFAULT_RETRY_COUNT

public static final int DEFAULT_RETRY_COUNT
See Also:
Constant Field Values
Constructor Detail

RegistryUtil

public RegistryUtil()
Method Detail

checkRegistry

public static void checkRegistry(Configuration config)
                          throws ConfigurationException
Check if RMI Registry has been started for the VM, if not start it. This method will use the Constants.REGISTRY_PORT system property to determine if the Registry has been created.

If the RMI Registry is created, this method will also set the

Parameters:
config - Configuration object to use
Throws:
ConfigurationException - If there are errors reading the configuration

getRegistry

public static int getRegistry(Configuration config)
                       throws ConfigurationException
Check if RMI Registry has been started for the VM, if not start it.

Parameters:
config - Configuration object to use
Returns:
The port the RMI Registry was created on, or -1 if the RMIRegistry could not be created
Throws:
ConfigurationException - If there are errors reading the configuration

getRegistryRetries

public static int getRegistryRetries(Configuration config)
Get the registryRetries property.

Parameters:
config - The Configuration to use, if null a default value is returned
Returns:
The number of times to attempt to find an RMI Registry instance

Copyright © Rio Project.

Copyright © 2006-2011 Rio Project. All Rights Reserved.