com.neeve.config
Class ConfigRepositoryFactory

java.lang.Object
  extended by com.neeve.root.RootObject
      extended by com.neeve.config.ConfigObject
          extended by com.neeve.config.ConfigRepositoryFactory

public final class ConfigRepositoryFactory
extends ConfigObject

The configuration repository factory.

The configuration repository factory, a singleton object, provides methods to open configuration repositorys.

Threading:
The configuration repository factory is not safe for concurrent access by multiple threads.

Field Summary
static String DEFAULT_CONFIG_DESCRIPTOR
           
static String LOCAL_CONFIG_DESCRIPTOR
           
 
Method Summary
 void close()
          Close all open repositories
 IConfigRepository createRepository(String descriptorStr)
          Create a new configuration repository.
 IConfigRepository getDefaultRepository()
          Get the default configuration repository
static ConfigRepositoryFactory getInstance()
          Get the singleton configuration repository factory instance.
 IConfigRepository getLocalRepository()
          Get the local configuration repository
 IConfigRepository openRepository(String descriptorStr)
          Open an existing configuration repository.
 boolean repositoryExists(String descriptorStr)
          Check if a repository exists.
 
Methods inherited from class com.neeve.root.RootObject
getChecked, getThreaded, getTracer, setChecked, setTracer
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCAL_CONFIG_DESCRIPTOR

public static final String LOCAL_CONFIG_DESCRIPTOR

DEFAULT_CONFIG_DESCRIPTOR

public static final String DEFAULT_CONFIG_DESCRIPTOR
Method Detail

getInstance

public static final ConfigRepositoryFactory getInstance()
Get the singleton configuration repository factory instance.

Threading:
This method is safe for concurrent access by multiple threads.

createRepository

public final IConfigRepository createRepository(String descriptorStr)
                                         throws EConfigException
Create a new configuration repository.

Parameters:
descriptorStr - The string representation of an address descriptor that describes the repository to create.
Throws:
EConfigException - Thrown in case an error occurs during the creation of the repository.
Threading:
This method is safe for concurrent access by multiple threads.

This method will fail if the repository is already present.


openRepository

public final IConfigRepository openRepository(String descriptorStr)
                                       throws EConfigException
Open an existing configuration repository.

Parameters:
descriptorStr - The string representation of an address descriptor that describes the repository to open.
Throws:
EConfigException - Thrown in case an error occurs during the opening of the repository.
Threading:
This method is safe for concurrent access by multiple threads.

This method will fail if the repository is absent.


repositoryExists

public final boolean repositoryExists(String descriptorStr)
                               throws EConfigException
Check if a repository exists.

Parameters:
descriptorStr - The string representation of an address descriptor that describes the repository to check for.
Throws:
EConfigException - Thrown in case an error occurs during the existence check of the repository.
Threading:
This method is safe for concurrent access by multiple threads.

getLocalRepository

public final IConfigRepository getLocalRepository()
Get the local configuration repository

Threading:
This method is safe for concurrent access by multiple threads.

getDefaultRepository

public final IConfigRepository getDefaultRepository()
Get the default configuration repository

Threading:
This method is safe for concurrent access by multiple threads.

close

public final void close()
Close all open repositories

Threading:
This method is not safe for concurrent access by multiple threads.

This should be the last call to the factory.



Copyright © 2016 Neeve Research, LLC. All Rights Reserved.