Class ServletHolder

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.

  • Field Details

  • Constructor Details

    • 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(String name, Class<? extends Servlet> servlet)
      Deprecated.
      Constructor for servlet class.
      Parameters:
      name - the name of the servlet
      servlet - the servlet class
    • ServletHolder

      public ServletHolder(String name, Servlet servlet)
      Deprecated.
      Constructor for servlet class.
      Parameters:
      name - the servlet name
      servlet - the servlet
    • ServletHolder

      public ServletHolder(Class<? extends Servlet> servlet)
      Deprecated.
      Constructor for servlet class.
      Parameters:
      servlet - the servlet class
  • Method Details

    • 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 interface Comparable<ServletHolder>
    • equals

      public boolean equals(Object o)
      Deprecated.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Deprecated.
      Overrides:
      hashCode in class Object
    • setUserRoleLink

      public void setUserRoleLink(String name, 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 servlet
      link - The role name as used by the container.
    • getUserRoleLink

      public String getUserRoleLink(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 String getForcedPath()
      Deprecated.
      Returns:
      Returns the forcedPath.
    • setForcedPath

      public void setForcedPath(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 Exception
      Deprecated.
      Overrides:
      doStart in class BaseHolder<Servlet>
      Throws:
      Exception
    • initialize

      public void initialize() throws Exception
      Deprecated.
      Description copied from class: BaseHolder
      Do any setup necessary after starting
      Overrides:
      initialize in class BaseHolder<Servlet>
      Throws:
      Exception - if unable to initialize
    • doStop

      public void doStop() throws Exception
      Deprecated.
      Overrides:
      doStop in class BaseHolder<Servlet>
      Throws:
      Exception
    • destroyInstance

      public void destroyInstance(Object o)
      Deprecated.
      Overrides:
      destroyInstance in class Holder<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 type Servlet
    • 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 interface UserIdentity.Scope
      Returns:
      The context handler that the identity is being considered within
    • getContextPath

      public String getContextPath()
      Deprecated.
      Specified by:
      getContextPath in interface UserIdentity.Scope
      Returns:
      The context path that the identity is being considered within
      See Also:
    • getRoleRefMap

      public Map<String,String> getRoleRefMap()
      Deprecated.
      Specified by:
      getRoleRefMap in interface UserIdentity.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

      @ManagedAttribute(value="role to run servlet as", readonly=true) public String getRunAsRole()
      Deprecated.
    • setRunAsRole

      public void setRunAsRole(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, IOException
      Deprecated.
      Service a request with this servlet.
      Parameters:
      baseRequest - the base request
      request - the request
      response - the response
      Throws:
      ServletException - if unable to process the servlet
      UnavailableException - if servlet is unavailable
      IOException - if unable to process the request or response
    • getNameOfJspClass

      public String getNameOfJspClass(String jsp)
      Deprecated.
      Parameters:
      jsp - the jsp-file
      Returns:
      the simple classname of the jsp
    • getPackageOfJspClass

      public String getPackageOfJspClass(String jsp)
      Deprecated.
    • getJspPackagePrefix

      public String getJspPackagePrefix()
      Deprecated.
      Returns:
      the package for all jsps
    • getClassNameForJsp

      public String getClassNameForJsp(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(Appendable out, String indent) throws 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 interface Dumpable
      Overrides:
      dump in class BaseHolder<Servlet>
      Parameters:
      out - The appendable to dump to
      indent - The indent to apply after any new lines.
      Throws:
      IOException - if unable to write to Appendable
    • toString

      public String toString()
      Deprecated.
      Overrides:
      toString in class Holder<Servlet>