Package org.apache.catalina.startup

## Class Tomcat.ExistingStandardWrapper

- java.lang.Object
- - org.apache.catalina.util.LifecycleBase
  - - org.apache.catalina.util.LifecycleMBeanBase
    - - org.apache.catalina.core.ContainerBase
      - - org.apache.catalina.core.StandardWrapper
        - - org.apache.catalina.startup.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.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.catalina.core.ContainerBase

      `ContainerBase.ContainerBackgroundProcessor, ContainerBase.ContainerBackgroundProcessorMonitor, ContainerBase.PrivilegedAddChild`

    - ### Nested classes/interfaces inherited from interface org.apache.catalina.Lifecycle

      `Lifecycle.SingleUse`

  - ### Field Summary

    - ### Fields inherited from class org.apache.catalina.core.StandardWrapper

      `asyncSupported, available, broadcaster, classLoadTime, classType, countAllocated, DEFAULT_SERVLET_METHODS, enabled, facade, instance, instanceInitialized, instancePool, isJspServlet, jspMonitorON, loadOnStartup, loadTime, mappings, maxInstances, multipartConfigElement, nInstances, notificationInfo, parameters, references, runAs, sequenceNumber, servletClass, singleThreadModel, swallowOutput, swValve, unloadDelay, unloading`

    - ### Fields inherited from class org.apache.catalina.core.ContainerBase

      `accessLog, backgroundProcessorDelay, backgroundProcessorFuture, children, cluster, listeners, logger, logName, monitorFuture, name, parent, parentClassLoader, pipeline, sm, startChildren, startStopExecutor, support`

    - ### Fields inherited from interface org.apache.catalina.Container

      `ADD_CHILD_EVENT, ADD_VALVE_EVENT, REMOVE_CHILD_EVENT, REMOVE_VALVE_EVENT`

    - ### Fields inherited from interface org.apache.catalina.Lifecycle

      `AFTER_DESTROY_EVENT, AFTER_INIT_EVENT, AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_DESTROY_EVENT, BEFORE_INIT_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT`

    - ### Fields inherited from interface org.apache.catalina.Wrapper

      `ADD_MAPPING_EVENT, REMOVE_MAPPING_EVENT`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ExistingStandardWrapper​(Servlet existing)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `long` | `getAvailable()` | Return the available date/time for this servlet, in milliseconds since the epoch.
    `Servlet` | `getServlet()` |
    `java.lang.String` | `getServletClass()` |
    `boolean` | `isUnavailable()` |
    `Servlet` | `loadServlet()` | Load and initialize an instance of this servlet, if there is not already at least one initialized instance.

    - ### Methods inherited from class org.apache.catalina.core.StandardWrapper

      `addChild, addInitParameter, addMapping, addNotificationListener, addSecurityReference, allocate, backgroundProcess, deallocate, findInitParameter, findInitParameters, findMappings, findSecurityReference, findSecurityReferences, getAllDeclaredMethods, getClassLoadTime, getCountAllocated, getErrorCount, getInitParameter, getInitParameterNames, getLoadOnStartup, getLoadOnStartupString, getLoadTime, getMaxInstances, getMaxTime, getMinTime, getMultipartConfigElement, getNotificationInfo, getObjectNameKeyProperties, getProcessingTime, getRequestCount, getRootCause, getRunAs, getServletContext, getServletMethods, getServletName, incrementErrorCount, isAsyncSupported, isEnabled, isOverridable, isSingleThreadModel, load, removeInitParameter, removeMapping, removeNotificationListener, removeNotificationListener, removeSecurityReference, setAsyncSupported, setAvailable, setEnabled, setLoadOnStartup, setLoadOnStartupString, setMaxInstances, setMultipartConfigElement, setOverridable, setParent, setRunAs, setServlet, setServletClass, setServletName, startInternal, stopInternal, unavailable, unload`

    - ### Methods inherited from class org.apache.catalina.core.ContainerBase

      `addContainerListener, addPropertyChangeListener, addValve, destroyInternal, findChild, findChildren, findContainerListeners, fireContainerEvent, getAccessLog, getBackgroundProcessorDelay, getCatalinaBase, getCatalinaHome, getChildren, getCluster, getClusterInternal, getDomainInternal, getLogger, getLogName, getMBeanKeyProperties, getName, getParent, getParentClassLoader, getPipeline, getRealm, getRealmInternal, getStartChildren, getStartStopThreads, initInternal, logAccess, removeChild, removeContainerListener, removePropertyChangeListener, setBackgroundProcessorDelay, setCluster, setName, setParentClassLoader, setRealm, setStartChildren, setStartStopThreads, threadStart, threadStop, toString`

    - ### Methods inherited from class org.apache.catalina.util.LifecycleMBeanBase

      `getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister, unregister`

    - ### Methods inherited from class org.apache.catalina.util.LifecycleBase

      `addLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, stop`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.apache.catalina.Container

      `addContainerListener, addPropertyChangeListener, findChild, findChildren, findContainerListeners, fireContainerEvent, getAccessLog, getBackgroundProcessorDelay, getCatalinaBase, getCatalinaHome, getCluster, getDomain, getLogger, getLogName, getMBeanKeyProperties, getName, getObjectName, getParent, getParentClassLoader, getPipeline, getRealm, getStartStopThreads, logAccess, removeChild, removeContainerListener, removePropertyChangeListener, setBackgroundProcessorDelay, setCluster, setName, setParentClassLoader, setRealm, setStartStopThreads`

    - ### Methods inherited from interface org.apache.catalina.Lifecycle

      `addLifecycleListener, destroy, findLifecycleListeners, getState, getStateName, init, removeLifecycleListener, start, stop`

- - ### Constructor Detail

    - #### ExistingStandardWrapper

          public ExistingStandardWrapper​(Servlet existing)

  - ### 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 at least one 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 class: `StandardWrapper`
      Return the available date/time for this servlet, in milliseconds since the epoch. If this date/time is Long.MAX_VALUE, it is considered to mean that unavailability is permanent and any request for this servlet will return an SC_NOT_FOUND error. 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.
      Specified by:
        `getAvailable` in interface `Wrapper`
      Overrides:
        `getAvailable` in class `StandardWrapper`
      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.

    - #### isUnavailable

          public boolean isUnavailable()

      Specified by:
        `isUnavailable` in interface `Wrapper`
      Overrides:
        `isUnavailable` in class `StandardWrapper`
      Returns:
        `true` if the Servlet has been marked unavailable.

    - #### getServlet

          public Servlet getServlet()

      Specified by:
        `getServlet` in interface `Wrapper`
      Overrides:
        `getServlet` in class `StandardWrapper`
      Returns:
        the associated servlet instance.

    - #### getServletClass

          public java.lang.String getServletClass()

      Specified by:
        `getServletClass` in interface `Wrapper`
      Overrides:
        `getServletClass` in class `StandardWrapper`
      Returns:
        the fully qualified servlet class name for this servlet.