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

In order to execute logic just once. e.g. register artifacts via api. It is done before the first Restore view of the application. PhaseListeners are deregistered so that they don't have any additional impact on the application.

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 the one time only logic.
 javax.faces.event.PhaseId getPhaseId()
          Logic should be executed before the RESTORE_VIEW phase.
protected  ProjectStageResolver getProjectStageResolver()
           
protected abstract  void init()
          Subclasses can here put their logic that they want to be executed once, like 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()
          Individual startup listeners can be deactivated by specifying an initialization parameter in the web.xml file with the name of the startup listener followed by ':DEACTIVATED' that have a value of 'true'.
 
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 the one time only logic. Before the logic is performed (init method), the start-up listener has the chance of putting a configuration object in place in the initModuleConfig method. Startup listeners can be deactivated by an initialization parameter in the web.xml file and are deregistered from the JSF system. If this fails, a fallback system is in place so that the logic can't be executed more then once.

Specified by:
beforePhase in interface javax.faces.event.PhaseListener
Parameters:
event - Jsf Phase Event info.

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()
Logic should be executed before the RESTORE_VIEW phase.

Specified by:
getPhaseId in interface javax.faces.event.PhaseListener
Returns:
Restore View JSF Phase.

isStartupListenerDeactivated

protected boolean isStartupListenerDeactivated()
Individual startup listeners can be deactivated by specifying an initialization parameter in the web.xml file with the name of the startup listener followed by ':DEACTIVATED' that have a value of 'true'.

Returns:
Is this startup listener deactivated.

initProjectStageResolver

protected void initProjectStageResolver()

getProjectStageResolver

protected ProjectStageResolver getProjectStageResolver()

init

protected abstract void init()
Subclasses can here put their logic that they want to be executed once, like initialization code of a module or add-on.



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