Class WebSocketAdapterFilter

  • All Implemented Interfaces:
    org.glassfish.grizzly.filterchain.Filter

    public class WebSocketAdapterFilter
    extends org.glassfish.grizzly.filterchain.BaseFilter
    Top-level filter in the Grizzly filter chain.

    For the downstream flow (handleWrite(FilterChainContext)), it first initiates the HTTP handshake, and on subsequent messages, it just forwards them unchanged (web-socket protocol).

    For upstream flow (handleRead(FilterChainContext)), it simply writes the received message to the servlet connection (in the direction of the web-socket client).

    It reacts to a successful handshake event, by upgrading the associate servlet connection.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.glassfish.grizzly.filterchain.NextAction handleEvent​(org.glassfish.grizzly.filterchain.FilterChainContext ctx, org.glassfish.grizzly.filterchain.FilterChainEvent event)  
      org.glassfish.grizzly.filterchain.NextAction handleRead​(org.glassfish.grizzly.filterchain.FilterChainContext ctx)  
      org.glassfish.grizzly.filterchain.NextAction handleWrite​(org.glassfish.grizzly.filterchain.FilterChainContext ctx)  
      • Methods inherited from class org.glassfish.grizzly.filterchain.BaseFilter

        createContext, exceptionOccurred, handleAccept, handleClose, handleConnect, onAdded, onFilterChainChanged, onRemoved, toString
    • Constructor Detail

      • WebSocketAdapterFilter

        public WebSocketAdapterFilter()
    • Method Detail

      • handleRead

        public org.glassfish.grizzly.filterchain.NextAction handleRead​(org.glassfish.grizzly.filterchain.FilterChainContext ctx)
                                                                throws IOException
        Specified by:
        handleRead in interface org.glassfish.grizzly.filterchain.Filter
        Overrides:
        handleRead in class org.glassfish.grizzly.filterchain.BaseFilter
        Throws:
        IOException
      • handleWrite

        public org.glassfish.grizzly.filterchain.NextAction handleWrite​(org.glassfish.grizzly.filterchain.FilterChainContext ctx)
        Specified by:
        handleWrite in interface org.glassfish.grizzly.filterchain.Filter
        Overrides:
        handleWrite in class org.glassfish.grizzly.filterchain.BaseFilter
      • handleEvent

        public org.glassfish.grizzly.filterchain.NextAction handleEvent​(org.glassfish.grizzly.filterchain.FilterChainContext ctx,
                                                                        org.glassfish.grizzly.filterchain.FilterChainEvent event)
                                                                 throws IOException
        Specified by:
        handleEvent in interface org.glassfish.grizzly.filterchain.Filter
        Overrides:
        handleEvent in class org.glassfish.grizzly.filterchain.BaseFilter
        Throws:
        IOException