net.trajano.twiff.internal
Class ServletContextAdapterImpl

java.lang.Object
  extended by net.trajano.twiff.internal.ServletContextAdapterImpl
All Implemented Interfaces:
ServletContextAdapter

public class ServletContextAdapterImpl
extends Object
implements ServletContextAdapter

This provides access to the servlet context data. Adapters like this are meant to remove the implicit casting performed by those that use it.

Author:
Archimedes Trajano

Constructor Summary
ServletContextAdapterImpl(ServletContext servletContext)
          Creates the adapter.
 
Method Summary
 MutablePicoContainer getContainer()
          Returns the PicoContainer stored in the servlet context.
 ContainerBuilder getContainerBuilder()
          Returns the ContainerBuilder stored in the servlet context.
 org.hibernate.SessionFactory getSessionFactory()
          This returns the Hibernate session factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServletContextAdapterImpl

public ServletContextAdapterImpl(ServletContext servletContext)
Creates the adapter.

Parameters:
servletContext - the context to adapt
Method Detail

getContainer

public final MutablePicoContainer getContainer()
Returns the PicoContainer stored in the servlet context. The container is stored in the attribute TwiffInternal.APP_CONTAINER_KEY.

Specified by:
getContainer in interface ServletContextAdapter
Returns:
the application level container.

getContainerBuilder

public final ContainerBuilder getContainerBuilder()
Returns the ContainerBuilder stored in the servlet context. The builder is stored in the attribute Twiff.CONTAINER_BUILDER_KEY.

Specified by:
getContainerBuilder in interface ServletContextAdapter
Returns:
the container builder.

getSessionFactory

public final org.hibernate.SessionFactory getSessionFactory()
This returns the Hibernate session factory. This is stored in the attribute TwiffInternal.SESSION_FACTORY_KEY.

Specified by:
getSessionFactory in interface ServletContextAdapter
Returns:
the session factory.


Copyright © 2004-2005 trajano.net. All Rights Reserved.