Package org.eclipse.jetty.servlet
Class ServletHolder
java.lang.Object
- All Implemented Interfaces:
Comparable<ServletHolder>,UserIdentity.Scope,Dumpable,LifeCycle
@ManagedObject("Servlet Holder")
@Deprecated(since="2021-05-27")
public class ServletHolder
extends Holder<Servlet>
implements UserIdentity.Scope, 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 ClassesModifier and TypeClassDescriptionstatic enumDeprecated.classDeprecated.static interfaceDeprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.static classDeprecated.Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Constructor .ServletHolder(Class<? extends Servlet> servlet) Deprecated.Constructor for servlet class.ServletHolder(String name, Class<? extends Servlet> servlet) Deprecated.Constructor for servlet class.ServletHolder(String name, Servlet servlet) Deprecated.Constructor for servlet class.ServletHolder(Servlet servlet) Deprecated.Constructor for existing servlet.ServletHolder(Source creator) Deprecated.Constructor . -
Method Summary
Modifier and TypeMethodDescriptionvoidDeprecated.Check to ensure class of servlet is acceptable.intDeprecated.Comparator by init order.voidDeprecated.voiddoStart()Deprecated.voiddoStop()Deprecated.voiddump(Appendable out, String indent) Deprecated.Dump this object (and children) into an Appendable using the provided indent after any new lines.Deprecated.booleanDeprecated.getClassNameForJsp(String jsp) Deprecated.Deprecated.Deprecated.Deprecated.intDeprecated.Deprecated.getNameOfJspClass(String jsp) Deprecated.Deprecated.Deprecated.Deprecated.Deprecated.Deprecated.Get the servlet.Deprecated.Get the servlet instance (no initialization done).Deprecated.getUserRoleLink(String name) Deprecated.get a user role link.voidhandle(Request baseRequest, ServletRequest request, ServletResponse response) Deprecated.Service a request with this servlet.inthashCode()Deprecated.voidDeprecated.Do any setup necessary after startingbooleanDeprecated.booleanDeprecated.voidsetEnabled(boolean enabled) Deprecated.voidsetForcedPath(String forcedPath) Deprecated.voidsetInitOrder(int order) Deprecated.Set the initialize order.voidsetRunAsRole(String role) Deprecated.voidsetServlet(Servlet servlet) Deprecated.voidsetUserRoleLink(String name, String link) Deprecated.Link a user role.toString()Deprecated.Methods inherited from class org.eclipse.jetty.servlet.Holder
dump, getDisplayName, getInitParameter, getInitParameterNames, getInitParameters, getName, isAsyncSupported, setAsyncSupported, setClassName, setDisplayName, setHeldClass, setInitParameter, setInitParameters, setNameMethods inherited from class org.eclipse.jetty.servlet.BaseHolder
getClassName, getHeldClass, getServletHandler, getSource, isInstance, setServletHandlerMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stopMethods inherited from interface org.eclipse.jetty.server.UserIdentity.Scope
getName
-
Field Details
-
APACHE_SENTINEL_CLASS
Deprecated.- See Also:
-
JSP_GENERATED_PACKAGE_NAME
Deprecated.- See Also:
-
-
Constructor Details
-
ServletHolder
public ServletHolder()Deprecated.Constructor . -
ServletHolder
Deprecated.Constructor .- Parameters:
creator- the holder source
-
ServletHolder
Deprecated.Constructor for existing servlet.- Parameters:
servlet- the servlet
-
ServletHolder
Deprecated.Constructor for servlet class.- Parameters:
name- the name of the servletservlet- the servlet class
-
ServletHolder
Deprecated.Constructor for servlet class.- Parameters:
name- the servlet nameservlet- the servlet
-
ServletHolder
Deprecated.Constructor for servlet class.- Parameters:
servlet- the servlet class
-
-
Method Details
-
setServlet
Deprecated. -
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
Deprecated.Comparator by init order.- Specified by:
compareToin interfaceComparable<ServletHolder>
-
equals
Deprecated. -
hashCode
public int hashCode()Deprecated. -
setUserRoleLink
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
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
Deprecated.- Returns:
- Returns the forcedPath.
-
setForcedPath
Deprecated.- Parameters:
forcedPath- The forcedPath to set.
-
isEnabled
public boolean isEnabled()Deprecated. -
setEnabled
public void setEnabled(boolean enabled) Deprecated. -
doStart
Deprecated.- Overrides:
doStartin classBaseHolder<Servlet>- Throws:
Exception
-
initialize
Deprecated.Description copied from class:BaseHolderDo any setup necessary after starting- Overrides:
initializein classBaseHolder<Servlet>- Throws:
Exception- if unable to initialize
-
doStop
Deprecated.- Overrides:
doStopin classBaseHolder<Servlet>- Throws:
Exception
-
destroyInstance
Deprecated.- Overrides:
destroyInstancein classHolder<Servlet>
-
getServlet
Deprecated.Get the servlet.- Returns:
- The servlet
- Throws:
ServletException- if unable to init the servlet on first use
-
getServletInstance
Deprecated.Get the servlet instance (no initialization done).- Returns:
- The servlet or null
-
checkServletType
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
Deprecated.- Specified by:
getContextHandlerin interfaceUserIdentity.Scope- Returns:
- The context handler that the identity is being considered within
-
getContextPath
Deprecated.- Specified by:
getContextPathin interfaceUserIdentity.Scope- Returns:
- The context path that the identity is being considered within
- See Also:
-
getRoleRefMap
Deprecated.- Specified by:
getRoleRefMapin 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:
-
getRunAsRole
Deprecated. -
setRunAsRole
Deprecated. -
ensureInstance
Deprecated.- Throws:
ServletException
-
handle
public void handle(Request baseRequest, ServletRequest request, ServletResponse response) throws ServletException, UnavailableException, 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 unavailableIOException- if unable to process the request or response
-
getNameOfJspClass
Deprecated.- Parameters:
jsp- the jsp-file- Returns:
- the simple classname of the jsp
-
getPackageOfJspClass
Deprecated. -
getJspPackagePrefix
Deprecated.- Returns:
- the package for all jsps
-
getClassNameForJsp
Deprecated.- Parameters:
jsp- the jsp-file from web.xml- Returns:
- the fully qualified classname
-
getRegistration
Deprecated. -
dump
Deprecated.Description copied from interface:DumpableDump 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:
dumpin interfaceDumpable- Overrides:
dumpin classBaseHolder<Servlet>- Parameters:
out- The appendable to dump toindent- The indent to apply after any new lines.- Throws:
IOException- if unable to write to Appendable
-
toString
Deprecated.