Class ServletStatusManager

  • All Implemented Interfaces:
    com.helger.scope.IScopeDestructionAware

    @ThreadSafe
    public final class ServletStatusManager
    extends com.helger.scope.singleton.AbstractGlobalSingleton
    A manager for keeping track of the default servlets states.
    Since:
    9.0.0
    Author:
    Philip Helger
    • Field Summary

      • Fields inherited from class com.helger.scope.singleton.AbstractSingleton

        m_aRWLock
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.helger.commons.collection.impl.ICommonsMap<String,​ServletStatus> getAllStatus()  
      static ServletStatusManager getInstance()  
      static ServletStatusManager getInstanceIfInstantiated()  
      ServletStatus getStatus​(Class<? extends javax.servlet.GenericServlet> aServletClass)  
      boolean isServletRegistered​(Class<? extends javax.servlet.GenericServlet> aServletClass)
      Static utility method that checks the ServletContext whether the passed servlet class is registered or not.
      void onServletCtor​(Class<? extends javax.servlet.GenericServlet> aServletClass)  
      void onServletDestroy​(Class<? extends javax.servlet.GenericServlet> aServletClass)  
      void onServletInit​(Class<? extends javax.servlet.GenericServlet> aServletClass)
      Invoked at the beginning of the servlet initialization.
      void onServletInitFailed​(Exception aInitException, Class<? extends javax.servlet.GenericServlet> aServletClass)  
      void onServletInvocation​(Class<? extends javax.servlet.GenericServlet> aServletClass)
      Invoked at the beginning of a servlet invocation
      com.helger.commons.state.EChange reset()
      Reset all contained information!
      • Methods inherited from class com.helger.scope.singleton.AbstractGlobalSingleton

        getAllGlobalSingletons, getGlobalSingleton, getGlobalSingletonIfInstantiated, isGlobalSingletonInstantiated
      • Methods inherited from class com.helger.scope.singleton.AbstractSingleton

        getAllSingletons, getSingleton, getSingletonIfInstantiated, getSingletonScopeKey, isDestroyed, isInDestruction, isInInstantiation, isInPreDestruction, isInstantiated, isSingletonInstantiated, isUsableObject, onAfterInstantiation, onBeforeDestroy, onBeforeScopeDestruction, onDestroy, onScopeDestruction, readAbstractSingletonFields, setDestroyed, setInDestruction, setInInstantiation, setInPreDestruction, setInstantiated, toString, writeAbstractSingletonFields
    • Constructor Detail

      • ServletStatusManager

        @Deprecated
        @UsedViaReflection
        public ServletStatusManager()
        Deprecated.
    • Method Detail

      • reset

        @Nonnull
        public com.helger.commons.state.EChange reset()
        Reset all contained information!
        Returns:
        EChange
      • onServletCtor

        public void onServletCtor​(@Nonnull
                                  Class<? extends javax.servlet.GenericServlet> aServletClass)
      • onServletInit

        public void onServletInit​(@Nonnull
                                  Class<? extends javax.servlet.GenericServlet> aServletClass)
        Invoked at the beginning of the servlet initialization.
        Parameters:
        aServletClass - Relevant servlet class. May not be null.
      • onServletInitFailed

        public void onServletInitFailed​(@Nonnull
                                        Exception aInitException,
                                        @Nonnull
                                        Class<? extends javax.servlet.GenericServlet> aServletClass)
      • onServletInvocation

        public void onServletInvocation​(@Nonnull
                                        Class<? extends javax.servlet.GenericServlet> aServletClass)
        Invoked at the beginning of a servlet invocation
        Parameters:
        aServletClass - Servlet class invoked. May not be null.
      • onServletDestroy

        public void onServletDestroy​(@Nonnull
                                     Class<? extends javax.servlet.GenericServlet> aServletClass)
      • getAllStatus

        @Nonnull
        @ReturnsMutableCopy
        public com.helger.commons.collection.impl.ICommonsMap<String,​ServletStatus> getAllStatus()
      • isServletRegistered

        public boolean isServletRegistered​(@Nonnull
                                           Class<? extends javax.servlet.GenericServlet> aServletClass)
        Static utility method that checks the ServletContext whether the passed servlet class is registered or not.
        Parameters:
        aServletClass - The servlet class to be checked. May not be null.
        Returns:
        true if the passed servlet class is contained in the ServletContext.