1 package net.trajano.twiff.adapter;
2
3 import net.trajano.twiff.container.ContainerBuilder;
4 import org.hibernate.SessionFactory;
5 import org.picocontainer.MutablePicoContainer;
6
7 /***
8 * This provides access to the servlet context data. Adapters like this are
9 * meant to remove the implicit casting performed by those that use it. This is
10 * made into an interface to provide test objects more easily.
11 *
12 * @author Archimedes Trajano
13 */
14 public interface ServletContextAdapter {
15 /***
16 * Returns the {@link org.picocontainer.PicoContainer} stored in the servlet
17 * context.
18 *
19 * @return the application level container.
20 */
21 MutablePicoContainer getContainer();
22
23 /***
24 * Returns the {@link ContainerBuilder} stored in the servlet context.
25 *
26 * @return the container builder.
27 */
28 ContainerBuilder getContainerBuilder();
29
30 /***
31 * This returns the Hibernate session factory used in the framework. This
32 * session factory should not be used by applications directly.
33 *
34 * @return the session factory.
35 */
36 SessionFactory getSessionFactory();
37 }