org.eclipse.jetty.servlet
类 ServletHolder

java.lang.Object
  继承者 org.eclipse.jetty.util.component.AbstractLifeCycle
      继承者 org.eclipse.jetty.servlet.Holder<Servlet>
          继承者 org.eclipse.jetty.servlet.ServletHolder
所有已实现的接口:
Comparable, UserIdentity.Scope, Dumpable, LifeCycle

public class ServletHolder
extends Holder<Servlet>
implements UserIdentity.Scope, 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.


嵌套类摘要
protected  class ServletHolder.Config
           
 class ServletHolder.Registration
           
 
从类 org.eclipse.jetty.servlet.Holder 继承的嵌套类/接口
Holder.HolderConfig, Holder.HolderRegistration, Holder.Source
 
从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的嵌套类/接口
AbstractLifeCycle.AbstractLifeCycleListener
 
从接口 org.eclipse.jetty.util.component.LifeCycle 继承的嵌套类/接口
LifeCycle.Listener
 
字段摘要
static Map<String,String> NO_MAPPED_ROLES
           
 
从类 org.eclipse.jetty.servlet.Holder 继承的字段
_asyncSupported, _class, _className, _displayName, _extInstance, _initParams, _name, _servletHandler
 
从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的字段
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
 
构造方法摘要
ServletHolder()
          Constructor .
ServletHolder(Class<? extends Servlet> servlet)
          Constructor for servlet class.
ServletHolder(Holder.Source creator)
          Constructor .
ServletHolder(Servlet servlet)
          Constructor for existing servlet.
ServletHolder(String name, Class<? extends Servlet> servlet)
          Constructor for servlet class.
ServletHolder(String name, Servlet servlet)
          Constructor for servlet class.
 
方法摘要
 void checkServletType()
          Check to ensure class of servlet is acceptable.
 int compareTo(Object o)
          Comparitor by init order.
 void destroyInstance(Object o)
           
 void doStart()
           
 void doStop()
           
 boolean equals(Object o)
           
 String getContextPath()
           
 String getForcedPath()
           
 int getInitOrder()
           
 ServletRegistration.Dynamic getRegistration()
           
 Map<String,String> getRoleMap()
           
 Map<String,String> getRoleRefMap()
           
 String getRunAsRole()
           
 Servlet getServlet()
          Get the servlet.
 Servlet getServletInstance()
          Get the servlet instance (no initialization done).
 UnavailableException getUnavailableException()
           
 String getUserRoleLink(String name)
          get a user role link.
 void handle(Request baseRequest, ServletRequest request, ServletResponse response)
          Service a request with this servlet.
 int hashCode()
           
protected  void initJspServlet()
           
protected  void initMultiPart()
          Register a ServletRequestListener that will ensure tmp multipart files are deleted when the request goes out of scope.
 boolean isAvailable()
           
 boolean isEnabled()
           
 boolean isSetInitOrder()
           
protected  Servlet newInstance()
           
 void setEnabled(boolean enabled)
           
 void setForcedPath(String forcedPath)
           
 void setInitOrder(int order)
          Set the initialize order.
 void setRunAsRole(String role)
           
 void setServlet(Servlet servlet)
           
 void setUserRoleLink(String name, String link)
          Link a user role.
 
从类 org.eclipse.jetty.servlet.Holder 继承的方法
dump, dump, getClassName, getDisplayName, getHeldClass, getInitParameter, getInitParameterNames, getInitParameters, getName, getServletHandler, getSource, illegalStateIfContextStarted, isAsyncSupported, isInstance, setAsyncSupported, setClassName, setDisplayName, setHeldClass, setInitParameter, setInitParameters, setName, setServletHandler, toString
 
从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的方法
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
 
从类 java.lang.Object 继承的方法
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
从接口 org.eclipse.jetty.server.UserIdentity.Scope 继承的方法
getName
 

字段详细信息

NO_MAPPED_ROLES

public static final Map<String,String> NO_MAPPED_ROLES
构造方法详细信息

ServletHolder

public ServletHolder()
Constructor .


ServletHolder

public ServletHolder(Holder.Source creator)
Constructor .


ServletHolder

public ServletHolder(Servlet servlet)
Constructor for existing servlet.


ServletHolder

public ServletHolder(String name,
                     Class<? extends Servlet> servlet)
Constructor for servlet class.


ServletHolder

public ServletHolder(String name,
                     Servlet servlet)
Constructor for servlet class.


ServletHolder

public ServletHolder(Class<? extends Servlet> servlet)
Constructor for servlet class.

方法详细信息

getUnavailableException

public UnavailableException getUnavailableException()
返回:
The unavailable exception or null if not unavailable

setServlet

public void setServlet(Servlet servlet)

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.


isSetInitOrder

public boolean isSetInitOrder()

compareTo

public int compareTo(Object o)
Comparitor by init order.

指定者:
接口 Comparable 中的 compareTo

equals

public boolean equals(Object o)
覆盖:
Object 中的 equals

hashCode

public int hashCode()
覆盖:
Object 中的 hashCode

setUserRoleLink

public void setUserRoleLink(String name,
                            String link)
Link a user role. Translate the role name used by a servlet, to the link name used by the container.

参数:
name - The role name as used by the servlet
link - The role name as used by the container.

getUserRoleLink

public String getUserRoleLink(String name)
get a user role link.

参数:
name - The name of the role
返回:
The name as translated by the link. If no link exists, the name is returned.

getRoleMap

public Map<String,String> getRoleMap()

getForcedPath

public String getForcedPath()
返回:
Returns the forcedPath.

setForcedPath

public void setForcedPath(String forcedPath)
参数:
forcedPath - The forcedPath to set.

isEnabled

public boolean isEnabled()

setEnabled

public void setEnabled(boolean enabled)

doStart

public void doStart()
             throws Exception
覆盖:
Holder<Servlet> 中的 doStart
抛出:
Exception

doStop

public void doStop()
            throws Exception
覆盖:
Holder<Servlet> 中的 doStop
抛出:
Exception

destroyInstance

public void destroyInstance(Object o)
                     throws Exception
覆盖:
Holder<Servlet> 中的 destroyInstance
抛出:
Exception

getServlet

public Servlet getServlet()
                   throws ServletException
Get the servlet.

返回:
The servlet
抛出:
ServletException

getServletInstance

public Servlet getServletInstance()
Get the servlet instance (no initialization done).

返回:
The servlet or null

checkServletType

public void checkServletType()
                      throws UnavailableException
Check to ensure class of servlet is acceptable.

抛出:
UnavailableException

isAvailable

public boolean isAvailable()
返回:
true if the holder is started and is not unavailable

initJspServlet

protected void initJspServlet()
                       throws Exception
抛出:
Exception

initMultiPart

protected void initMultiPart()
                      throws Exception
Register a ServletRequestListener that will ensure tmp multipart files are deleted when the request goes out of scope.

抛出:
Exception

getContextPath

public String getContextPath()
指定者:
接口 UserIdentity.Scope 中的 getContextPath
返回:
The context path that the identity is being considered within
另请参见:
UserIdentity.Scope.getContextPath()

getRoleRefMap

public Map<String,String> getRoleRefMap()
指定者:
接口 UserIdentity.Scope 中的 getRoleRefMap
返回:
A map of role reference names that converts from names used by application code to names used by the context deployment.
另请参见:
UserIdentity.Scope.getRoleRefMap()

getRunAsRole

public String getRunAsRole()

setRunAsRole

public void setRunAsRole(String role)

handle

public void handle(Request baseRequest,
                   ServletRequest request,
                   ServletResponse response)
            throws ServletException,
                   UnavailableException,
                   IOException
Service a request with this servlet.

抛出:
ServletException
UnavailableException
IOException

getRegistration

public ServletRegistration.Dynamic getRegistration()

newInstance

protected Servlet newInstance()
                       throws ServletException,
                              IllegalAccessException,
                              InstantiationException
返回:
the newly created Servlet instance
抛出:
ServletException
IllegalAccessException
InstantiationException


Copyright © 2013. All Rights Reserved.