Interface IoFilter

    • Method Detail

      • init

        void init()
           throws java.lang.Exception
        Invoked by ReferenceCountingIoFilter when this filter is added to a IoFilterChain at the first time, so you can initialize shared resources. Please note that this method is never called if you don't wrap a filter with ReferenceCountingIoFilter.
        Throws:
        java.lang.Exception
      • destroy

        void destroy()
              throws java.lang.Exception
        Invoked by ReferenceCountingIoFilter when this filter is not used by any IoFilterChain anymore, so you can destroy shared resources. Please note that this method is never called if you don't wrap a filter with ReferenceCountingIoFilter.
        Throws:
        java.lang.Exception
      • onPreAdd

        void onPreAdd​(IoFilterChain parent,
                      java.lang.String name,
                      IoFilter.NextFilter nextFilter)
               throws java.lang.Exception
        Invoked before this filter is added to the specified parent. Please note that this method can be invoked more than once if this filter is added to more than one parents. This method is not invoked before init() is invoked.
        Parameters:
        parent - the parent who called this method
        name - the name assigned to this filter
        nextFilter - the IoFilter.NextFilter for this filter. You can reuse this object until this filter is removed from the chain.
        Throws:
        java.lang.Exception
      • onPostAdd

        void onPostAdd​(IoFilterChain parent,
                       java.lang.String name,
                       IoFilter.NextFilter nextFilter)
                throws java.lang.Exception
        Invoked after this filter is added to the specified parent. Please note that this method can be invoked more than once if this filter is added to more than one parents. This method is not invoked before init() is invoked.
        Parameters:
        parent - the parent who called this method
        name - the name assigned to this filter
        nextFilter - the IoFilter.NextFilter for this filter. You can reuse this object until this filter is removed from the chain.
        Throws:
        java.lang.Exception
      • onPreRemove

        void onPreRemove​(IoFilterChain parent,
                         java.lang.String name,
                         IoFilter.NextFilter nextFilter)
                  throws java.lang.Exception
        Invoked before this filter is removed from the specified parent. Please note that this method can be invoked more than once if this filter is removed from more than one parents. This method is always invoked before destroy() is invoked.
        Parameters:
        parent - the parent who called this method
        name - the name assigned to this filter
        nextFilter - the IoFilter.NextFilter for this filter. You can reuse this object until this filter is removed from the chain.
        Throws:
        java.lang.Exception
      • onPostRemove

        void onPostRemove​(IoFilterChain parent,
                          java.lang.String name,
                          IoFilter.NextFilter nextFilter)
                   throws java.lang.Exception
        Invoked after this filter is removed from the specified parent. Please note that this method can be invoked more than once if this filter is removed from more than one parents. This method is always invoked before destroy() is invoked.
        Parameters:
        parent - the parent who called this method
        name - the name assigned to this filter
        nextFilter - the IoFilter.NextFilter for this filter. You can reuse this object until this filter is removed from the chain.
        Throws:
        java.lang.Exception