xmlBlaster 2.1.0 API

org.xmlBlaster.engine.runlevel
Class PluginHolderSaxFactory

java.lang.Object
  extended by org.xmlBlaster.util.SaxHandlerBase
      extended by org.xmlBlaster.engine.runlevel.PluginHolderSaxFactory
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.ErrorHandler, org.xml.sax.ext.LexicalHandler

public class PluginHolderSaxFactory
extends SaxHandlerBase

This class parses an xml string to generate a PluginHolder object.

Author:
Michele Laghi, Marcel Ruff
See Also:
engine.runlevel requirement
  <action do='LOAD'
             onStartupRunlevel='3'
             sequence='5'
             onFail='RESOURCE_CONFIGURATION_PLUGINFAILED'/>
 

Field Summary
private  java.lang.String currentNode
           
private  XmlBlasterException ex
           
private  Global glob
           
private  boolean inPlugin
           
private  boolean isXmlBlaster
           
private static java.util.logging.Logger log
           
private  java.lang.String ME
           
private  PluginConfigSaxFactory pluginFactory
           
private  PluginHolder pluginHolder
           
 
Fields inherited from class org.xmlBlaster.util.SaxHandlerBase
character, locator, xmlLiteral, xmlSource
 
Constructor Summary
PluginHolderSaxFactory(Global glob)
          Can be used as singleton.
 
Method Summary
 void characters(char[] ch, int start, int length)
          The characters to be filled
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String name)
          End element, event from SAX parser.
 java.lang.String getName()
          A human readable name of this factory
 PluginHolder getObject()
          returns the parsed object
static void main(java.lang.String[] args)
           
 PluginHolder readConfigFile()
          Reads the configuration file xmlBlasterPlugins.xml.
 PluginHolder readObject(java.lang.String xmlTxt)
          Parses the given xmlBlasterPlugins.xml returns a PluginHolderData holding the data.
 void reset()
          resets the factory (to be invoked before parsing)
 void startCDATA()
          Report the start of a CDATA section.
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String name, org.xml.sax.Attributes attrs)
          Start element, event from SAX parser.
 java.lang.String writeObject(PluginHolder pluginConfig, java.lang.String extraOffset)
          Dump state of this object into a XML ASCII string.
 
Methods inherited from class org.xmlBlaster.util.SaxHandlerBase
comment, endCDATA, endDocument, endDTD, endEntity, endPrefixMapping, error, fatalError, getUseLexicalHandler, ignorableWhitespace, init, init, init, notationDecl, processingInstruction, setDocumentLocator, setUseLexicalHandler, skippedEntity, startDocument, startDTD, startEntity, startPrefixMapping, toString, toXml, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ME

private java.lang.String ME

glob

private final Global glob

log

private static java.util.logging.Logger log

pluginHolder

private PluginHolder pluginHolder

ex

private XmlBlasterException ex

pluginFactory

private PluginConfigSaxFactory pluginFactory

inPlugin

private boolean inPlugin

isXmlBlaster

private boolean isXmlBlaster

currentNode

private java.lang.String currentNode
Constructor Detail

PluginHolderSaxFactory

public PluginHolderSaxFactory(Global glob)
Can be used as singleton.

Method Detail

reset

public void reset()
resets the factory (to be invoked before parsing)


getObject

public PluginHolder getObject()
returns the parsed object


readObject

public PluginHolder readObject(java.lang.String xmlTxt)
                        throws XmlBlasterException
Parses the given xmlBlasterPlugins.xml returns a PluginHolderData holding the data.

Parameters:
the - XML based ASCII string
Throws:
XmlBlasterException

startElement

public final void startElement(java.lang.String uri,
                               java.lang.String localName,
                               java.lang.String name,
                               org.xml.sax.Attributes attrs)
Start element, event from SAX parser.

Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class SaxHandlerBase
Parameters:
name - Tag name
attrs - the attributes of the tag

characters

public void characters(char[] ch,
                       int start,
                       int length)
The characters to be filled

Specified by:
characters in interface org.xml.sax.ContentHandler
Overrides:
characters in class SaxHandlerBase

startCDATA

public void startCDATA()
Description copied from class: SaxHandlerBase
Report the start of a CDATA section. (interface LexicalHandler)

Specified by:
startCDATA in interface org.xml.sax.ext.LexicalHandler
Overrides:
startCDATA in class SaxHandlerBase

endElement

public void endElement(java.lang.String uri,
                       java.lang.String localName,
                       java.lang.String name)
End element, event from SAX parser.

Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class SaxHandlerBase
Parameters:
name - Tag name

writeObject

public final java.lang.String writeObject(PluginHolder pluginConfig,
                                          java.lang.String extraOffset)
Dump state of this object into a XML ASCII string.

Parameters:
extraOffset - indenting of tags for nice output
Returns:
internal state of the RequestBroker as a XML ASCII string

getName

public java.lang.String getName()
A human readable name of this factory

Returns:
"PluginHolderSaxFactory"

readConfigFile

public PluginHolder readConfigFile()
                            throws XmlBlasterException
Reads the configuration file xmlBlasterPlugins.xml. It first searches the file according to the xmlBlaster search strategy specified in the engine.runlevel requirement.

Throws:
XmlBlasterException
See Also:
engine.runlevel requirement

main

public static void main(java.lang.String[] args)

xmlBlaster 2.1.0 API

Copyright © 1999-2011 The xmlBlaster.org contributers.