|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.indexdata.masterkey.config.MasterkeyConfiguration
public class MasterkeyConfiguration
Represents the configuration context for modules within this J2EE component. An instance of this class basically has a one-to-one relationship with the properties file for the component/vhost From this context it is possible to obtain configurations for sub-modules within the component. The configuration of a sub-module would be those properties in the components properties file that are prefixed with a given module name. It is possible to force the file name (but not the path to it) to be something data-dependent. 'Component': Basically a .war file 'Module': Sub-functions within the component, i.e. a Servlet, a REST service, a plug-in, etc. Throws ServletException If the configuration file (property file) is not found
Field Summary | |
---|---|
static String |
MASTERKEY_CONFIG_LIFE_TIME_PARAM
|
Method Summary | |
---|---|
boolean |
areConfigParamsCached()
|
com.indexdata.masterkey.config.ConfigFileLocation |
getConfigFileLocation()
|
String |
getConfigParameter(String prefix,
String name)
Retrieves a given config parameter by name and module/prefix. |
Enumeration<String> |
getConfigParameterNames(String prefix)
Retrieves all config parameter names for the module |
Map<String,String> |
getConfigParamsAsMap(String prefix)
Retrieves all config parameters for a module/prefix as a HashMap. |
Properties |
getConfigParamsAsProperties(String prefix)
Returns the config parameters as Properties for a module/prefix |
String |
getContextKey()
Provides a unique key for this configuration context (unique per j2ee component and vhost) |
String |
getHostName()
Host name intended for use in logging. |
static MasterkeyConfiguration |
getInstance(javax.servlet.ServletContext servletContext,
String appId,
String hostName)
Creates a singleton MasterkeyConfiguration for each combination of component name and host name. |
static MasterkeyConfiguration |
getInstance(javax.servlet.ServletContext servletContext,
String appId,
String hostName,
String configFileName)
Creates a singleton MasterkeyConfiguration for each combination of component name, host name, and property file name. |
ModuleConfiguration |
getModuleConfiguration(String moduleName)
Creates a ModuleConfiguration holding the subset of properties that applies to the given module |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String MASTERKEY_CONFIG_LIFE_TIME_PARAM
Method Detail |
---|
public static MasterkeyConfiguration getInstance(javax.servlet.ServletContext servletContext, String appId, String hostName) throws IOException
servletContext
- Needed to pick up init parameters regarding the location of config fileshostName
- Used for resolving the path to config files.
IOException
public static MasterkeyConfiguration getInstance(javax.servlet.ServletContext servletContext, String appId, String hostName, String configFileName) throws IOException
servletContext
- Needed to pick up init parameters regarding the location of config fileshostName
- Used for resolving the path to config files.configFileName
- Defined by components code.
IOException
public String getContextKey()
public ModuleConfiguration getModuleConfiguration(String moduleName) throws IOException
moduleName
- Must match the prefix of the properties to pick up
IOException
public boolean areConfigParamsCached()
public Enumeration<String> getConfigParameterNames(String prefix) throws IOException
javax.servlet.ServletException
IOException
public String getConfigParameter(String prefix, String name) throws IOException
name
-
javax.servlet.ServletException
IOException
public Map<String,String> getConfigParamsAsMap(String prefix) throws IOException
javax.servlet.ServletException
IOException
public com.indexdata.masterkey.config.ConfigFileLocation getConfigFileLocation()
public String getHostName()
public Properties getConfigParamsAsProperties(String prefix) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |