com.xenonsoft.bridgetown.resources
Class LegacyXMLConfigLoader

java.lang.Object
  extended bycom.xenonsoft.bridgetown.resources.AbstractConfigLoader
      extended bycom.xenonsoft.bridgetown.resources.LegacyXMLConfigLoader
All Implemented Interfaces:
IConfigLoader, java.io.Serializable

public class LegacyXMLConfigLoader
extends AbstractConfigLoader

This is legacy sample XML configuration loader that uses the Commons Digester to parse an XML file.

This class is useful to study the original implementation and offer a full rule of how the various RuleSet fit together to parse the schema.

Version:
$Id: LegacyXMLConfigLoader.java,v 1.2 2005/02/23 01:31:14 peter_pilgrim Exp $
Author:
Peter Pilgrim, 04-Aug-2004
See Also:
Serialized Form

Field Summary
protected  boolean debug
          boolean flag if the XML parser should be produce debuggable output
protected static java.lang.String[] registrations
          The set of public identifiers, and corresponding resource names, for the versions of the configuration file DTDs that we know about.
protected  boolean validating
          boolean flag if the XML parser should be validating
 
Fields inherited from class com.xenonsoft.bridgetown.resources.AbstractConfigLoader
file, inputStream, uri
 
Method Summary
protected  org.apache.commons.digester.Digester createParser()
          Creates the digester parse with the rules all set up.
 boolean isDebug()
          Gets the debug output flag for the Commons Digester parser
 boolean isValidating()
          Gets the XML validating flag for the Commons Digester parser
 AssemblyConfig load()
          Loads the service assembly configuration from the supplied resource.
 void setDebug(boolean debug)
          Sets the debug output flag for the Commons Digester parser
 void setValidating(boolean validating)
          Sets the XML validating flag for the Commons Digester parser
 
Methods inherited from class com.xenonsoft.bridgetown.resources.AbstractConfigLoader
load, load, load, setFile, setInputStream, setUri, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

registrations

protected static final java.lang.String[] registrations

The set of public identifiers, and corresponding resource names, for the versions of the configuration file DTDs that we know about. There MUST be an even number of Strings in this list!


validating

protected boolean validating
boolean flag if the XML parser should be validating


debug

protected boolean debug
boolean flag if the XML parser should be produce debuggable output

Method Detail

isDebug

public boolean isDebug()
Gets the debug output flag for the Commons Digester parser

Returns:
Returns the debug.

setDebug

public void setDebug(boolean debug)
Sets the debug output flag for the Commons Digester parser

Parameters:
debug - the new value for debug

isValidating

public boolean isValidating()
Gets the XML validating flag for the Commons Digester parser

Returns:
Returns the validating.

setValidating

public void setValidating(boolean validating)
Sets the XML validating flag for the Commons Digester parser

Parameters:
validating - the new value for validating

load

public AssemblyConfig load()
Loads the service assembly configuration from the supplied resource.
  1. The implementation checks for existance of an InputStream, if it is found, and the stream is opened and available, then method uses the stream.
  2. If the File exists, then the method loads the configuration from the system file.
  3. Finally the implementation tries to load the configuration URI path. It constructs an URL and attempts to retrieve stream from the resource.

CAUTION: THIS CLASS MIGHT BE REFACTORED or REDESIGNED along with the superclasses.

Returns:
Assembly configuration root
Throws:
AssemblyConfigException - if the configuration fails to load
See Also:
IConfigLoader.load()

createParser

protected org.apache.commons.digester.Digester createParser()
Creates the digester parse with the rules all set up.

Returns:
the Common Digester parser ready to parse and load a configuration


Copyright © 2005 XeNoNSoFT.com. All Rights Reserved.