Rio Project 4.2 API Documentation
org.rioproject.rmi
Class RegistryUtil
java.lang.Object
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.
- registryPort
Type:
|
int |
Default:
|
1099
|
Description:
|
The port to use when
creating the RMI Registry. This
entry will be read at initialization, and based on the value provided
by the registryRetries property, will be incremented
|
- registryRetries
Type:
|
int |
Default:
|
50
|
Description:
|
This
entry will be read at initialization and provides the ability to
recover from RMI Registry creation failure by incrementing the port the
RMI Registry instance will accept requests on. The port provided by the
registryPort property is used as a basis to increment from. If retries
are needed, the registryPort is incremented by one each time until
either the RMI Registry is created without exceptions, or the registry
retries have been exhausted
|
- Author:
- Dennis Reedy
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
RegistryUtil
public RegistryUtil()
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 © 2006-2011 Rio Project. All Rights Reserved.