org.apache.myfaces.extensions.validator.core.startup
Class AbstractStartupListener

java.lang.Object
  extended by org.apache.myfaces.extensions.validator.core.startup.AbstractStartupListener
All Implemented Interfaces:
Serializable, EventListener, javax.faces.event.PhaseListener
Direct Known Subclasses:
BeanValidationStartupListener, ExtValStartupListener, GenericModuleStartupListener, PropertyValidationModuleStartupListener, TrinidadModuleStartupListener

public abstract class AbstractStartupListener
extends Object
implements javax.faces.event.PhaseListener

Startup listeners can be used to execute e.g. setup-logic just once before the first request gets processed. After a listener was executed it gets deactivated.

Since:
1.x.1
Author:
Gerhard Petracek
See Also:
Serialized Form

Field Summary
protected  Logger logger
           
 
Constructor Summary
protected AbstractStartupListener()
           
 
Method Summary
 void afterPhase(javax.faces.event.PhaseEvent event)
           
 void beforePhase(javax.faces.event.PhaseEvent event)
           Is responsible for executing init().
 javax.faces.event.PhaseId getPhaseId()
          
protected  ProjectStageResolver getProjectStageResolver()
           
protected abstract  void init()
          Contains logic which should get executed before the application gets invoked (e.g. initialization code of a module or add-on).
protected  void initModuleConfig()
          Allows subclasses to put some configuration in place, before the actual initialization code is performed.
protected  void initProjectStageResolver()
           
protected  boolean isStartupListenerDeactivated()
          Startup listeners can be deactivated via context-params in the web.xml.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final Logger logger
Constructor Detail

AbstractStartupListener

protected AbstractStartupListener()
Method Detail

afterPhase

public void afterPhase(javax.faces.event.PhaseEvent event)
Specified by:
afterPhase in interface javax.faces.event.PhaseListener

beforePhase

public void beforePhase(javax.faces.event.PhaseEvent event)
Is responsible for executing init(). Before the method is executed, the start-up listener has the chance of putting a configuration object in place (@see #initModuleConfig). Startup listeners can be deactivated via a web.xml context-param.

Specified by:
beforePhase in interface javax.faces.event.PhaseListener

initModuleConfig

protected void initModuleConfig()
Allows subclasses to put some configuration in place, before the actual initialization code is performed.

See Also:
ExtValCoreConfiguration.use(org.apache.myfaces.extensions.validator.core.ExtValCoreConfiguration, boolean)

getPhaseId

public javax.faces.event.PhaseId getPhaseId()

Specified by:
getPhaseId in interface javax.faces.event.PhaseListener

isStartupListenerDeactivated

protected boolean isStartupListenerDeactivated()
Startup listeners can be deactivated via context-params in the web.xml.
Example: fully.qualified.StartupListener:DEACTIVATED true

Returns:
true if the current instance is deactivated - false otherwise

initProjectStageResolver

protected void initProjectStageResolver()

getProjectStageResolver

protected ProjectStageResolver getProjectStageResolver()

init

protected abstract void init()
Contains logic which should get executed before the application gets invoked (e.g. initialization code of a module or add-on).



Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.