java.lang.Object
java.util.AbstractMap
org.mortbay.jetty.servlet.Holder
org.mortbay.jetty.servlet.ServletHolder
- All Implemented Interfaces:
- java.lang.Comparable, org.mortbay.util.LifeCycle, java.util.Map, java.io.Serializable
- public class ServletHolder
- extends Holder
- implements java.lang.Comparable
Servlet Instance and Context Holder.
Holds the name, params and some state of a javax.servlet.Servlet
instance. It implements the ServletConfig interface.
This class will organise the loading of the servlet when needed or
requested.
- Version:
- $Id: ServletHolder.java,v 1.39 2003/09/18 13:29:24 gregwilkins Exp $
| Nested classes inherited from class java.util.AbstractMap |
|
| Nested classes inherited from class java.util.Map |
java.util.Map.Entry |
| Methods inherited from class org.mortbay.jetty.servlet.Holder |
entrySet, get, getClassName, getDisplayName, getHttpHandler, getInitParameter, getInitParameterNames, getInitParameters, getName, isStarted, newInstance, put, setDisplayName, setInitParameter, toString |
| Methods inherited from class java.util.AbstractMap |
clear, clone, containsKey, containsValue, hashCode, isEmpty, keySet, putAll, remove, size, values |
log
private static org.apache.commons.logging.Log log
_initOrder
private int _initOrder
_initOnStartup
private boolean _initOnStartup
_roleMap
private java.util.Map _roleMap
_forcedPath
private java.lang.String _forcedPath
_run_as
private java.lang.String _run_as
_realm
private org.mortbay.http.UserRealm _realm
_servlets
private transient java.util.Stack _servlets
_servlet
private transient javax.servlet.Servlet _servlet
_config
private transient ServletHolder.Config _config
_unavailable
private transient long _unavailable
_unavailableEx
private transient javax.servlet.UnavailableException _unavailableEx
ServletHolder
public ServletHolder()
- Constructor for Serialization.
ServletHolder
public ServletHolder(ServletHandler handler,
java.lang.String name,
java.lang.String className)
- Constructor.
ServletHolder
public ServletHolder(ServletHandler handler,
java.lang.String name,
java.lang.String className,
java.lang.String forcedPath)
- Constructor.
getInitOrder
public int getInitOrder()
setInitOrder
public void setInitOrder(int order)
- Set the initialize order.
Holders with order<0, are initialized on use. Those with
order>=0 are initialized in increasing order when the handler
is started.
compareTo
public int compareTo(java.lang.Object o)
- Comparitor by init order.
- Specified by:
compareTo in interface java.lang.Comparable
equals
public boolean equals(java.lang.Object o)
- Description copied from class:
java.util.AbstractMap
- Compares the specified object with this map for equality. Returns
true if the other object is a Map with the same mappings,
that is,
o instanceof Map && entrySet().equals(((Map) o).entrySet();
- Specified by:
equals in interface java.util.Map
getServletContext
public javax.servlet.ServletContext getServletContext()
setUserRoleLink
public void setUserRoleLink(java.lang.String name,
java.lang.String link)
- Link a user role.
Translate the role name used by a servlet, to the link name
used by the container.
getUserRoleLink
public java.lang.String getUserRoleLink(java.lang.String name)
- get a user role link.
setRunAs
public void setRunAs(java.lang.String role)
getRunAs
public java.lang.String getRunAs()
start
public void start()
throws java.lang.Exception
- Description copied from interface:
org.mortbay.util.LifeCycle
- Start the LifeCycle.
- Specified by:
start in interface org.mortbay.util.LifeCycle- Overrides:
start in class Holder
stop
public void stop()
- Description copied from interface:
org.mortbay.util.LifeCycle
- Stop the LifeCycle.
The LifeCycle may wait for current activities to complete
normally, but it can be interrupted.
- Specified by:
stop in interface org.mortbay.util.LifeCycle- Overrides:
stop in class Holder
getServlet
public javax.servlet.Servlet getServlet()
throws javax.servlet.UnavailableException
- Get the servlet.
handle
public void handle(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response)
throws javax.servlet.ServletException,
javax.servlet.UnavailableException,
java.io.IOException
- Service a request with this servlet.