Class AbstractLeakPreventer

  • All Implemented Interfaces:
    LifeCycle
    Direct Known Subclasses:
    AppContextLeakPreventer, AWTLeakPreventer, DriverManagerLeakPreventer

    public abstract class AbstractLeakPreventer
    extends AbstractLifeCycle
    AbstractLeakPreventer Abstract base class for code that seeks to avoid pinning of webapp classloaders by using the jetty classloader to proactively call the code that pins them (generally pinned as static data members, or as static data members that are daemon threads (which use the context classloader)). Instances of subclasses of this class should be set with Server.addBean(), which will ensure that they are called when the Server instance starts up, which will have the jetty classloader in scope.
    • Field Detail

      • LOG

        protected static final org.slf4j.Logger LOG
    • Constructor Detail

      • AbstractLeakPreventer

        public AbstractLeakPreventer()
    • Method Detail

      • prevent

        public abstract void prevent​(java.lang.ClassLoader loader)
      • doStart

        protected void doStart()
                        throws java.lang.Exception
        Description copied from class: AbstractLifeCycle
        Method to override to start the lifecycle
        Overrides:
        doStart in class AbstractLifeCycle
        Throws:
        AbstractLifeCycle.StopException - If thrown, the lifecycle will immediately be stopped.
        java.lang.Exception - If there was a problem starting. Will cause a transition to FAILED state