Class Tomcat.ExistingStandardWrapper

  • All Implemented Interfaces:
    ServletConfig, javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, Container, JmxEnabled, Lifecycle, Wrapper
    Enclosing class:
    Tomcat

    public static class Tomcat.ExistingStandardWrapper
    extends StandardWrapper
    Helper class for wrapping existing servlets. This disables servlet lifecycle and normal reloading, but also reduces overhead and provide more direct control over the servlet.
    • Constructor Detail

      • ExistingStandardWrapper

        public ExistingStandardWrapper​(Servlet existing)
        Wraps the given servlet.
        Parameters:
        existing - the servlet instance to wrap
    • Method Detail

      • loadServlet

        public Servlet loadServlet()
                            throws ServletException
        Description copied from class: StandardWrapper
        Load and initialize an instance of this servlet, if there is not already an initialized instance. This can be used, for example, to load servlets that are marked in the deployment descriptor to be loaded at server startup time.
        Overrides:
        loadServlet in class StandardWrapper
        Returns:
        the loaded Servlet instance
        Throws:
        ServletException - for a Servlet load error
      • getAvailable

        public long getAvailable()
        Description copied from interface: Wrapper
        Returns the available date/time for this servlet, in milliseconds since the epoch. If this date/time is in the future, any request for this servlet will return an SC_SERVICE_UNAVAILABLE error. If it is zero, the servlet is currently available. A value equal to Long.MAX_VALUE is considered to mean that unavailability is permanent.
        Specified by:
        getAvailable in interface Wrapper
        Overrides:
        getAvailable in class StandardWrapper
        Returns:
        the available date/time in milliseconds since the epoch
      • isUnavailable

        public boolean isUnavailable()
        Description copied from interface: Wrapper
        Returns whether this Servlet is currently unavailable.
        Specified by:
        isUnavailable in interface Wrapper
        Overrides:
        isUnavailable in class StandardWrapper
        Returns:
        true if this Servlet is currently unavailable
      • getServletClass

        public java.lang.String getServletClass()
        Description copied from interface: Wrapper
        Returns the fully qualified servlet class name for this servlet.
        Specified by:
        getServletClass in interface Wrapper
        Overrides:
        getServletClass in class StandardWrapper
        Returns:
        the servlet class name