Package org.glassfish.grizzly

Examples of org.glassfish.grizzly.Connection


   
    @Override
    public void exceptionOccurred(final FilterChainContext ctx,
            final Throwable error) {

        final Connection connection = ctx.getConnection();
        if (connection != null) {
            connection.closeSilently();
        }
    }
View Full Code Here


            return transportFilter.handleConnect(ctx);
        }

        @Override
        public NextAction handleRead(final FilterChainContext ctx) throws IOException {
            final Connection connection = ctx.getConnection();
            final SSLConnectionContext sslCtx =
                    obtainSslConnectionContext(connection);
           
            if (sslCtx.getSslEngine() == null) {
                final SSLEngine sslEngine = serverSSLEngineConfigurator.createSSLEngine();
View Full Code Here

        @Override
        public void onComplete(final Context context, final Object data) throws IOException {
            if (context.wasSuspended() || context.isManualIOEventControl()) {
                final IOEvent ioEvent = context.getIoEvent();
                final Connection connection = context.getConnection();
               
                if (AsyncQueue.EXPECTING_MORE_OPTION.equals(data)) {
                    connection.simulateIOEvent(ioEvent);
                } else {
                    connection.enableIOEvent(ioEvent);
                }
            }
        }
View Full Code Here

            }
        }

        private static void disableIOEvent(final Context context)
                throws IOException {
            final Connection connection = context.getConnection();
            final IOEvent ioEvent = context.getIoEvent();
            connection.disableIOEvent(ioEvent);
        }
View Full Code Here

    // ----------------------------------------------------- Methods from Filter

    @Override
    public NextAction handleWrite(final FilterChainContext ctx) throws IOException {
        final Connection connection = ctx.getConnection();

        if (ctx.getMessage() instanceof FileTransfer) {
            throw new IllegalStateException("TLS operations not supported with SendFile messages");
        }
View Full Code Here

     */
    private NextAction accurateWrite(final FilterChainContext ctx,
                                     final boolean isHandshakeComplete)
    throws IOException {

        final Connection connection = ctx.getConnection();
        SSLHandshakeContext handshakeContext =
                handshakeContextAttr.get(connection);

        if (isHandshakeComplete && handshakeContext == null) {
            return super.handleWrite(ctx);
View Full Code Here

        @Override
        public void onComplete(final Context context, final Object data)
                throws IOException {
           
            final IOEvent ioEvent = context.getIoEvent();
            final Connection connection = context.getConnection();
            if (AsyncQueue.EXPECTING_MORE_OPTION.equals(data)) {
                connection.simulateIOEvent(ioEvent);
            } else {
                connection.enableIOEvent(ioEvent);
            }
        }
View Full Code Here

     */
    private final class ConnectionCloseListener implements GenericCloseListener {
        @Override
        public void onClosed(final Closeable closeable, final CloseType type)
                throws IOException {
            final Connection connection = (Connection) closeable;
            final SSLHandshakeContext handshakeContext =
                    handshakeContextAttr.get(connection);
            if (handshakeContext != null) {
                handshakeContext.failed(new java.io.EOFException());
                handshakeContextAttr.remove(connection);
View Full Code Here

    public Future<SSLEngine> handshake(final SSLStreamReader sslStreamReader,
            final SSLEngineConfigurator configurator,
            final CompletionHandler<SSLEngine> completionHandler)
            throws IOException {

        final Connection connection = getConnection();

        SSLEngine sslEngine = SSLUtils.getSSLEngine(getConnection());

        if (sslEngine == null) {
            sslEngine = configurator.createSSLEngine();
View Full Code Here

                    } catch (ConcurrentModificationException ignored) {
                    }
                }

                for (final SelectionKey selectionKey : keys) {
                    final Connection connection =
                            transport.getSelectionKeyHandler().
                            getConnectionForKey(selectionKey);
                    connection.closeSilently();
                }
            } catch (ClosedSelectorException e) {
                // If Selector is already closed - OK
            } finally {
                try {
View Full Code Here

TOP

Related Classes of org.glassfish.grizzly.Connection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.