org.apache.tomcat.core
Class Container

java.lang.Object
  |
  +--org.apache.tomcat.core.Container

public class Container
extends java.lang.Object
implements java.lang.Cloneable

A group of resources, with some common properties. Container is similar with Apache "dir_conf" structue. In Servlet terminology there are many types of containers: virtual host, context, prefix map, extension map, security prefix and extension maps. The most expensive operation is parsing the request and finding the match. With ad-literam interpreation of the spec, we need to parse at least 3 times: find context, find servlet, check security constraints. There is no difference in those steps - except the result of the mapping. Each Interceptor has the chance to alter the Container for a particular map via addMapping() callback. It can set private informations as attributes ( the Mapper or security interceptors will probably do so ).


Constructor Summary
Container()
           
 
Method Summary
 void addContextInterceptor(ContextInterceptor ci)
           
 void addRequestInterceptor(RequestInterceptor ci)
           
 java.lang.Object getAttribute(java.lang.String name)
           
 java.util.Enumeration getAttributeNames()
           
 Container getClone()
           
 Context getContext()
           
 ContextInterceptor[] getContextInterceptors()
          Return the context interceptors as an array.
 ContextManager getContextManager()
           
 ServletWrapper getHandler()
           
 java.lang.String getPath()
           
 java.lang.String getProtocol()
           
 RequestInterceptor[] getRequestInterceptors()
          Return the context interceptors as an array.
 java.lang.String[] getRoles()
          If not null, this container can only be accessed by users in roles.
 java.lang.String getTransport()
           
 void removeAttribute(java.lang.String name)
           
 void setAttribute(java.lang.String name, java.lang.Object object)
           
 void setContext(Context ctx)
           
 void setContextManager(ContextManager cm)
           
 void setHandler(ServletWrapper h)
           
 void setPath(java.lang.String path)
           
 void setProtocol(java.lang.String protocol)
           
 void setRoles(java.lang.String[] roles)
          If not null, this container can only be accessed by users in roles.
 void setTransport(java.lang.String transport)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Container

public Container()
Method Detail

getContextManager

public ContextManager getContextManager()

setContextManager

public void setContextManager(ContextManager cm)

setContext

public void setContext(Context ctx)

getContext

public Context getContext()

setPath

public void setPath(java.lang.String path)

getPath

public java.lang.String getPath()

setProtocol

public void setProtocol(java.lang.String protocol)

getProtocol

public java.lang.String getProtocol()

addContextInterceptor

public void addContextInterceptor(ContextInterceptor ci)

getContextInterceptors

public ContextInterceptor[] getContextInterceptors()
Return the context interceptors as an array. For performance reasons we use an array instead of returning the vector - the interceptors will not change at runtime and array access is faster and easier than vector access

addRequestInterceptor

public void addRequestInterceptor(RequestInterceptor ci)

getRequestInterceptors

public RequestInterceptor[] getRequestInterceptors()
Return the context interceptors as an array. For performance reasons we use an array instead of returning the vector - the interceptors will not change at runtime and array access is faster and easier than vector access

getAttribute

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

getAttributeNames

public java.util.Enumeration getAttributeNames()

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object object)

removeAttribute

public void removeAttribute(java.lang.String name)

getHandler

public ServletWrapper getHandler()

setHandler

public void setHandler(ServletWrapper h)

setTransport

public void setTransport(java.lang.String transport)

getTransport

public java.lang.String getTransport()

getRoles

public java.lang.String[] getRoles()
If not null, this container can only be accessed by users in roles.

setRoles

public void setRoles(java.lang.String[] roles)
If not null, this container can only be accessed by users in roles.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getClone

public Container getClone()


Copyright © 2000 Apache Software Foundation. All Rights Reserved.