Jacson

de.spieleck.app.jacson.report
Class Log4jReport

java.lang.Object
  extended byde.spieleck.app.jacson.report.Log4jReport
All Implemented Interfaces:
ConfigVerify.Acceptor, JacsonReport, JacsonStately

public class Log4jReport
extends java.lang.Object
implements JacsonReport, ConfigVerify.Acceptor

Feed the Jacson output events to log4j and whereever log4j puts it. Note this first implementation uses excessive String concatenation and is not fast.

Author:
fsn, Patrick Carl

Field Summary
static java.lang.String LOG4J_CONFIG
          Config: Name of the log4j configuration file.
static java.lang.String LOG4J_REREAD
          Config: Reread log4j configuration file.
 
Constructor Summary
Log4jReport()
           
 
Method Summary
 boolean accept(ConfigNode cn)
           
 void begin(java.lang.String id)
          Begin a subsection within report
 void end()
          Close a subsection within a report
 void finish()
          Finish and close underlying resources
 void finish(boolean close)
          Finish and optionally close the underlying resources
 JacsonState getRegState()
          returns the set JacsonState
 void init(ConfigNode config)
          Initialize the report.
 void registerState(JacsonState state)
          Give the class access to an appropriate state.
 void report(java.lang.String localName, java.lang.String value)
          Report a single name value pair within a report
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG4J_CONFIG

public static final java.lang.String LOG4J_CONFIG
Config: Name of the log4j configuration file.

See Also:
Constant Field Values

LOG4J_REREAD

public static final java.lang.String LOG4J_REREAD
Config: Reread log4j configuration file.

See Also:
Constant Field Values
Constructor Detail

Log4jReport

public Log4jReport()
Method Detail

init

public void init(ConfigNode config)
          throws JacsonConfigException
Description copied from interface: JacsonReport
Initialize the report. The passed ConfigNode can be used to obtain configuration information of the report from the global config xml.

Specified by:
init in interface JacsonReport
Throws:
JacsonConfigException

accept

public boolean accept(ConfigNode cn)
Specified by:
accept in interface ConfigVerify.Acceptor

begin

public void begin(java.lang.String id)
Description copied from interface: JacsonReport
Begin a subsection within report

Specified by:
begin in interface JacsonReport

report

public void report(java.lang.String localName,
                   java.lang.String value)
Description copied from interface: JacsonReport
Report a single name value pair within a report

Specified by:
report in interface JacsonReport

end

public void end()
Description copied from interface: JacsonReport
Close a subsection within a report

Specified by:
end in interface JacsonReport

finish

public void finish()
Description copied from interface: JacsonReport
Finish and close underlying resources

Specified by:
finish in interface JacsonReport

finish

public void finish(boolean close)
Description copied from interface: JacsonReport
Finish and optionally close the underlying resources

Specified by:
finish in interface JacsonReport
Parameters:
close - flag whether to close resources or not.

registerState

public void registerState(JacsonState state)
Description copied from interface: JacsonStately
Give the class access to an appropriate state.

Specified by:
registerState in interface JacsonStately

getRegState

public JacsonState getRegState()
Description copied from interface: JacsonReport
returns the set JacsonState

Specified by:
getRegState in interface JacsonReport

Spieleck

Copyleft 2002 spieleck.de.