Interface GridNioFilter

    • Method Detail

      • start

        void start()
        Beginning of a filter lifecycle, invoked on server start. It is guaranteed that this method will be invoked prior to any of the event-related methods.
      • stop

        void stop()
        End of a filter lifecycle, invoked on server stop. It is guaranteed that this method will be invoked after all events are processed, no more event-related methods will be invoked after this method called.
      • nextFilter

        GridNioFilter nextFilter()
        Gets next filter in filter chain.
        Returns:
        Next filter (in order from application to network layer).
      • previousFilter

        GridNioFilter previousFilter()
        Gets previous filter in filter chain.
        Returns:
        Previous filter (in order from application to network layer).
      • nextFilter

        void nextFilter​(GridNioFilter filter)
        Sets next filter in filter chain. In filter chain next filter would be more close to the network layer.
        Parameters:
        filter - Next filter in filter chain.
      • previousFilter

        void previousFilter​(GridNioFilter filter)
        Sets previous filter in filter chain. In filter chain previous filter would be more close to application layer.
        Parameters:
        filter - Previous filter in filter chain.
      • proceedSessionOpened

        void proceedSessionOpened​(GridNioSession ses)
                           throws IgniteCheckedException
        Forwards session opened event to the next logical filter in filter chain.
        Parameters:
        ses - Opened session.
        Throws:
        IgniteCheckedException - If filter is not in chain or GridNioException occurred in the underlying filter.
      • proceedSessionClosed

        void proceedSessionClosed​(GridNioSession ses)
                           throws IgniteCheckedException
        Forwards session closed event to the next logical filter in filter chain.
        Parameters:
        ses - Closed session.
        Throws:
        IgniteCheckedException - If filter is not in chain or GridNioException occurred in the underlying filter.
      • proceedMessageReceived

        void proceedMessageReceived​(GridNioSession ses,
                                    Object msg)
                             throws IgniteCheckedException
        Forwards received message to the next logical filter in filter chain.
        Parameters:
        ses - Session instance.
        msg - Received message.
        Throws:
        IgniteCheckedException - If filter is not in chain or GridNioException occurred in the underlying filter.
      • proceedSessionWrite

        GridNioFuture<?> proceedSessionWrite​(GridNioSession ses,
                                             Object msg,
                                             boolean fut,
                                             IgniteInClosure<IgniteException> ackC)
                                      throws IgniteCheckedException
        Forwards write request to the next logical filter in filter chain.
        Parameters:
        ses - Session instance.
        msg - Message to send.
        fut - True if write future should be created.
        ackC - Closure invoked when message ACK is received.
        Returns:
        Write future or null.
        Throws:
        IgniteCheckedException - If filter is not in chain or GridNioException occurred in the underlying filter.
      • onSessionIdleTimeout

        void onSessionIdleTimeout​(GridNioSession ses)
                           throws IgniteCheckedException
        Called when session is idle for longer time that is allowed by NIO server.
        Parameters:
        ses - Session that is idle.
        Throws:
        IgniteCheckedException - If filter is not in chain or GridNioException occurred in the underlying filter.
      • proceedSessionIdleTimeout

        void proceedSessionIdleTimeout​(GridNioSession ses)
                                throws IgniteCheckedException
        Forwards session idle notification to the next logical filter in filter chain.
        Parameters:
        ses - Session instance.
        Throws:
        IgniteCheckedException - If filter is not in chain or GridNioException occurred in the underlying filter.
      • onSessionWriteTimeout

        void onSessionWriteTimeout​(GridNioSession ses)
                            throws IgniteCheckedException
        Called when session has not empty write buffer that has not been fully flushed during max timeout allowed by NIO server.
        Parameters:
        ses - Session that has timed out writes.
        Throws:
        IgniteCheckedException - If filter is not in chain or GridNioException occurred in the underlying filter.
      • proceedSessionWriteTimeout

        void proceedSessionWriteTimeout​(GridNioSession ses)
                                 throws IgniteCheckedException
        Forwards session write timeout notification to the next logical filter in filter chain.
        Parameters:
        ses - Session instance.
        Throws:
        IgniteCheckedException - If filter is not in chain or GridNioException occurred in the underlying filter.