com.ibm.as400.registry
Class ApplicationRegistry

java.lang.Object
  |
  +--com.ibm.as400.registry.Registry
        |
        +--com.ibm.as400.registry.ApplicationRegistry

public class ApplicationRegistry
extends Registry

The Registry implementation that stores data in the form of binary files in the local file system. This is the default implementation returned by Registry.getInstance. Use of this registry type is preferred over WindowsRegistry, which is not available on all platforms.

Applications should call the method setApplicationName to specify a unique name which will be used to name the files in the backing store. If no name is supplied the name "MyApplication" will be used. In production, taking the default is not recommended since multiple applications could share the same backing store, causing unpredictable behavior resulting from naming collisions in the node hierarchy.

The files which comprise the backing store are created in a config subdirectory under the platform-defined current directory. Applications should ensure that the current directory is set correctly on startup.

Since:
v5r1m0
See Also:
Registry

Fields inherited from class com.ibm.as400.registry.Registry
APPLICATION_REGISTRY, APPLICATION_ROOT, AS400_REGISTRY, LDAP_REGISTRY, PLATFORM_ROOT, REGISTRY_VERSION, SERVERS_ROOT, SESSION_ROOT, USER_ROOT, WINDOWS_REGISTRY
 
Method Summary
 java.lang.String getApplicationName()
          Returns the name of the application associated with this registry.
 RegistryNode getRoot(java.lang.String namespace)
          Returns the root of a registry namespace.
 void setApplicationName(java.lang.String name)
          Sets the name of the application associated with this registry.
 
Methods inherited from class com.ibm.as400.registry.Registry
getInstance, getInstance, getVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getApplicationName

public java.lang.String getApplicationName()
Returns the name of the application associated with this registry.
Returns:
The programmatic name of the application.
Since:
v5r1m0
See Also:
setApplicationName(java.lang.String)

setApplicationName

public void setApplicationName(java.lang.String name)
                        throws RegistryException
Sets the name of the application associated with this registry. An application name cannot contain any of the characters / \ : * ? " < > |.

Application names are scoped to the current process. Once the application name has been set for a process it cannot be changed.

Parameters:
name - The programmatic name of the application.
Throws:
java.lang.IllegalArgumentException - If the application name contains invalid characters.
RegistryException - If the application name has already been set to a different value.
Since:
v5r1m0
See Also:
getApplicationName()

getRoot

public RegistryNode getRoot(java.lang.String namespace)
                     throws RegistryException
Returns the root of a registry namespace.
Overrides:
getRoot in class Registry
Parameters:
namespace - A constant that identifies the desired namespace root.
Returns:
The root of the specified namespace.
Throws:
RegistryException - If the specified root cannot be accessed.
Since:
v5r1m0
See Also:
Registry, RegistryNode