|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metamatrix.common.config.CurrentConfiguration
public final class CurrentConfiguration
This class represents a single and universal framework for accessing the current configuration for an application or server VM. The current configuration contains the specification of runtime properties and component deployment information. Depending upon the bootstrap information, this framework may access the configuration information from a central repository or simply from a local file.
This framework can be configured to periodically refresh the cached
configuation information, and a separate thread is used to do this in
the background. As such, the static shutdown()
method
should be called by applications when exiting. This method will block until
this framework has successfully shutdown and cleaned up all resources,
and will return gracefully if the method were already called.
Note, however, that any call to this framework to obtain configuration
information will restart the framework, requiring another eventual
shutdown.
Field Summary | |
---|---|
static java.lang.String |
BOOTSTRAP_FILE_NAME
|
static java.lang.String |
BOOTSTRAP_FILE_PROPERTY_OVERRIDE
|
static java.lang.String |
CLUSTER_MEMBERS
|
static java.lang.String |
CLUSTER_NAME
|
static java.lang.String |
CONFIGURATION_NAME
|
static java.lang.String |
CONFIGURATION_READER_CLASS_PROPERTY_NAME
|
Method Summary | |
---|---|
java.lang.String |
getBindAddress()
|
java.util.Properties |
getBootStrapProperties()
|
java.lang.String |
getClusterName()
|
java.util.Collection<ComponentType> |
getComponentTypes(boolean includeDeprecated)
Returns a Collection of type ComponentType that represent
all the ComponentTypes defined. |
Configuration |
getConfiguration()
Get the current configuration that is to be used for deployment. |
ConfigurationModelContainer |
getConfigurationModel()
Get the current configuration that is to be used for deployment. |
java.lang.String |
getConfigurationName()
|
Host |
getDefaultHost()
Returns the Host based on the current running machine. |
java.net.InetAddress |
getHostAddress()
|
java.lang.String |
getHostInfo()
Return the stringified representation of this application information object. |
static CurrentConfiguration |
getInstance()
|
java.lang.String |
getProcessName()
|
java.util.Properties |
getProperties()
Get all of the configuration properties. |
java.util.Properties |
getResourceProperties(java.lang.String resourceName)
Get the connection properties for the specified resource. |
java.util.Properties |
getSystemBootStrapProperties()
|
boolean |
isAvailable()
|
static void |
reset()
Reset causes not just a refresh, but the bootstrapping process to occur again. |
void |
setProcessName(java.lang.String name)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String BOOTSTRAP_FILE_PROPERTY_OVERRIDE
public static final java.lang.String BOOTSTRAP_FILE_NAME
public static final java.lang.String CONFIGURATION_READER_CLASS_PROPERTY_NAME
public static final java.lang.String CLUSTER_NAME
public static final java.lang.String CONFIGURATION_NAME
public static final java.lang.String CLUSTER_MEMBERS
Method Detail |
---|
public static CurrentConfiguration getInstance()
public boolean isAvailable()
public java.lang.String getHostInfo()
public void setProcessName(java.lang.String name)
public java.lang.String getBindAddress()
public java.net.InetAddress getHostAddress()
public java.lang.String getConfigurationName()
public java.lang.String getProcessName()
public java.lang.String getClusterName() throws ConfigurationException
ConfigurationException
public java.util.Properties getProperties()
ConfigurationException
- if the current configuration and/or
bootstrap properties could not be obtainedpublic java.util.Properties getResourceProperties(java.lang.String resourceName) throws ConfigurationException
ComponentType
.
For other types, they will generally have a predefined static variable
called RESOURCE_NAME that will be used to ask for its properties.
resourceName
- is the name of the resource to obtain properties for.
ConfigurationException
- if the current configuration and/or
bootstrap properties could not be obtainedpublic Configuration getConfiguration() throws ConfigurationException
ConfigurationException
- if the current configuration could not be obtainedpublic ConfigurationModelContainer getConfigurationModel() throws ConfigurationException
ConfigurationException
- if the current configuration could not be obtainedpublic java.util.Collection<ComponentType> getComponentTypes(boolean includeDeprecated) throws ConfigurationException
Collection
of type ComponentType
that represent
all the ComponentTypes defined.
includeDeprecated
- true if class names that have been deprecated should be
included in the returned list, or false if only non-deprecated constants should be returned.
ComponentType
ConfigurationException
- if an error occurred within or during communication with the Configuration Service.com.metamatrix.common.api.ComponentType
public Host getDefaultHost()
ConfigurationException
- if an error occurred within or during
communication with the Configuration Service, or if there is no object
for the given ID.public static void reset()
public java.util.Properties getBootStrapProperties()
public final java.util.Properties getSystemBootStrapProperties()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |