Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

alma::acs::logging::engine::parser::ACSLogParserFactory Class Reference

Collaboration diagram for alma::acs::logging::engine::parser::ACSLogParserFactory:

Collaboration graph
[legend]
List of all members.

Public Types

enum  ParserTypes { DOM, VTD }

Static Public Member Functions

ACSLogParser getParser () throws Exception
ACSLogParser getParser (ParserTypes parserType) throws Exception
ParserTypes getParserType (ACSLogParser parserToCheck) throws Exception
ParserTypes getParserType () throws Exception

Package Types


Static Private Attributes

ACSLogParser parser = null
boolean usingVTD = true

Detailed Description

A factory to build parsers.

The purpose of this object is to hide the type of parser really used at run time.

The object could instantiate a new parser or use only one instance, a singleton.

There are 2 parsers available: DOM and VTD. VTD is ACS/LGPL/Tools and installed by ACS. It is licensed under GPL and available at http://vtd-xml.sourceforge.net/ VTD claims to be very fast (and effectively it performs better then DOM) so the factory tries to instantiate a VTD parser if it is present.
Having this factory allows to transparently use a different implementation at run-time depending on the real availability of the parsers.

Author:
acaproni


Member Enumeration Documentation

enum alma::acs::logging::engine::parser::ACSLogParserFactory::ParserTypes
 

The supported parsers.

This has been introduced to allow the usage of a specific parser especially useful for testing where we need to test parsing against each possible parser.

Author:
acaproni
Enumeration values:
DOM 
VTD 


Member Function Documentation

ACSLogParser alma::acs::logging::engine::parser::ACSLogParserFactory::getParser ParserTypes  parserType  )  throws Exception [inline, static]
 

Get a parser of the given type.

This method allows to get a parser of a specific type and is thought for testing purposes.

If the type of the requested parser is not the type of the parser in use then a new parser is instantiated and returned but the parser in use remains untouched.

Parameters:
parserType The type of the parser to instantiate. It can't be null.
Returns:
The parser of the given type
Exceptions:
<{@link Exception} in case of error instantiating the parser.

ACSLogParser alma::acs::logging::engine::parser::ACSLogParserFactory::getParser  )  throws Exception [inline, static]
 

Get a parser.

The ACSLogParser returned by this method can be a new instance or not, depending on the implementation.

Returns:
The parser.
Exceptions:
<code>Exception</code> in case of error building the parser

ParserTypes alma::acs::logging::engine::parser::ACSLogParserFactory::getParserType  )  throws Exception [inline, static]
 

Return the type of the parser in use.

Returns:
The type of the parser in use or null if no parser is still in use i.e. getParser() has not been executed yet.
Exceptions:
<code>Exception</code> if the type of the parser is not recognized/supported.

ParserTypes alma::acs::logging::engine::parser::ACSLogParserFactory::getParserType ACSLogParser  parserToCheck  )  throws Exception [inline, static]
 

Return the type of the passed parser.

Parameters:
parser The parser whose type has to be checked. It can't be null.
Returns:
The type of the parser.
Exceptions:
<code>Exception</code> if the type of the parser is not recognized/supported.


Member Data Documentation

ACSLogParser alma::acs::logging::engine::parser::ACSLogParserFactory::parser = null [static, private]
 

The parser is a singleton built at the first invocation of getParser().

Calls to getParser(ParserType...) do not change the value of this property.

boolean alma::acs::logging::engine::parser::ACSLogParserFactory::usingVTD = true [static, private]
 

This property is used to check if VTD is installed to avoid trying to instantiate if the library is missing

It is initially set to true to try to instantiate VTD the first time getParser() is called


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 02:53:51 2009 for ACS Java API by doxygen 1.3.8