Package org.eclipse.jetty.servlet
Class ServletHolder
- java.lang.Object
-
- org.eclipse.jetty.util.component.AbstractLifeCycle
-
- org.eclipse.jetty.servlet.BaseHolder<T>
-
- org.eclipse.jetty.servlet.Holder<Servlet>
-
- org.eclipse.jetty.servlet.ServletHolder
-
- All Implemented Interfaces:
java.lang.Comparable<ServletHolder>
,UserIdentity.Scope
,Dumpable
,LifeCycle
@ManagedObject("Servlet Holder") @Deprecated(since="2021-05-27") public class ServletHolder extends Holder<Servlet> implements UserIdentity.Scope, java.lang.Comparable<ServletHolder>
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ServletHolder.JspContainer
Deprecated.class
ServletHolder.Registration
Deprecated.static interface
ServletHolder.WrapFunction
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.static class
ServletHolder.Wrapper
Deprecated.-
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
APACHE_SENTINEL_CLASS
Deprecated.static java.lang.String
JSP_GENERATED_PACKAGE_NAME
Deprecated.
-
Constructor Summary
Constructors Constructor Description ServletHolder()
Deprecated.Constructor .ServletHolder(java.lang.Class<? extends Servlet> servlet)
Deprecated.Constructor for servlet class.ServletHolder(java.lang.String name, java.lang.Class<? extends Servlet> servlet)
Deprecated.Constructor for servlet class.ServletHolder(java.lang.String name, Servlet servlet)
Deprecated.Constructor for servlet class.ServletHolder(Servlet servlet)
Deprecated.Constructor for existing servlet.ServletHolder(Source creator)
Deprecated.Constructor .
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
checkServletType()
Deprecated.Check to ensure class of servlet is acceptable.int
compareTo(ServletHolder sh)
Deprecated.Comparator by init order.void
destroyInstance(java.lang.Object o)
Deprecated.void
doStart()
Deprecated.void
doStop()
Deprecated.void
dump(java.lang.Appendable out, java.lang.String indent)
Deprecated.Dump this object (and children) into an Appendable using the provided indent after any new lines.Servlet
ensureInstance()
Deprecated.boolean
equals(java.lang.Object o)
Deprecated.java.lang.String
getClassNameForJsp(java.lang.String jsp)
Deprecated.ContextHandler
getContextHandler()
Deprecated.java.lang.String
getContextPath()
Deprecated.java.lang.String
getForcedPath()
Deprecated.int
getInitOrder()
Deprecated.java.lang.String
getJspPackagePrefix()
Deprecated.java.lang.String
getNameOfJspClass(java.lang.String jsp)
Deprecated.java.lang.String
getPackageOfJspClass(java.lang.String jsp)
Deprecated.ServletRegistration.Dynamic
getRegistration()
Deprecated.java.util.Map<java.lang.String,java.lang.String>
getRoleRefMap()
Deprecated.java.lang.String
getRunAsRole()
Deprecated.Servlet
getServlet()
Deprecated.Get the servlet.Servlet
getServletInstance()
Deprecated.Get the servlet instance (no initialization done).UnavailableException
getUnavailableException()
Deprecated.java.lang.String
getUserRoleLink(java.lang.String name)
Deprecated.get a user role link.void
handle(Request baseRequest, ServletRequest request, ServletResponse response)
Deprecated.Service a request with this servlet.int
hashCode()
Deprecated.void
initialize()
Deprecated.Do any setup necessary after startingboolean
isAvailable()
Deprecated.boolean
isEnabled()
Deprecated.void
setEnabled(boolean enabled)
Deprecated.void
setForcedPath(java.lang.String forcedPath)
Deprecated.void
setInitOrder(int order)
Deprecated.Set the initialize order.void
setRunAsRole(java.lang.String role)
Deprecated.void
setServlet(Servlet servlet)
Deprecated.void
setUserRoleLink(java.lang.String name, java.lang.String link)
Deprecated.Link a user role.java.lang.String
toString()
Deprecated.-
Methods inherited from class org.eclipse.jetty.servlet.Holder
dump, getDisplayName, getInitParameter, getInitParameterNames, getInitParameters, getName, isAsyncSupported, setAsyncSupported, setClassName, setDisplayName, setHeldClass, setInitParameter, setInitParameters, setName
-
Methods inherited from class org.eclipse.jetty.servlet.BaseHolder
getClassName, getHeldClass, getServletHandler, getSource, isInstance, setServletHandler
-
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stop
-
Methods inherited from interface org.eclipse.jetty.server.UserIdentity.Scope
getName
-
-
-
-
Field Detail
-
APACHE_SENTINEL_CLASS
public static final java.lang.String APACHE_SENTINEL_CLASS
Deprecated.- See Also:
- Constant Field Values
-
JSP_GENERATED_PACKAGE_NAME
public static final java.lang.String JSP_GENERATED_PACKAGE_NAME
Deprecated.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ServletHolder
public ServletHolder()
Deprecated.Constructor .
-
ServletHolder
public ServletHolder(Source creator)
Deprecated.Constructor .- Parameters:
creator
- the holder source
-
ServletHolder
public ServletHolder(Servlet servlet)
Deprecated.Constructor for existing servlet.- Parameters:
servlet
- the servlet
-
ServletHolder
public ServletHolder(java.lang.String name, java.lang.Class<? extends Servlet> servlet)
Deprecated.Constructor for servlet class.- Parameters:
name
- the name of the servletservlet
- the servlet class
-
ServletHolder
public ServletHolder(java.lang.String name, Servlet servlet)
Deprecated.Constructor for servlet class.- Parameters:
name
- the servlet nameservlet
- the servlet
-
ServletHolder
public ServletHolder(java.lang.Class<? extends Servlet> servlet)
Deprecated.Constructor for servlet class.- Parameters:
servlet
- the servlet class
-
-
Method Detail
-
getUnavailableException
public UnavailableException getUnavailableException()
Deprecated.- Returns:
- The unavailable exception or null if not unavailable
-
setServlet
public void setServlet(Servlet servlet)
Deprecated.
-
getInitOrder
@ManagedAttribute(value="initialization order", readonly=true) public int getInitOrder()
Deprecated.
-
setInitOrder
public void setInitOrder(int order)
Deprecated.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.
- Parameters:
order
- the servlet init order
-
compareTo
public int compareTo(ServletHolder sh)
Deprecated.Comparator by init order.- Specified by:
compareTo
in interfacejava.lang.Comparable<ServletHolder>
-
equals
public boolean equals(java.lang.Object o)
Deprecated.- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
Deprecated.- Overrides:
hashCode
in classjava.lang.Object
-
setUserRoleLink
public void setUserRoleLink(java.lang.String name, java.lang.String link)
Deprecated.Link a user role. Translate the role name used by a servlet, to the link name used by the container.- Parameters:
name
- The role name as used by the servletlink
- The role name as used by the container.
-
getUserRoleLink
public java.lang.String getUserRoleLink(java.lang.String name)
Deprecated.get a user role link.- Parameters:
name
- The name of the role- Returns:
- The name as translated by the link. If no link exists, the name is returned.
-
getForcedPath
@ManagedAttribute(value="forced servlet path", readonly=true) public java.lang.String getForcedPath()
Deprecated.- Returns:
- Returns the forcedPath.
-
setForcedPath
public void setForcedPath(java.lang.String forcedPath)
Deprecated.- Parameters:
forcedPath
- The forcedPath to set.
-
isEnabled
public boolean isEnabled()
Deprecated.
-
setEnabled
public void setEnabled(boolean enabled)
Deprecated.
-
doStart
public void doStart() throws java.lang.Exception
Deprecated.- Overrides:
doStart
in classBaseHolder<Servlet>
- Throws:
java.lang.Exception
-
initialize
public void initialize() throws java.lang.Exception
Deprecated.Description copied from class:BaseHolder
Do any setup necessary after starting- Overrides:
initialize
in classBaseHolder<Servlet>
- Throws:
java.lang.Exception
- if unable to initialize
-
doStop
public void doStop() throws java.lang.Exception
Deprecated.- Overrides:
doStop
in classBaseHolder<Servlet>
- Throws:
java.lang.Exception
-
destroyInstance
public void destroyInstance(java.lang.Object o)
Deprecated.- Overrides:
destroyInstance
in classHolder<Servlet>
-
getServlet
public Servlet getServlet() throws ServletException
Deprecated.Get the servlet.- Returns:
- The servlet
- Throws:
ServletException
- if unable to init the servlet on first use
-
getServletInstance
public Servlet getServletInstance()
Deprecated.Get the servlet instance (no initialization done).- Returns:
- The servlet or null
-
checkServletType
public void checkServletType() throws UnavailableException
Deprecated.Check to ensure class of servlet is acceptable.- Throws:
UnavailableException
- if Servlet class is not of typeServlet
-
isAvailable
public boolean isAvailable()
Deprecated.- Returns:
- true if the holder is started and is not unavailable
-
getContextHandler
public ContextHandler getContextHandler()
Deprecated.- Specified by:
getContextHandler
in interfaceUserIdentity.Scope
- Returns:
- The context handler that the identity is being considered within
-
getContextPath
public java.lang.String getContextPath()
Deprecated.- Specified by:
getContextPath
in interfaceUserIdentity.Scope
- Returns:
- The context path that the identity is being considered within
- See Also:
UserIdentity.Scope.getContextPath()
-
getRoleRefMap
public java.util.Map<java.lang.String,java.lang.String> getRoleRefMap()
Deprecated.- Specified by:
getRoleRefMap
in interfaceUserIdentity.Scope
- Returns:
- A map of role reference names that converts from names used by application code to names used by the context deployment.
- See Also:
UserIdentity.Scope.getRoleRefMap()
-
getRunAsRole
@ManagedAttribute(value="role to run servlet as", readonly=true) public java.lang.String getRunAsRole()
Deprecated.
-
setRunAsRole
public void setRunAsRole(java.lang.String role)
Deprecated.
-
ensureInstance
@Deprecated public Servlet ensureInstance() throws ServletException
Deprecated.- Throws:
ServletException
-
handle
public void handle(Request baseRequest, ServletRequest request, ServletResponse response) throws ServletException, UnavailableException, java.io.IOException
Deprecated.Service a request with this servlet.- Parameters:
baseRequest
- the base requestrequest
- the requestresponse
- the response- Throws:
ServletException
- if unable to process the servletUnavailableException
- if servlet is unavailablejava.io.IOException
- if unable to process the request or response
-
getNameOfJspClass
public java.lang.String getNameOfJspClass(java.lang.String jsp)
Deprecated.- Parameters:
jsp
- the jsp-file- Returns:
- the simple classname of the jsp
-
getPackageOfJspClass
public java.lang.String getPackageOfJspClass(java.lang.String jsp)
Deprecated.
-
getJspPackagePrefix
public java.lang.String getJspPackagePrefix()
Deprecated.- Returns:
- the package for all jsps
-
getClassNameForJsp
public java.lang.String getClassNameForJsp(java.lang.String jsp)
Deprecated.- Parameters:
jsp
- the jsp-file from web.xml- Returns:
- the fully qualified classname
-
getRegistration
public ServletRegistration.Dynamic getRegistration()
Deprecated.
-
dump
public void dump(java.lang.Appendable out, java.lang.String indent) throws java.io.IOException
Deprecated.Description copied from interface:Dumpable
Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.- Specified by:
dump
in interfaceDumpable
- Overrides:
dump
in classBaseHolder<Servlet>
- Parameters:
out
- The appendable to dump toindent
- The indent to apply after any new lines.- Throws:
java.io.IOException
- if unable to write to Appendable
-
-