com.metamatrix.common.config.reader
Interface CurrentConfigurationReader

All Known Implementing Classes:
PropertiesConfigurationReader, XMLCurrentConfigurationReader

public interface CurrentConfigurationReader

This interface defines a self-contained reader for the current configuration, and should be used only by the CurrentConfiguration framework. As such, this is an extremely low-level implementation that may not use anything but com.metamatrix.common.util components and only components that do not use LogManager.

Each class that implements this interface must supply a no-arg constructor.


Method Summary
 void close()
          This method should close the connection to the repository that holds the current configuration.
 void connect(java.util.Properties env)
          This method should connect to the repository that holds the current configuration, using the specified properties.
 ConfigurationModelContainer getConfigurationModel()
          Obtain the next startup configuration model.
 void indicateSystemShutdown()
          This will put the system into a state of StartupStateController.STATE_STOPPED.
 void performSystemInitialization(boolean forceInitialization)
          This method should be called only by com.metamatrix.platform.util.MetaMatrixController to initialize the system configurations during bootstrapping.
 

Method Detail

connect

void connect(java.util.Properties env)
             throws ConfigurationConnectionException
This method should connect to the repository that holds the current configuration, using the specified properties. The implementation may not use logging but instead should rely upon returning an exception in the case of any errors.

Parameters:
env - the environment properties that define the information
Throws:
ConfigurationConnectionException - if there is an error establishing the connection.

close

void close()
           throws java.lang.Exception
This method should close the connection to the repository that holds the current configuration. The implementation may not use logging but instead should rely upon returning an exception in the case of any errors.

Throws:
java.lang.Exception - if there is an error establishing the connection.

getConfigurationModel

ConfigurationModelContainer getConfigurationModel()
                                                  throws ConfigurationException
Obtain the next startup configuration model. The implementation may not use logging but instead should rely upon returning an exception in the case of any errors.

Returns:
the serializable Configuration instance
Throws:
ConfigurationException - if an error occurred within or during communication with the repository.

performSystemInitialization

void performSystemInitialization(boolean forceInitialization)
                                 throws StartupStateException,
                                        ConfigurationException
This method should be called only by com.metamatrix.platform.util.MetaMatrixController to initialize the system configurations during bootstrapping. This method will 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.

Parameters:
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.
Throws:
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 obtained NOTE: This method replaces the begin... and finish.. SystemInitialization methods for the new configuration implementations.

indicateSystemShutdown

void indicateSystemShutdown()
                            throws ConfigurationException
This will put the system into a state of StartupStateController.STATE_STOPPED.

Throws:
ConfigurationException - if an error occurred in communication with the configuration data source


Copyright © 2009. All Rights Reserved.