net.contextfw.web.application
Class DefaultLifecycleListener

java.lang.Object
  extended by net.contextfw.web.application.DefaultLifecycleListener
All Implemented Interfaces:
LifecycleListener

public class DefaultLifecycleListener
extends Object
implements LifecycleListener


Constructor Summary
DefaultLifecycleListener()
           
 
Method Summary
 void afterInitialize()
           
 void afterRender()
           
 void afterUpdate()
           
 void beforeInitialize()
           
 void beforeRender()
           
 boolean beforeUpdate()
           This method is useful in two ways.
 void onException(Exception e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultLifecycleListener

public DefaultLifecycleListener()
Method Detail

beforeInitialize

public void beforeInitialize()
Specified by:
beforeInitialize in interface LifecycleListener

afterInitialize

public void afterInitialize()
Specified by:
afterInitialize in interface LifecycleListener

beforeUpdate

public boolean beforeUpdate()
Description copied from interface: LifecycleListener

This method is useful in two ways. First it can be used to initialize possible database connections etc.

By default this method should return true, but it can be used to cancel the client update request by returning false. This can be used for instance to restrict client from making requests after credentials have been expired.

In case of false (and also when true) this method can be used to call methods on components and create updates.

Note that even if false is returned the flow will continue. Only the client update request is bypassed.

Specified by:
beforeUpdate in interface LifecycleListener
Returns:
true if client update can continue, false otherwise

afterUpdate

public void afterUpdate()
Specified by:
afterUpdate in interface LifecycleListener

onException

public void onException(Exception e)
Specified by:
onException in interface LifecycleListener

beforeRender

public void beforeRender()
Specified by:
beforeRender in interface LifecycleListener

afterRender

public void afterRender()
Specified by:
afterRender in interface LifecycleListener


Copyright © 2011. All Rights Reserved.