Class ValveBase

    • Field Detail

      • log

        protected static final Logger log
      • container

        protected Container container
        The Container whose pipeline this Valve is a component of.
      • debug

        protected int debug
        The debugging detail level for this component.
      • started

        protected boolean started
        Has this component been started yet?
      • lifecycle

        protected LifecycleSupport lifecycle
        The lifecycle event support for this component.
      • info

        protected static final String info
        Descriptive information about this Valve implementation. This value should be overridden by subclasses.
        See Also:
        Constant Field Values
      • next

        protected Valve next
        The next Valve in the pipeline this Valve is a component of.
      • domain

        protected String domain
    • Constructor Detail

      • ValveBase

        public ValveBase()
    • Method Detail

      • getContainer

        public Container getContainer()
        Return the Container with which this Valve is associated, if any.
        Specified by:
        getContainer in interface Contained
      • setContainer

        public void setContainer​(Container container)
        Set the Container with which this Valve is associated, if any.
        Specified by:
        setContainer in interface Contained
        Parameters:
        container - The new associated container
      • getDebug

        public int getDebug()
        Return the debugging detail level for this component.
      • setDebug

        public void setDebug​(int debug)
        Set the debugging detail level for this component.
        Parameters:
        debug - The new debugging detail level
      • getNext

        public Valve getNext()
        Return the next Valve in this pipeline, or null if this is the last Valve in the pipeline.
        Specified by:
        getNext in interface Valve
      • setNext

        public void setNext​(Valve valve)
        Set the Valve that follows this one in the pipeline it is part of.
        Specified by:
        setNext in interface Valve
        Parameters:
        valve - The new next valve
      • backgroundProcess

        public void backgroundProcess()
        Execute a periodic task, such as reloading, etc. This method will be invoked inside the classloading context of this container. Unexpected throwables will be caught and logged.
        Specified by:
        backgroundProcess in interface Valve
      • invoke

        public abstract int invoke​(Request request,
                                   Response response)
                            throws IOException,
                                   jakarta.servlet.ServletException
        The implementation-specific logic represented by this Valve. See the Valve description for the normal design patterns for this method.

        This method MUST be provided by a subclass.

        Specified by:
        invoke in interface GlassFishValve
        Parameters:
        request - The servlet request to be processed
        response - The servlet response to be created
        Returns:
        INVOKE_NEXT or END_PIPELINE
        Throws:
        IOException - if an input/output error occurs
        jakarta.servlet.ServletException - if a servlet error occurs
      • postInvoke

        public void postInvoke​(Request request,
                               Response response)
                        throws IOException,
                               jakarta.servlet.ServletException
        A post-request processing implementation that does nothing. Very few Valves override this behaviour as most Valve logic is used for request processing.
        Specified by:
        postInvoke in interface GlassFishValve
        Parameters:
        request - The servlet request to be processed
        response - The servlet response to be created
        Throws:
        IOException - if an input/output error occurs
        jakarta.servlet.ServletException - if a servlet error occurs
      • invoke

        public void invoke​(Request request,
                           Response response)
                    throws IOException,
                           jakarta.servlet.ServletException
        Tomcat-style invocation.
        Specified by:
        invoke in interface Valve
        Parameters:
        request - The servlet request to be processed
        response - The servlet response to be created
        Throws:
        IOException - if an input/output error occurs, or is thrown by a subsequently invoked Valve, Filter, or Servlet
        jakarta.servlet.ServletException - if a servlet error occurs, or is thrown by a subsequently invoked Valve, Filter, or Servlet
      • event

        public void event​(Request request,
                          Response response,
                          CometEvent event)
                   throws IOException,
                          jakarta.servlet.ServletException
        Process a Comet event. This method will rarely need to be provided by a subclass, unless it needs to reassociate a particular object with the thread that is processing the request.
        Specified by:
        event in interface Valve
        Parameters:
        request - The servlet request to be processed
        response - The servlet response to be created
        Throws:
        IOException - if an input/output error occurs, or is thrown by a subsequently invoked Valve, Filter, or Servlet
        jakarta.servlet.ServletException - if a servlet error occurs, or is thrown by a subsequently invoked Valve, Filter, or Servlet
      • isStarted

        public boolean isStarted()
        Returns:
        true if this access log valve has been started, false otherwise.
      • addLifecycleListener

        public void addLifecycleListener​(LifecycleListener listener)
        Add a lifecycle event listener to this component.
        Specified by:
        addLifecycleListener in interface Lifecycle
        Parameters:
        listener - The listener to add
      • removeLifecycleListener

        public void removeLifecycleListener​(LifecycleListener listener)
        Remove a lifecycle event listener from this component.
        Specified by:
        removeLifecycleListener in interface Lifecycle
        Parameters:
        listener - The listener to add
      • start

        public void start()
                   throws LifecycleException
        Prepare for the beginning of active use of the public methods of this component. This method should be called after configure(), and before any of the public methods of the component are utilized.
        Specified by:
        start in interface Lifecycle
        Throws:
        LifecycleException - if this component detects a fatal error that prevents this component from being used
      • stop

        public void stop()
                  throws LifecycleException
        Gracefully terminate the active use of the public methods of this component. This method should be the last one called on a given instance of this component.
        Specified by:
        stop in interface Lifecycle
        Throws:
        LifecycleException - if this component detects a fatal error that needs to be reported
      • getObjectName

        public ObjectName getObjectName()
      • setObjectName

        public void setObjectName​(ObjectName oname)
      • getDomain

        public String getDomain()
      • getController

        public ObjectName getController()
      • setController

        public void setController​(ObjectName controller)
      • getParentName

        public ObjectName getParentName​(ObjectName valveName)
        From the name, extract the parent object name
        Parameters:
        valveName -
        Returns:
        parentName