Search in sources :

Example 6 with Connection

use of org.glassfish.grizzly.Connection in project Payara by payara.

the class WSTCPProtocolFilter method handleClose.

@Override
public NextAction handleClose(final FilterChainContext ctx) throws IOException {
    final Connection connection = ctx.getConnection();
    final SelectionKey selectionKey = ((NIOConnection) connection).getSelectionKey();
    try {
        if (connector != null) {
            connector.notifyConnectionClosed((SocketChannel) selectionKey.channel());
        } else {
            synchronized (sync) {
                if (connector != null) {
                    connector.notifyConnectionClosed((SocketChannel) selectionKey.channel());
                }
            }
        }
    } catch (Exception e) {
    }
    return ctx.getInvokeAction();
}
Also used : SelectionKey(java.nio.channels.SelectionKey) Connection(org.glassfish.grizzly.Connection) NIOConnection(org.glassfish.grizzly.nio.NIOConnection) IOException(java.io.IOException) NIOConnection(org.glassfish.grizzly.nio.NIOConnection)

Aggregations

Connection (org.glassfish.grizzly.Connection)6 IOException (java.io.IOException)2 Buffer (org.glassfish.grizzly.Buffer)2 GrizzlyProxy (com.sun.enterprise.v3.services.impl.GrizzlyProxy)1 URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1 SelectionKey (java.nio.channels.SelectionKey)1 SSLEngine (javax.net.ssl.SSLEngine)1 LifecycleException (org.apache.catalina.LifecycleException)1 GlassFishException (org.glassfish.embeddable.GlassFishException)1 ConfigException (org.glassfish.embeddable.web.ConfigException)1 ConnectionProbe (org.glassfish.grizzly.ConnectionProbe)1 EmptyCompletionHandler (org.glassfish.grizzly.EmptyCompletionHandler)1 GenericGrizzlyListener (org.glassfish.grizzly.config.GenericGrizzlyListener)1 NetworkListener (org.glassfish.grizzly.config.dom.NetworkListener)1 ProtocolFilter (org.glassfish.grizzly.config.dom.ProtocolFilter)1 HttpRedirectFilter (org.glassfish.grizzly.config.portunif.HttpRedirectFilter)1 Filter (org.glassfish.grizzly.filterchain.Filter)1 TransportFilter (org.glassfish.grizzly.filterchain.TransportFilter)1 HttpCodecFilter (org.glassfish.grizzly.http.HttpCodecFilter)1