net.sf.jguard.jee.listeners
Class ContextListener

java.lang.Object
  extended by com.google.inject.servlet.GuiceServletContextListener
      extended by net.sf.jguard.jee.listeners.ContextListener
All Implemented Interfaces:
EventListener, javax.servlet.ServletContextListener

public abstract class ContextListener
extends com.google.inject.servlet.GuiceServletContextListener

initialize authentication and authorization engines in jGuard. it needs to be be declared in the web.xml file, to be called by the servlet engine lifecycle BEFORE servlet filters and servlets. it permits to initialize Authentication and Authorization only once, for potentially multiple server side technologies used in cunjunction.

Author:
Charles Gay, Vincent Beretti

Field Summary
static String FILTER_LOCATION
           
protected  com.google.inject.Injector injector
           
 
Constructor Summary
ContextListener()
           
 
Method Summary
 void contextDestroyed(javax.servlet.ServletContextEvent servletContextEvent)
          method called when the webapp shutdown: this method unregister the webapp in the JGuardPolicy repository.
 void contextInitialized(javax.servlet.ServletContextEvent contextEvent)
          method called when the webapp start.
protected  com.google.inject.Injector getInjector()
           
abstract  com.google.inject.servlet.ServletModule getServletModule()
           
abstract  com.google.inject.Module getTechnologySpecificModule()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

injector

protected com.google.inject.Injector injector

FILTER_LOCATION

public static final String FILTER_LOCATION
See Also:
Constant Field Values
Constructor Detail

ContextListener

public ContextListener()
Method Detail

contextInitialized

public void contextInitialized(javax.servlet.ServletContextEvent contextEvent)
method called when the webapp start. install jGuard overall Configuration and Policy. put Guice injector in the servlet context.

Specified by:
contextInitialized in interface javax.servlet.ServletContextListener
Overrides:
contextInitialized in class com.google.inject.servlet.GuiceServletContextListener
See Also:
ServletContextListener.contextInitialized(javax.servlet.ServletContextEvent)

contextDestroyed

public void contextDestroyed(javax.servlet.ServletContextEvent servletContextEvent)
method called when the webapp shutdown: this method unregister the webapp in the JGuardPolicy repository.

Specified by:
contextDestroyed in interface javax.servlet.ServletContextListener
Overrides:
contextDestroyed in class com.google.inject.servlet.GuiceServletContextListener
See Also:
ServletContextListener.contextDestroyed(javax.servlet.ServletContextEvent)

getInjector

protected com.google.inject.Injector getInjector()
Specified by:
getInjector in class com.google.inject.servlet.GuiceServletContextListener

getServletModule

public abstract com.google.inject.servlet.ServletModule getServletModule()

getTechnologySpecificModule

public abstract com.google.inject.Module getTechnologySpecificModule()


Copyright © 2004-2011. All Rights Reserved.