Package com.sun.grizzly

Examples of com.sun.grizzly.ProtocolChain


            private ConcurrentLinkedQueue<ProtocolChain>
                    protocolChains = new ConcurrentLinkedQueue<ProtocolChain>();
            @Override
            public ProtocolChain poll()
            {
                ProtocolChain pc = protocolChains.poll();
                if (pc == null)
                {
                    final GrizzlyEndPoint endPoint;
                    final HttpParser parser;                   
                    try
                    {
                        endPoint=new GrizzlyEndPoint(GrizzlyConnector.this,null);
                        parser=(HttpParser)((HttpConnection)endPoint.getHttpConnection()).getParser();
                    }
                    catch (IOException ex)
                    {
                        throw new RuntimeException(ex);
                    }
                   
                   
                    pc = new DefaultProtocolChain();
                    ReadFilter readFilter = new JettyReadFilter(parser);
                    pc.addFilter(readFilter);
                   
                    HttpProtocolFilter httpProtocolFilter
                            = new HttpProtocolFilter();
                    httpProtocolFilter.setParser(parser);
                    httpProtocolFilter.setEndPoint(endPoint);
                    pc.addFilter(httpProtocolFilter);
                }
                return pc;
            }
           
            /**
 
View Full Code Here


                    new HashMap<SipTransports, Pair<SelectorHandler, SelectorHandler>>());

            ctxs.put(ctx, pair);
            registerForMonitoring(sipBindingCtx.getId(), sipBindingCtx.getTargetTuples()[0]);
            if (sipBindingCtx.isEnabled()) {
                final ProtocolChain protocolChain = getProtocolChain();

                ProtocolChainInstanceHandler instanceHandler =
                        new SimpleProtocolChainInstanceHandler(protocolChain);

                serverController.setPipeline(serverPipeline);
View Full Code Here

                    if (logger.isLoggable(Level.FINEST)) {
                        logger.log(Level.FINEST,
                                "Initializing Reading UDP Selecor handler");
                    }

                    final ProtocolChain udpProtocolChain =
                            getUDPProtocolChain(sipBindingCtx);

                    ProtocolChainInstanceHandler udpInstanceHandler =
                            new SimpleProtocolChainInstanceHandler(udpProtocolChain);

                    selHdlPair.setLeft(startUDPServer(targetTuple,
                            udpInstanceHandler));

                    selHdlPair.setRight(startUDPClient(udpInstanceHandler));
                } else {
                    selHdlPair.setLeft(startUDPServer(targetTuple,
                            instanceHandler));

                    selHdlPair.setRight(startUDPClient(instanceHandler));
                }

                break;
            }

            case SipTransports.TCP: {
                selHdlPair.setLeft(startTCPServer(targetTuple, instanceHandler));

                selHdlPair.setRight(startTCPClient(instanceHandler));

                break;
            }

            case SipTransports.TLS: {
                final ProtocolChain tlsProtocolChain =
                        getTLSProtocolChain(sipBindingCtx);

                ProtocolChainInstanceHandler tlsInstanceHandler =
                        new SimpleProtocolChainInstanceHandler(tlsProtocolChain);
View Full Code Here

                        targetTuple.getProtocol().name(),
                        sipBindingCtx.getContext()
                    });
                }

                final ProtocolChain udpProtocolChain = getProtocolChain();

                ProtocolChainInstanceHandler instanceHandler =
                        new SimpleProtocolChainInstanceHandler(udpProtocolChain);

                Pair<SelectorHandler, SelectorHandler> selHdlPair =
View Full Code Here

                    logger.log(Level.FINE,
                            "sip.network.grizzly.update.sslcontext",
                            ((SimpleProtocolChainInstanceHandler) serverTlsSH.getProtocolChainInstanceHandler()).getProtocolChain());
                }

                ProtocolChain protocolChain =
                        ((SimpleProtocolChainInstanceHandler) serverTlsSH.getProtocolChainInstanceHandler()).getProtocolChain();

                updateTLSProtocolChain(protocolChain, sipBindingCtx);
            }
        }
View Full Code Here

                    if (selHdlPair != null) { //disable can cause the pair to be absent.                     
                        shutdownAndRemoveSelectorHandlers(newTT.getProtocol(),
                                selHdlPair.getLeft(), selHdlPair.getRight());

                        //Add
                        final ProtocolChain udpProtocolChain =
                                getProtocolChain();

                        ProtocolChainInstanceHandler instanceHandler =
                                new SimpleProtocolChainInstanceHandler(udpProtocolChain);

                        startSelectorHandlers(newTT, selHdlPair,
                                instanceHandler, sipBindingCtx);
                    }

                    oldTTs.remove(oldTT);
                } else {
                //okidoki

                //Check updateSSL, there the SSL changes are taken into

                //account.
                }
            } else {
                //Add it
                if (logger.isLoggable(Level.FINE)) {
                    logger.log(Level.FINE, "sip.network.grizzly.update.tt",
                            new Object[]{
                        newTT.getProtocol().name(),
                        sipBindingCtx.getContext()
                    });
                }

                final ProtocolChain udpProtocolChain = getProtocolChain();

                ProtocolChainInstanceHandler instanceHandler =
                        new SimpleProtocolChainInstanceHandler(udpProtocolChain);

                Pair<SelectorHandler, SelectorHandler> selHdlPair =
View Full Code Here

        SSLReadFilter sslReadFilter = getSSLReadFilter(sipBindingCtx);

        //Carefull dynamic reconfig update of SSL relies on the sslReadFilter

        //to be the first filter in the chain.
        ProtocolChain tlsProtocolChain = new DefaultProtocolChain();

        tlsProtocolChain.addFilter(sslReadFilter);

        tlsProtocolChain.addFilter(createMessageProcessorFilter(false,
                tlsAsyncWriteCallbackHandler));

        return tlsProtocolChain;
    }
View Full Code Here

            private ConcurrentLinkedQueue<ProtocolChain>
                    protocolChains = new ConcurrentLinkedQueue<ProtocolChain>();
            @Override
            public ProtocolChain poll()
            {
                ProtocolChain pc = protocolChains.poll();
                if (pc == null)
                {
                    final GrizzlyEndPoint endPoint;
                    final HttpParser parser;                   
                    try
                    {
                        endPoint=new GrizzlyEndPoint(GrizzlyConnector.this,null);
                        parser=(HttpParser)((HttpConnection)endPoint.getHttpConnection()).getParser();
                    }
                    catch (IOException ex)
                    {
                        throw new RuntimeException(ex);
                    }
                   
                   
                    pc = new DefaultProtocolChain();
                    ReadFilter readFilter = new JettyReadFilter(parser);
                    pc.addFilter(readFilter);
                   
                    HttpProtocolFilter httpProtocolFilter
                            = new HttpProtocolFilter();
                    httpProtocolFilter.setParser(parser);
                    httpProtocolFilter.setEndPoint(endPoint);
                    pc.addFilter(httpProtocolFilter);
                }
                return pc;
            }
           
            /**
 
View Full Code Here

            /**
             * Always return instance of ProtocolChain.
             */
            @Override
            public ProtocolChain poll() {
                ProtocolChain protocolChain = chains.poll();
                if (protocolChain == null) {
                    protocolChain = new HttpProtocolChain();
                    configureFilters(protocolChain);
                }
                return protocolChain;
View Full Code Here

TOP

Related Classes of com.sun.grizzly.ProtocolChain

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.