org.webmacro.util
Class LogTargetFactory

java.lang.Object
  extended byorg.webmacro.util.LogTargetFactory

public class LogTargetFactory
extends java.lang.Object

The LogTargetFactory assists the Broker (and you, if you want) in creating new LogTarget instances.

If your LogTarget needs configuration settings from WebMacro, create a constructor with this signature:


     public MyLogTarget (org.webmacro.util.Settings settings);

 
If you don't need to configuration options, you should have a null constructor.

Since:
0.99
Author:
e_ridge

Nested Class Summary
static class LogTargetFactory.LogCreationException
           
 
Method Summary
 LogTarget createLogTarget(Broker broker, java.lang.String classname, Settings settings)
          Creates a new org.webmacro.util.LogTarget
static LogTargetFactory getInstance()
          return the only instance of this LogTargetFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static final LogTargetFactory getInstance()
return the only instance of this LogTargetFactory


createLogTarget

public final LogTarget createLogTarget(Broker broker,
                                       java.lang.String classname,
                                       Settings settings)
                                throws LogTargetFactory.LogCreationException
Creates a new org.webmacro.util.LogTarget

Parameters:
broker - the Broker that is requesting to create the log. The Broker is used to find the LogTarget class via the Broker's .classForName() method.
classname - the fully-qualified classname of the LogTarget to create
settings - WebMacro settings that will be passed off to the new LogTarget during its construction
Throws:
LogTargetFactory.LogCreationException