org.sapia.regis.local
Class LocalRegistryFactory
java.lang.Object
org.sapia.regis.local.LocalRegistryFactory
- All Implemented Interfaces:
- RegistryFactory
public class LocalRegistryFactory
- extends java.lang.Object
- implements RegistryFactory
This class instantiates an in-memory registry that supports writes, but not transactions
(all writes are instantly committed).
An instance of this class can be specified the path to an XML configuration resource
that must be used to initialize the registry before it is returned:
Properties props = new Properties();
props.setProperty(RegistryContext.FACTORY_CLASS,
LocalRegistryFactory.class.getName());
props.setProperty(LocalRegistryFactory.BOOTSTRAP,
"org/acme/registry/config.xml");
RegistryContext context = new RegistryContext();
Registry regis = context.connect(props);
Note that the bootstrap property can be optionally specified to indicate a comma-delimited list
of configuration resources that will be loaded at initialization of the local registry. Each resource
is interpreted as file (in the file system), a URL, or a classpath resource, whatever works first.
- Author:
- yduchesne
- See Also:
LocalRegistry
|
Field Summary |
static java.lang.String |
BOOTSTRAP
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BOOTSTRAP
public static final java.lang.String BOOTSTRAP
- See Also:
- Constant Field Values
LocalRegistryFactory
public LocalRegistryFactory()
connect
public Registry connect(java.util.Properties props)
throws java.lang.Exception
- Specified by:
connect in interface RegistryFactory
- Parameters:
props - the Properties to used to connect to the desired
Registry.
- Returns:
- a
LocalRegistry instance.
- Throws:
java.lang.Exception - if a problem occurs while attempting to connect.- See Also:
RegistryFactory.connect(Properties)
Copyright © 2011 Sapia OSS. All Rights Reserved.