org.ceryle.wiki.plugin.assertion
Class AssertionHandlerFactory

java.lang.Object
  extended by org.ceryle.wiki.plugin.assertion.AssertionHandlerFactory

public class AssertionHandlerFactory
extends Object

AssertionHandlerFactory is a singleton class providing management of the AssertionHandlers on a per-WikiEngine basis. Each AssertionHandler adds a single listener to the WikiEngine upon instantiation. This also provides a few convenience methods that locate the AssertionHandler for the engine based on either the WikiEngine or the WikiContext, rather than you having to do so first.

Since:
2.3.92
Version:
$Id: AssertionHandlerFactory.java,v 1.2 2007-06-15 12:10:13 altheim Exp $
Author:
Murray Altheim

Field Summary
static String IMPLEMENTATION_CLASS
          The class name of the default AssertionHandler implementation.
static String PROPERTY_FACTORY_ENABLED
          The System property name for the property enabling the creation of AssertionHandlers.
 
Method Summary
static AssertionHandler getHandlerForEngine(WikiEngine engine)
          Registers the provided WikiEngine with the AssertionHandlerFactory, returning an AssertionHandler specific to that engine.
static void setHandlerForEngine(WikiEngine engine, AssertionHandler handler)
          Sets the provided AssertionHandler with the WikiEngine engine, substituting for any existing AssertionHandler that may exist.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_FACTORY_ENABLED

public static final String PROPERTY_FACTORY_ENABLED
The System property name for the property enabling the creation of AssertionHandlers. This is only disabled if the property is set, and to a value of "false". The value is "ceryle.assertionhandler.factory.enabled".

See Also:
Constant Field Values

IMPLEMENTATION_CLASS

public static String IMPLEMENTATION_CLASS
The class name of the default AssertionHandler implementation.

Method Detail

getHandlerForEngine

public static AssertionHandler getHandlerForEngine(WikiEngine engine)
Registers the provided WikiEngine with the AssertionHandlerFactory, returning an AssertionHandler specific to that engine. The AssertionHandler implementation adds a WikiEventListener to the WikiEngine to receive notification of significant events.

Parameters:
engine - the WikiEngine backing the event handling.

setHandlerForEngine

public static void setHandlerForEngine(WikiEngine engine,
                                       AssertionHandler handler)
Sets the provided AssertionHandler with the WikiEngine engine, substituting for any existing AssertionHandler that may exist. This is used to substitute an alternative AssertionHandler for the one provided by the factory.

Parameters:
engine - the WikiEngine backing the event handling.
handler - the AssertionHandler to be associated with the WikiEngine.


The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.