fr.dyade.aaa.agent.conf
Class A3CMLSaxWrapper

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by fr.dyade.aaa.agent.conf.A3CMLSaxWrapper
All Implemented Interfaces:
A3CMLWrapper, org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class A3CMLSaxWrapper
extends org.xml.sax.helpers.DefaultHandler
implements A3CMLWrapper

XML SAX Wrapper for A3 configuration file.


Field Summary
protected  A3CMLConfig a3cmlConfig
           
(package private)  A3CMLCluster cluster
          Working attribute used during cluster' definition between start and end element.
(package private)  java.lang.String conf
          Working attribute used during configuration's
(package private)  java.lang.String configName
          Name of configuration to get from the file.
(package private)  A3CMLDomain domain
          Working attribute used during domain's definition between start and end element.
(package private)  java.lang.String jvmArgs
          Working attribute used during jvmArgs' definition between start and end element.
(package private)  A3CMLNat nat
          Working attribute used during nat' definition between start and end element.
(package private)  A3CMLNetwork network
          Working attribute used during network's definition between start and end element.
(package private)  A3CMLProperty property
          Working attribute used during service's definition between start and end element.
(package private)  A3CMLServer server
          Working attribute used during server's definition between start and end element.
(package private)  A3CMLService service
          Working attribute used during service's definition between start and end element.
 
Constructor Summary
A3CMLSaxWrapper()
           
 
Method Summary
 void endDocument()
          Finalizes parsing of a document.
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String rawName)
          Receive notification of the end of an element.
 void error(org.xml.sax.SAXParseException e)
          Handles notification of a recoverable parser error.
 void fatalError(org.xml.sax.SAXParseException e)
          Handles notification of a non-recoverable parser error.
 A3CMLConfig parse(java.io.Reader cfgReader, java.lang.String cfgName)
          Parses the xml file named cfgFileName and calls handler methods.
 void startDocument()
          Initializes parsing of a document.
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String rawName, org.xml.sax.Attributes atts)
          Receive notification of the start of an element.
 void warning(org.xml.sax.SAXParseException e)
          Handles notification of a parser warning.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

a3cmlConfig

protected A3CMLConfig a3cmlConfig

configName

java.lang.String configName
Name of configuration to get from the file.


conf

java.lang.String conf
Working attribute used during configuration's


domain

A3CMLDomain domain
Working attribute used during domain's definition between start and end element.


server

A3CMLServer server
Working attribute used during server's definition between start and end element.


network

A3CMLNetwork network
Working attribute used during network's definition between start and end element.


service

A3CMLService service
Working attribute used during service's definition between start and end element.


property

A3CMLProperty property
Working attribute used during service's definition between start and end element.


jvmArgs

java.lang.String jvmArgs
Working attribute used during jvmArgs' definition between start and end element.


nat

A3CMLNat nat
Working attribute used during nat' definition between start and end element.


cluster

A3CMLCluster cluster
Working attribute used during cluster' definition between start and end element.

Constructor Detail

A3CMLSaxWrapper

public A3CMLSaxWrapper()
Method Detail

parse

public A3CMLConfig parse(java.io.Reader cfgReader,
                         java.lang.String cfgName)
                  throws java.lang.Exception
Parses the xml file named cfgFileName and calls handler methods. Calls only methode startDocument(), startElement, endElement and endDocument.

Specified by:
parse in interface A3CMLWrapper
Parameters:
cfgFileName - the name of the xml file
configName - the name of the configuration
serverId - the id of the local server
Throws:
java.lang.Exception - unspecialized error

fatalError

public void fatalError(org.xml.sax.SAXParseException e)
                throws org.xml.sax.SAXException
Handles notification of a non-recoverable parser error.

Specified by:
fatalError in interface org.xml.sax.ErrorHandler
Overrides:
fatalError in class org.xml.sax.helpers.DefaultHandler
Parameters:
e - The warning information encoded as an exception.
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

error

public void error(org.xml.sax.SAXParseException e)
           throws org.xml.sax.SAXException
Handles notification of a recoverable parser error.

Specified by:
error in interface org.xml.sax.ErrorHandler
Overrides:
error in class org.xml.sax.helpers.DefaultHandler
Parameters:
e - The warning information encoded as an exception.
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

warning

public void warning(org.xml.sax.SAXParseException e)
             throws org.xml.sax.SAXException
Handles notification of a parser warning.

Specified by:
warning in interface org.xml.sax.ErrorHandler
Overrides:
warning in class org.xml.sax.helpers.DefaultHandler
Parameters:
e - The warning information encoded as an exception.
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
Initializes parsing of a document.

Specified by:
startDocument in interface org.xml.sax.ContentHandler
Overrides:
startDocument in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException - unspecialized error

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String rawName,
                         org.xml.sax.Attributes atts)
                  throws org.xml.sax.SAXException
Receive notification of the start of an element.

Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
Parameters:
uri - The Namespace URI
localName - The local name
rawName - The qualified name
atts - The attributes attached to the element.
Throws:
org.xml.sax.SAXException - unspecialized error

endElement

public void endElement(java.lang.String uri,
                       java.lang.String localName,
                       java.lang.String rawName)
                throws org.xml.sax.SAXException
Receive notification of the end of an element.

Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler
Parameters:
uri - The Namespace URI
localName - The local name
rawName - The qualified name
atts - The attributes attached to the element.
Throws:
org.xml.sax.SAXException - unspecialized error

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
Finalizes parsing of a document.

Specified by:
endDocument in interface org.xml.sax.ContentHandler
Overrides:
endDocument in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException - unspecialized error


Copyright © 2010 ScalAgent D.T.. All Rights Reserved.