Examples of ProxyIoSession


Examples of org.apache.mina.proxy.session.ProxyIoSession

     */
    private void reconnect(final NextFilter nextFilter,
            final HttpProxyRequest request) {
        LOGGER.debug("Reconnecting to proxy ...");

        final ProxyIoSession proxyIoSession = getProxyIoSession();

        // Fires reconnection
        proxyIoSession.getConnector().connect(
                new IoSessionInitializer<ConnectFuture>() {
                    public void initializeSession(final IoSession session,
                            ConnectFuture future) {
                        LOGGER.debug("Initializing new session: {}", session);
                        session.setAttribute(ProxyIoSession.PROXY_SESSION,
                                proxyIoSession);
                        proxyIoSession.setSession(session);
                        LOGGER.debug("  setting up proxyIoSession: {}", proxyIoSession);
                        future
                                .addListener(new IoFutureListener<ConnectFuture>() {
                                    public void operationComplete(
                                            ConnectFuture future) {
                                        // Reconnection is done so we send the
                                        // request to the proxy
                                        proxyIoSession
                                                .setReconnectionNeeded(false);
                                        writeRequest0(nextFilter, request);
                                    }
                                });
                    }
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.