Examples of HttpServerConnection


Examples of io.undertow.server.HttpServerConnection

    }

    @Override
    public AuthenticationMechanismOutcome authenticate(final HttpServerExchange exchange,
                                                       final SecurityContext securityContext) {
        HttpServerConnection connection = exchange.getConnection();
        NegotiationContext negContext = connection.getAttachment(NegotiationContext.ATTACHMENT_KEY);
        if (negContext != null) {
            exchange.putAttachment(NegotiationContext.ATTACHMENT_KEY, negContext);
            if (negContext.isEstablished()) {
                IdentityManager identityManager = securityContext.getIdentityManager();
                final Account account = identityManager.verify(new GSSContextCredential(negContext.getGssContext()));
View Full Code Here

Examples of io.undertow.server.HttpServerConnection

        @Override
        public void exchangeEvent(final HttpServerExchange exchange, final NextListener nextListener) {
            //if we ever fail to read then we flush the pipeline buffer
            //this relies on us always doing an eager read when starting a request,
            //rather than waiting to be notified of data being available
            final HttpServerConnection connection = exchange.getConnection();
            if (connection.getExtraBytes() == null || exchange.isUpgrade()) {
                performFlush(nextListener, connection);
            } else {
                nextListener.proceed();
            }
        }
View Full Code Here

Examples of io.undertow.server.HttpServerConnection

    public void handleEvent(final StreamConnection channel) {
        if (UndertowLogger.REQUEST_LOGGER.isTraceEnabled()) {
            UndertowLogger.REQUEST_LOGGER.tracef("Opened connection with %s", channel.getPeerAddress());
        }

        HttpServerConnection connection = new HttpServerConnection(channel, bufferPool, rootHandler, undertowOptions, bufferSize);
        AjpReadListener readListener = new AjpReadListener(connection, scheme);
        readListener.startRequest();
        channel.getSourceChannel().setReadListener(readListener);
        readListener.handleEvent(channel.getSourceChannel());
    }
View Full Code Here

Examples of io.undertow.server.HttpServerConnection

            exchange.putAttachment(THROWABLE, exception);
            exchange.dispatch(SameThreadExecutor.INSTANCE, next);
        }

        public void handleDone(final HttpClientConnection connection, final HttpServerExchange exchange) {
            final HttpServerConnection serverConnection = exchange.getConnection();
            final SimpleProxyClient simpleProxyClient = new SimpleProxyClient(connection);
            //we attach to the connection so it can be re-used
            serverConnection.putAttachment(clientAttachmentKey, simpleProxyClient);
            exchange.putAttachment(CLIENT, simpleProxyClient);
            serverConnection.addCloseListener(new HttpServerConnection.CloseListener() {
                @Override
                public void closed(HttpServerConnection connection) {
                    IoUtils.safeClose(serverConnection);
                }
            });
View Full Code Here

Examples of io.undertow.server.HttpServerConnection

        this.client = client;
        this.destination = destination;
    }

    public void handleRequest(final HttpServerExchange exchange) {
        final HttpServerConnection serverConnection = exchange.getConnection();
        final HttpClientConnection clientConnection = serverConnection.getAttachment(proxyConnection);
        if (clientConnection == null) {
            exchange.dispatch(SameThreadExecutor.INSTANCE, new Runnable() {
                @Override
                public void run() {
                    client.connect(exchange.getIoThread(), destination, OptionMap.EMPTY).addNotifier(notifier, exchange);
View Full Code Here

Examples of io.undertow.server.HttpServerConnection

    }

    @Override
    public void dispatchMockRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException {

        HttpServerConnection connection = new HttpServerConnection(null,new ByteBufferSlicePool(BufferAllocator.BYTE_BUFFER_ALLOCATOR, 1024, 1024), next, OptionMap.EMPTY, 1024);
        HttpServerExchange exchange = new HttpServerExchange(connection);
        exchange.setRequestScheme(request.getScheme());
        exchange.setRequestMethod(new HttpString(request.getMethod()));
        exchange.setProtocol(Protocols.HTTP_1_0);
        exchange.setResolvedPath(request.getContextPath());
View Full Code Here

Examples of io.undertow.server.HttpServerConnection

    }

    @Override
    public void dispatchMockRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException {

        HttpServerConnection connection = new HttpServerConnection(null,new ByteBufferSlicePool(BufferAllocator.BYTE_BUFFER_ALLOCATOR, 1024, 1024), next, OptionMap.EMPTY, 1024);
        HttpServerExchange exchange = new HttpServerExchange(connection);
        exchange.setRequestScheme(request.getScheme());
        exchange.setRequestMethod(new HttpString(request.getMethod()));
        exchange.setProtocol(Protocols.HTTP_1_0);
        exchange.setResolvedPath(request.getContextPath());
View Full Code Here

Examples of io.undertow.server.protocol.http.HttpServerConnection

            if (exchange.isUpgrade()) {
                exchange.upgradeChannel(new ExchangeCompletionListener() {
                    @Override
                    public void exchangeEvent(final HttpServerExchange exchange, final NextListener nextListener) {
                        StreamConnection clientChannel = null;
                        final HttpServerConnection connection = (HttpServerConnection) exchange.getConnection();
                        try {
                            clientChannel = result.getConnection().performUpgrade();
                            connection.resetChannel();

                            StreamConnection streamConnection = connection.getChannel();
                            if (connection.getExtraBytes() != null) {
                                streamConnection.getSourceChannel().setConduit(new ReadDataStreamSourceConduit(streamConnection.getSourceChannel().getConduit(), connection));
                            }
                            ChannelListeners.initiateTransfer(Long.MAX_VALUE, clientChannel.getSourceChannel(), streamConnection.getSinkChannel(), ChannelListeners.closingChannelListener(), ChannelListeners.<StreamSinkChannel>writeShutdownChannelListener(ChannelListeners.<StreamSinkChannel>flushingChannelListener(ChannelListeners.closingChannelListener(), ChannelListeners.closingChannelExceptionHandler()), ChannelListeners.closingChannelExceptionHandler()), ChannelListeners.closingChannelExceptionHandler(), ChannelListeners.closingChannelExceptionHandler(), connection.getBufferPool());
                            ChannelListeners.initiateTransfer(Long.MAX_VALUE, streamConnection.getSourceChannel(), clientChannel.getSinkChannel(), ChannelListeners.closingChannelListener(), ChannelListeners.<StreamSinkChannel>writeShutdownChannelListener(ChannelListeners.<StreamSinkChannel>flushingChannelListener(ChannelListeners.closingChannelListener(), ChannelListeners.closingChannelExceptionHandler()), ChannelListeners.closingChannelExceptionHandler()), ChannelListeners.closingChannelExceptionHandler(), ChannelListeners.closingChannelExceptionHandler(), connection.getBufferPool());
                            nextListener.proceed();
                        } catch (IOException e) {
                            IoUtils.safeClose(connection.getChannel());
                        }
                    }
                });
            }
            IoExceptionHandler handler = new IoExceptionHandler(exchange, result.getConnection());
View Full Code Here

Examples of org.apache.harmony.rmi.transport.proxy.HttpServerConnection

    private ServerConnection startConnection(Socket s)
            throws IOException {
        ServerConnection conn;

        if (s instanceof HttpInboundSocket) {
            conn = new HttpServerConnection(s, this);
        } else {
            conn = new TcpServerConnection(s, this);
        }
        conns.add(conn);
View Full Code Here

Examples of org.apache.harmony.rmi.transport.proxy.HttpServerConnection

    private ServerConnection startConnection(Socket s)
            throws IOException {
        ServerConnection conn;

        if (s instanceof HttpInboundSocket) {
            conn = new HttpServerConnection(s, this);
        } else {
            conn = new TcpServerConnection(s, this);
        }
        conns.add(conn);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.