Logo Search packages:      
Sourcecode: jetty version File versions  Download package

org::mortbay::http::HttpContext Class Reference

Inheritance diagram for org::mortbay::http::HttpContext:

org::mortbay::util::Container org::mortbay::util::LifeCycle org::mortbay::http::HttpHandler org::mortbay::util::EventProvider org::mortbay::util::LifeCycle org::mortbay::util::EventProvider org::mortbay::util::LifeCycle org::mortbay::jetty::servlet::ServletHttpContext org::mortbay::jetty::servlet::WebApplicationContext

List of all members.

Detailed Description

Context for a collection of HttpHandlers. HTTP Context provides an ordered container for HttpHandlers that share the same path prefix, filebase, resourcebase and/or classpath.

A HttpContext is analagous to a ServletContext in the Servlet API, except that it may contain other types of handler other than servlets.

A ClassLoader is created for the context and it uses Thread.currentThread().getContextClassLoader(); as it's parent loader. The class loader is initialized during start(), when a derived context calls initClassLoader() or on the first call to loadClass()

Note. that order is important when configuring a HttpContext. For example, if resource serving is enabled before servlets, then resources take priority.

See also:



HttpContext.java,v 1.136 2006/02/21 09:47:43 gregwilkins Exp
Greg Wilkins (gregw)

Definition at line 82 of file HttpContext.java.

Public Member Functions

void addClassPath (String classPath)
void addClassPaths (Resource lib)
void addEventListener (EventListener listener) throws IllegalArgumentException
synchronized void addHandler (HttpHandler handler)
synchronized void addHandler (int i, HttpHandler handler)
void addPermission (Permission permission)
void addSecurityConstraint (String pathSpec, SecurityConstraint sc)
void addVirtualHost (String hostname)
void addWelcomeFile (String welcomeFile)
boolean checkSecurityConstraints (String pathInContext, HttpRequest request, HttpResponse response) throws HttpException, IOException
void clearSecurityConstraints ()
void destroy ()
Object enterContextScope (HttpRequest request, HttpResponse response)
void flushCache ()
Object getAttribute (String name)
Enumeration getAttributeNames ()
Map getAttributes ()
Authenticator getAuthenticator ()
Resource getBaseResource ()
synchronized ClassLoader getClassLoader ()
String getClassPath ()
Collection getComponents ()
String getContextPath ()
String getEncodingByMimeType (String type)
Map getEncodingMap ()
String getFileClassPath () throws IllegalStateException
synchronized HttpHandler getHandler (Class handlerClass)
int getHandlerIndex (HttpHandler handler)
HttpHandler[] getHandlers ()
String[] getHosts ()
HttpConnection getHttpConnection ()
HttpContext getHttpContext ()
String getHttpContextName ()
HttpServer getHttpServer ()
String getInitParameter (String param)
Enumeration getInitParameterNames ()
int getMaxCachedFileSize ()
int getMaxCacheSize ()
String getMimeByExtension (String filename)
Map getMimeMap ()
String getName ()
ClassLoader getParentClassLoader ()
PermissionCollection getPermissions ()
UserRealm getRealm ()
String getRealmName ()
RequestLog getRequestLog ()
int getRequests ()
int getRequestsActive ()
int getRequestsActiveMax ()
Resource getResource (String pathInContext) throws IOException
String getResourceBase ()
ResourceMetaData getResourceMetaData (Resource resource)
int getResponses1xx ()
int getResponses2xx ()
int getResponses3xx ()
int getResponses4xx ()
int getResponses5xx ()
String[] getServerClasses ()
boolean getStatsOn ()
long getStatsOnMs ()
boolean getStopGracefully ()
String[] getSystemClasses ()
File getTempDirectory ()
String[] getVirtualHosts ()
String getWelcomeFile (Resource resource) throws IOException
String[] getWelcomeFiles ()
void handle (String pathInContext, String pathParams, HttpRequest request, HttpResponse response) throws HttpException, IOException
void handle (HttpRequest request, HttpResponse response) throws HttpException, IOException
 HttpContext (HttpServer httpServer, String contextPathSpec)
 HttpContext ()
void initialize (HttpContext context)
boolean isClassLoaderJava2Compliant ()
synchronized boolean isFailed ()
boolean isRedirectNullPath ()
synchronized boolean isStarted ()
void leaveContextScope (HttpRequest request, HttpResponse response, Object oldScope)
synchronized Class loadClass (String className) throws ClassNotFoundException
void log (HttpRequest request, HttpResponse response, int length)
synchronized void removeAttribute (String name)
void removeEventListener (EventListener listener)
synchronized void removeHandler (HttpHandler handler)
synchronized HttpHandler removeHandler (int i)
void removeVirtualHost (String hostname)
void removeWelcomeFile (String welcomeFile)
void sendError (HttpResponse response, int code, String msg) throws IOException
synchronized void setAttribute (String name, Object value)
void setAttributes (Map attributes)
void setAuthenticator (Authenticator authenticator)
void setBaseResource (Resource base)
synchronized void setClassLoader (ClassLoader loader)
void setClassLoaderJava2Compliant (boolean compliant)
void setClassPath (String classPath)
void setContextPath (String contextPathSpec)
void setEncodingMap (Map encodingMap)
void setHandlers (HttpHandler[] handlers)
void setHosts (String[] hosts) throws UnknownHostException
void setHttpContextName (String s)
void setInitParameter (String param, String value)
void setMaxCachedFileSize (int maxCachedFileSize)
void setMaxCacheSize (int maxCacheSize)
void setMimeMap (Map mimeMap)
void setMimeMapping (String extension, String type)
synchronized void setParentClassLoader (ClassLoader loader)
void setPermissions (PermissionCollection permissions)
void setRealm (UserRealm realm)
void setRealmName (String realmName)
void setRedirectNullPath (boolean b)
void setRequestLog (RequestLog log)
void setResourceBase (String resourceBase)
void setServerClasses (String[] classes)
void setStatsOn (boolean on)
void setStopGracefully (boolean graceful)
void setSystemClasses (String[] classes)
void setTempDirectory (File dir)
void setTypeEncoding (String mimeType, String encoding)
void setVirtualHosts (String[] hosts)
void setWelcomeFiles (String[] welcomes)
synchronized final void start () throws Exception
void statsReset ()
synchronized final void stop () throws InterruptedException
void stop (boolean graceful) throws InterruptedException
String toString (boolean detail)
String toString ()

Static Public Member Functions

static String canonicalContextPathSpec (String contextPathSpec)
static void sendContextError (HttpResponse response, int code, String msg) throws IOException

Static Public Attributes

static final String __ErrorHandler
static final String __fileClassPathAttr

Protected Member Functions

void addComponent (Object o)
synchronized void doStart () throws Exception
void doStop () throws Exception
void initClassLoader (boolean forceContextLoader) throws MalformedURLException, IOException
synchronized boolean isStarting ()
synchronized boolean isStopping ()
void removeComponent (Object o)
void startHandlers () throws Exception

Package Functions

void setHttpServer (HttpServer httpServer)

Package Attributes

transient int _requests
transient int _requestsActive
transient int _requestsActiveMax
transient int _responses1xx
transient int _responses2xx
transient int _responses3xx
transient int _responses4xx
transient int _responses5xx
transient Object _statsLock = new Object[0]
transient long _statsStartedAt

Private Member Functions

void readObject (java.io.ObjectInputStream in) throws IOException, ClassNotFoundException

Private Attributes

Map _attributes = new HashMap(3)
Authenticator _authenticator
boolean _classLoaderJava2Compliant = true
String _classPath
PathMap _constraintMap = new PathMap()
String _contextName
String _contextPath
transient boolean _gracefulStop
List _handlers = new ArrayList(3)
transient HttpHandler[] _handlersArray
List _hosts = new ArrayList(2)
transient HttpServer _httpServer
Map _initParams = new HashMap(11)
transient ClassLoader _loader
transient ClassLoader _parent
PermissionCollection _permissions
String _realmName
boolean _redirectNullPath = true
RequestLog _requestLog
ResourceCache _resources
String[] _serverClasses = new String[] {"-org.mortbay.http.PathMap","-org.mortbay.jetty.servlet.Invoker","-org.mortbay.jetty.servlet.JSR154Filter","-org.mortbay.jetty.servlet.Default","org.mortbay.jetty.Server","org.mortbay.http.","org.mortbay.start.","org.mortbay.stop."}
boolean _statsOn = false
String[] _systemClasses = new String [] {"java.","javax.servlet.","javax.xml.","org.mortbay.","org.xml.","org.w3c.","org.apache.commons.logging."}
transient File _tmpDir
UserRealm _userRealm
List _vhosts = new ArrayList(2)
transient String[] _vhostsArray
String[] _welcomes

Static Private Attributes

static Log log = LogFactory.getLog(HttpContext.class)


class  Scope

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index