Package org.apache.qpid.protocol

Examples of org.apache.qpid.protocol.ProtocolEngine


                        final Integer receiveBufferSize = _config.getReceiveBufferSize();

                        socket.setSendBufferSize(sendBufferSize);
                        socket.setReceiveBufferSize(receiveBufferSize);

                        ProtocolEngine engine = _factory.newProtocolEngine();

                        final IdleTimeoutTicker ticker = new IdleTimeoutTicker(engine, TIMEOUT);
                        NetworkConnection connection = new IoNetworkConnection(socket, engine, sendBufferSize, receiveBufferSize, _timeout,
                                                                               ticker);

                        connection.setMaxReadIdle(HANSHAKE_TIMEOUT);

                        ticker.setConnection(connection);

                        if(_sslContext != null && socket instanceof SSLSocket)
                        {
                            try
                            {
                                Principal peerPrincipal = ((SSLSocket) socket).getSession().getPeerPrincipal();
                                connection.setPeerPrincipal(peerPrincipal);
                            }
                            catch(SSLPeerUnverifiedException e)
                            {
                                // ignore
                            }
                        }

                        engine.setNetworkConnection(connection, connection.getSender());

                        connection.start();
                    }
                    catch(RuntimeException e)
                    {
View Full Code Here


                        socket.setSendBufferSize(sendBufferSize);
                        socket.setReceiveBufferSize(receiveBufferSize);


                        ProtocolEngine engine = _factory.newProtocolEngine();

                        NetworkConnection connection = new IoNetworkConnection(socket, engine, sendBufferSize, receiveBufferSize, TIMEOUT);

                        if(_sslContext != null)
                        {
                            try
                            {
                                Principal peerPrincipal = ((SSLSocket) socket).getSession().getPeerPrincipal();
                                connection.setPeerPrincipal(peerPrincipal);
                            }
                            catch(SSLPeerUnverifiedException e)
                            {
                                // ignore
                            }
                        }

                        engine.setNetworkConnection(connection, connection.getSender());

                        connection.start();
                    }
                    catch(RuntimeException e)
                    {
View Full Code Here

                _header.flip();
                byte[] headerBytes = new byte[MINIMUM_REQUIRED_HEADER_BYTES];
                _header.get(headerBytes);


                ProtocolEngine newDelegate = null;
                byte[] newestSupported = null;

                for(int i = 0; newDelegate == null && i < _creators.length; i++)
                {

                    if(_supported.contains(_creators[i].getVersion()))
                    {
                        newestSupported = _creators[i].getHeaderIdentifier();
                        byte[] compareBytes = _creators[i].getHeaderIdentifier();
                        boolean equal = true;
                        for(int j = 0; equal && j<compareBytes.length; j++)
                        {
                            equal = headerBytes[j] == compareBytes[j];
                        }
                        if(equal)
                        {
                            newDelegate = _creators[i].getProtocolEngine();
                        }
                    }
                }

                // If no delegate is found then send back the most recent support protocol version id
                if(newDelegate == null)
                {
                    _networkDriver.send(ByteBuffer.wrap(newestSupported));

                    _delegate = new ClosedDelegateProtocolEngine();
                }
                else
                {
                    newDelegate.setNetworkDriver(_networkDriver);

                    _delegate = newDelegate;

                    _header.flip();
                    _delegate.received(_header);
View Full Code Here

        }

        if (_acceptingConnections)
        {
            // Set up the protocol engine
            ProtocolEngine protocolEngine = _factory.newProtocolEngine(this);
            MINANetworkDriver newDriver = new MINANetworkDriver(_useNIO, _processors, _executorPool, _protectIO, protocolEngine, protocolSession);
            protocolEngine.setNetworkDriver(newDriver);
        }
    }
View Full Code Here

        }

        if (_acceptingConnections)
        {
            // Set up the protocol engine
            ProtocolEngine protocolEngine = _factory.newProtocolEngine(this);
            MINANetworkDriver newDriver = new MINANetworkDriver(_useNIO, _processors, _executorPool, _protectIO, protocolEngine, protocolSession);
            protocolEngine.setNetworkDriver(newDriver);
        }
    }
View Full Code Here

                _header.flip();
                byte[] headerBytes = new byte[MINIMUM_REQUIRED_HEADER_BYTES];
                _header.get(headerBytes);


                ProtocolEngine newDelegate = null;
                byte[] newestSupported = null;

                for(int i = 0; newDelegate == null && i < _creators.length; i++)
                {

                    if(_supported.contains(_creators[i].getVersion()))
                    {
                        newestSupported = _creators[i].getHeaderIdentifier();
                        byte[] compareBytes = _creators[i].getHeaderIdentifier();
                        boolean equal = true;
                        for(int j = 0; equal && j<compareBytes.length; j++)
                        {
                            equal = headerBytes[j] == compareBytes[j];
                        }
                        if(equal)
                        {
                            newDelegate = _creators[i].getProtocolEngine();
                        }
                    }
                }

                // If no delegate is found then send back the most recent support protocol version id
                if(newDelegate == null)
                {
                    _networkDriver.send(ByteBuffer.wrap(newestSupported));

                    _delegate = new ClosedDelegateProtocolEngine();
                }
                else
                {
                    newDelegate.setNetworkDriver(_networkDriver);

                    _delegate = newDelegate;

                    _header.flip();
                    _delegate.received(_header);
View Full Code Here

                        final Integer receiveBufferSize = _config.getReceiveBufferSize();

                        socket.setSendBufferSize(sendBufferSize);
                        socket.setReceiveBufferSize(receiveBufferSize);

                        ProtocolEngine engine = _factory.newProtocolEngine();

                        NetworkConnection connection = new IoNetworkConnection(socket, engine, sendBufferSize, receiveBufferSize, _timeout);


                        engine.setNetworkConnection(connection, connection.getSender());

                        connection.start();


                    }
View Full Code Here

                        final Integer receiveBufferSize = _config.getReceiveBufferSize();

                        socket.setSendBufferSize(sendBufferSize);
                        socket.setReceiveBufferSize(receiveBufferSize);

                        ProtocolEngine engine = _factory.newProtocolEngine();

                        final IdleTimeoutTicker ticker = new IdleTimeoutTicker(engine, TIMEOUT);
                        NetworkConnection connection = new IoNetworkConnection(socket, engine, sendBufferSize, receiveBufferSize, _timeout,
                                                                               ticker);
                        ticker.setConnection(connection);

                        if(_sslContext != null)
                        {
                            try
                            {
                                Principal peerPrincipal = ((SSLSocket) socket).getSession().getPeerPrincipal();
                                connection.setPeerPrincipal(peerPrincipal);
                            }
                            catch(SSLPeerUnverifiedException e)
                            {
                                // ignore
                            }
                        }

                        engine.setNetworkConnection(connection, connection.getSender());

                        connection.start();
                    }
                    catch(RuntimeException e)
                    {
View Full Code Here

                        final Integer receiveBufferSize = _config.getReceiveBufferSize();

                        socket.setSendBufferSize(sendBufferSize);
                        socket.setReceiveBufferSize(receiveBufferSize);

                        ProtocolEngine engine = _factory.newProtocolEngine();

                        final IdleTimeoutTicker ticker = new IdleTimeoutTicker(engine, TIMEOUT);
                        NetworkConnection connection = new IoNetworkConnection(socket, engine, sendBufferSize, receiveBufferSize, _timeout,
                                                                               ticker);

                        connection.setMaxReadIdle(HANSHAKE_TIMEOUT);

                        ticker.setConnection(connection);

                        engine.setNetworkConnection(connection, connection.getSender());

                        connection.start();
                    }
                    catch(RuntimeException e)
                    {
View Full Code Here

                        final Integer receiveBufferSize = _config.getReceiveBufferSize();

                        socket.setSendBufferSize(sendBufferSize);
                        socket.setReceiveBufferSize(receiveBufferSize);

                        ProtocolEngine engine = _factory.newProtocolEngine();

                        final IdleTimeoutTicker ticker = new IdleTimeoutTicker(engine, TIMEOUT);
                        NetworkConnection connection = new IoNetworkConnection(socket, engine, sendBufferSize, receiveBufferSize, _timeout,
                                                                               ticker);
                        ticker.setConnection(connection);

                        if(_sslContext != null)
                        {
                            try
                            {
                                Principal peerPrincipal = ((SSLSocket) socket).getSession().getPeerPrincipal();
                                connection.setPeerPrincipal(peerPrincipal);
                            }
                            catch(SSLPeerUnverifiedException e)
                            {
                                // ignore
                            }
                        }

                        engine.setNetworkConnection(connection, connection.getSender());

                        connection.start();
                    }
                    catch(RuntimeException e)
                    {
View Full Code Here

TOP

Related Classes of org.apache.qpid.protocol.ProtocolEngine

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.