org.mortbay.jetty.plus
Class PlusWebAppContext

java.lang.Object
  extended by org.mortbay.util.Container
      extended by org.mortbay.http.HttpContext
          extended by org.mortbay.jetty.servlet.ServletHttpContext
              extended by org.mortbay.jetty.servlet.WebApplicationContext
                  extended by org.mortbay.jetty.plus.PlusWebAppContext
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, HttpHandler, EventProvider, LifeCycle

public class PlusWebAppContext
extends WebApplicationContext

See Also:
Serialized Form

Nested Class Summary
static class PlusWebAppContext.Configuration
           
 
Field Summary
 
Fields inherited from class org.mortbay.http.HttpContext
__ErrorHandler, __fileClassPathAttr
 
Constructor Summary
PlusWebAppContext()
          Constructor.
PlusWebAppContext(java.lang.String webApp)
          Constructor.
 
Method Summary
 void addEnvEntry(java.lang.String name, java.lang.Object value)
          Add a java:comp/env entry.
 void doStart()
          Start the Web Application.
 void doStop()
          Stop the web application.
 java.util.Map getENC()
          Get a mapping of java:comp/env bindings for this webapp context.
 java.lang.Object getEnvEntry(java.lang.String name)
           
 boolean getWebXmlEnvEntryOverride()
           
 void handle(HttpRequest request, HttpResponse response)
          Handler request.
protected  void initClassLoader(boolean forceContextLoader)
          Initialize the context classloader.
protected  void initialize()
          Initialize is called by the start method after the contexts classloader has been initialied, but before the defaults descriptor has been applied.
 void setWebXmlEnvEntryOverride(boolean value)
           
 
Methods inherited from class org.mortbay.jetty.servlet.WebApplicationContext
addEventListener, configureClassPath, configureDefaults, configureWebApp, destroy, getConfigurationClassNames, getConfigurations, getDefaultsDescriptor, getDisplayName, getErrorPage, getExtractWAR, getResource, getResourceAlias, getResourceAliases, getServletHandler, getUserRealm, getWAR, getWebApplicationHandler, getWebInf, handle, isDistributable, isIgnoreWebJetty, loadConfigurations, readExternal, removeErrorPage, removeEventListener, removeResourceAlias, setConfigurationClassNames, setDefaultsDescriptor, setDisplayName, setDistributable, setErrorPage, setExtractWAR, setIgnoreWebJetty, setPermissions, setResourceAlias, setWAR, toString, writeExternal
 
Methods inherited from class org.mortbay.jetty.servlet.ServletHttpContext
addLocaleEncoding, addServlet, addServlet, checkSecurityConstraints, enterContextScope, getLocaleEncoding, getServletContext, jSecurityCheck, sendError
 
Methods inherited from class org.mortbay.http.HttpContext
addClassPath, addClassPaths, addHandler, addHandler, addPermission, addSecurityConstraint, addVirtualHost, addWelcomeFile, canonicalContextPathSpec, clearSecurityConstraints, flushCache, getAttribute, getAttributeNames, getAttributes, getAuthenticator, getBaseResource, getClassLoader, getClassPath, getContextPath, getEncodingByMimeType, getEncodingMap, getFileClassPath, getHandler, getHandlerIndex, getHandlers, getHosts, getHttpConnection, getHttpContext, getHttpContextName, getHttpServer, getInitParameter, getInitParameterNames, getMaxCachedFileSize, getMaxCacheSize, getMimeByExtension, getMimeMap, getName, getParentClassLoader, getPermissions, getRealm, getRealmName, getRequestLog, getRequests, getRequestsActive, getRequestsActiveMax, getResourceBase, getResourceMetaData, getResponses1xx, getResponses2xx, getResponses3xx, getResponses4xx, getResponses5xx, getServerClasses, getStatsOn, getStatsOnMs, getStopGracefully, getSystemClasses, getTempDirectory, getVirtualHosts, getWelcomeFile, getWelcomeFiles, initialize, isClassLoaderJava2Compliant, isRedirectNullPath, leaveContextScope, loadClass, log, removeAttribute, removeHandler, removeHandler, removeVirtualHost, removeWelcomeFile, sendContextError, setAttribute, setAttributes, setAuthenticator, setBaseResource, setClassLoader, setClassLoaderJava2Compliant, setClassPath, setContextPath, setEncodingMap, setHandlers, setHosts, setHttpContextName, setInitParameter, setMaxCachedFileSize, setMaxCacheSize, setMimeMap, setMimeMapping, setParentClassLoader, setRealm, setRealmName, setRedirectNullPath, setRequestLog, setResourceBase, setServerClasses, setStatsOn, setStopGracefully, setSystemClasses, setTempDirectory, setTypeEncoding, setVirtualHosts, setWelcomeFiles, startHandlers, statsReset, stop, toString
 
Methods inherited from class org.mortbay.util.Container
addComponent, getComponents, isFailed, isStarted, isStarting, isStopping, removeComponent, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PlusWebAppContext

public PlusWebAppContext()
Constructor.

Throws:
java.io.IOException

PlusWebAppContext

public PlusWebAppContext(java.lang.String webApp)
Constructor.

Parameters:
webApp - The Web application directory or WAR file.
Throws:
java.io.IOException
Method Detail

setWebXmlEnvEntryOverride

public void setWebXmlEnvEntryOverride(boolean value)

getWebXmlEnvEntryOverride

public boolean getWebXmlEnvEntryOverride()

addEnvEntry

public void addEnvEntry(java.lang.String name,
                        java.lang.Object value)
Add a java:comp/env entry. Values must be serializable to be stored!


getEnvEntry

public java.lang.Object getEnvEntry(java.lang.String name)

getENC

public java.util.Map getENC()
                     throws javax.naming.NamingException
Get a mapping of java:comp/env bindings for this webapp context.

Returns:
flattened map of java:comp/env names to bound objects
Throws:
javax.naming.NamingException

doStart

public void doStart()
             throws java.lang.Exception
Description copied from class: WebApplicationContext
Start the Web Application.

Overrides:
doStart in class WebApplicationContext
Throws:
java.lang.Exception

handle

public void handle(HttpRequest request,
                   HttpResponse response)
            throws HttpException,
                   java.io.IOException
Description copied from class: HttpContext
Handler request. Determine the path within the context and then call handle(pathInContext,request,response).

Overrides:
handle in class HttpContext
Throws:
HttpException
java.io.IOException

initialize

protected void initialize()
                   throws java.lang.Exception
Description copied from class: WebApplicationContext
Initialize is called by the start method after the contexts classloader has been initialied, but before the defaults descriptor has been applied. The default implementation does nothing.

Overrides:
initialize in class WebApplicationContext
Throws:
java.lang.Exception - if an error occurs

initClassLoader

protected void initClassLoader(boolean forceContextLoader)
                        throws java.net.MalformedURLException,
                               java.io.IOException
Description copied from class: HttpContext
Initialize the context classloader. Initialize the context classloader with the current parameters. Any attempts to change the classpath after this call will result in a IllegalStateException

Overrides:
initClassLoader in class HttpContext
Parameters:
forceContextLoader - If true, a ContextLoader is always if no loader has been set.
Throws:
java.net.MalformedURLException
java.io.IOException

doStop

public void doStop()
            throws java.lang.Exception
Description copied from class: WebApplicationContext
Stop the web application. Handlers for resource, servlet, filter and security are removed as they are recreated and configured by any subsequent call to start().

Overrides:
doStop in class WebApplicationContext
Throws:
java.lang.Exception


Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.