|
||||||||||
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 |
CLUSTER_NAME
|
static java.lang.String |
CONFIGURATION_NAME
|
static java.lang.String |
CONFIGURATION_READER_CLASS_PROPERTY_NAME
|
Method Summary | |
---|---|
java.util.Properties |
getBootStrapProperties()
|
java.lang.String |
getClusterName()
|
java.util.Collection |
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. |
Host |
getDefaultHost()
Returns the Host based on the current running machine. |
static CurrentConfiguration |
getInstance()
|
java.util.Collection |
getProductTypes()
Returns a Collection of type ProductType that represents
all the ComponentTypes defined. |
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()
|
void |
indicateSystemShutdown()
This will put the system into a state of #STATE_STOPPED . |
void |
performSystemInitialization(boolean forceInitialization)
This method should be called only by StartupStateController , which is used by
MetaMatrixController to initialize the system configurations during bootstrapping. |
void |
reset()
Reset causes not just a refresh, but the bootstrapping process to occur again. |
void |
verifyBootstrapProperties()
Returns the instance of CofigurationBootMgr to use to
get configuration information. |
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_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
Method Detail |
---|
public static CurrentConfiguration getInstance()
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 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 java.util.Collection getProductTypes() throws ConfigurationException
Collection
of type ProductType
that represents
all the ComponentTypes defined.
ProductType
ConfigurationException
- if an error occurred within or during communication with the Configuration Service.#ProductType
public Host getDefaultHost() throws ConfigurationException
ConfigurationException
- if an error occurred within or during
communication with the Configuration Service, or if there is no object
for the given ID.public final void reset() throws ConfigurationException
ConfigurationException
public final void performSystemInitialization(boolean forceInitialization) throws StartupStateException, ConfigurationException
StartupStateController
, which is used by
MetaMatrixController to initialize the system configurations during bootstrapping.
Once bootstrap properties are verified, this method will use
the reader
to attempt to put the system state into
StartupStateController.STATE_STARTING
, and then
commence with initialization. If the state is already
StartupStateController.STATE_STARTING
, then another
MetaMatrixController is already currently in the process of
starting the system, and a StartupStateException
will be thrown. If this method returns without an
exception, then the system state will be in state
StartupStateController.STATE_STARTING
, and the calling
code should proceed with startup.
forceInitialization
- if the system is in a state other than
StartupStateController.STATE_STOPPED
, and the
administrator thinks the system actually crashed and is
not really running, he can choose to force the
initialization. Otherwise, if the system is in one of these states,
an exception will be thrown. This method is package-level so
that only StartupStateController can access it.
StartupStateException
- if the system is
not in a state in which initialization can proceed. This
exception will indicate the current system state.
ConfigurationException
- if the current configuration and/or
bootstrap properties could not be obtainedpublic final void indicateSystemShutdown() throws ConfigurationException
#STATE_STOPPED
.
ConfigurationException
- if the current configuration and/or
bootstrap properties could not be obtainedpublic java.util.Properties getBootStrapProperties() throws ConfigurationException
ConfigurationException
public final java.util.Properties getSystemBootStrapProperties()
public final void verifyBootstrapProperties() throws ConfigurationException
CofigurationBootMgr
to use to
get configuration information.
ConfigurationException
- if the current configuration and/or
bootstrap properties could not be obtained
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |