| java.lang.Object com.jcorporate.expresso.kernel.ComponentBase com.jcorporate.expresso.kernel.management.DefaultServiceWriter
DefaultServiceWriter | public class DefaultServiceWriter extends ComponentBase implements ServiceWriter,ComponentLifecycle(Code) | | Default Implementation of the class used to write the ExpressoServices
configuration file to a file or stream. This class is an ExpressoComponent
that receives various configuration items from the system.
This class also keeps keeps intact an instance of a DOM Writer. The particular
implementation class for the DOMWriter depends on the contents
of the Expresso Configuration file.
author: Michael Rimov version: $Revision: 1.5 $ on $Date: 2004/11/17 20:48:17 $ |
DefaultServiceWriter | public DefaultServiceWriter()(Code) | | Default Constructor
|
buildDOMTree | protected Document buildDOMTree(ExpressoServicesConfig configRoot) throws ExpressoRuntimeException(Code) | | Convert the ExpressoServicesConfig bean to a DOM document that's compatible
with what is expected in the expresso-services.xml file.
Parameters: configRoot - the root of the configuration tree. a DOM document representing the entire tree. throws: ExpressoRuntimeException - if there is an error building the DOM tree |
configure | public void configure(Configuration newConfig) throws ConfigurationException(Code) | | Configure the DefaultServiceWriter. The chief configuration value is
the domWriter class, which describes which implementation to use for
writing out DOM documents.
Parameters: newConfig - the Configuration object to load items from. throws: ConfigurationException - if the domWriterClass cannot be instantiated |
destroy | public void destroy()(Code) | | Implementation of the Destroy() lifecycle event. nulls out all member
properties.
|
getDOMWriter | public DOMWriter getDOMWriter()(Code) | | Retrieves the DOMWriter isntantiated class. May be null if the component
was unable to load the specified system.
an instantiated DOMWRiter for file writing. |
getDomWriterClass | public String getDomWriterClass()(Code) | | Retrieves the previously set classname of the Dom Writer
java.lang.String |
initialize | public void initialize()(Code) | | |
processComponent | protected void processComponent(ComponentConfig config, Element parent, Document dom)(Code) | | Recursively go through the Expresso-services.config and convert all the various
components into the DOM tree.
Parameters: config - the current config bean in the tree Parameters: parent - the Parent DOM Element to append items to Parameters: dom - the DOM tree, used for building the various elements in the DOM tree. |
processComponentProperties | protected void processComponentProperties(ComponentConfig config, Element parent, Document dom)(Code) | | Write the current component's configuration to the current DOM element.
Parameters: config - the current config to glean the properties from Parameters: parent - the parent element to append properties to as children. Parameters: dom - the DOM tree to use for Element factores |
reconfigure | public void reconfigure(Configuration newConfig) throws ConfigurationException(Code) | | Reconfigure lifecycle event for this component. It attempts to load a new
DOMWriter class, however, if unable to do so, it will rollback the configuration
internally and throw a ConfigurationException.
Parameters: newConfig - the Configuration object to load items from. throws: ConfigurationException - if the system is unable to load the new DOMWriterclass specified. |
setDomWriterClass | public void setDomWriterClass(String domWriterClass) throws ExpressoRuntimeException(Code) | | Sets and loads the specified domWriter class.
Parameters: domWriterClass - The classname of the DOMWriter to load |
writeServicesFile | public void writeServicesFile(RootContainerInterface rootContainer, String location) throws ExpressoRuntimeException(Code) | | Write the services file to a particular file location.
Parameters: rootContainer - The RootContainer interface that will contain baseinformation about the system state we are about to save. Parameters: location - The location to save the services file. (File name should be includedin this parameter). throws: ExpressoRuntimeException - upon error. |
|
|