Abstract ServletContextListener implementing ApplicationAssembler.
Extends this class to easily bind a Polygene Application activation/passivation to your webapp lifecycle.
is set as a
attribute named using a constant.
In your servlets, filters, whatever has access to the
use the following code to get a
handle on the
application = ( Application ) servletContext.getAttribute( PolygeneServletSupport.APP_IN_CTX );
// Or, shorter:
application = PolygeneServletSupport.application( servletContext );
Rembember that the servlet specification states:
In cases where the container is distributed over many virtual machines, a Web application will have an instance of
the ServletContext for each JVM.
Context attributes are local to the JVM in which they were created. This prevents ServletContext attributes from
being a shared memory store in a distributed container. When information needs to be shared between servlets running
in a distributed environment, the information should be placed into a session, stored in a database, or set in an
Enterprise JavaBeans component.