Package org.apache.qpid.protocol

Examples of org.apache.qpid.protocol.ProtocolEngine


                _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));

                    newDelegate = 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(!(principalHolder instanceof ProtocolEngine))
        {
            return AuthzResult.ABSTAIN; // We only deal with tcp sessions
        }

        ProtocolEngine session = (ProtocolEngine) principalHolder;

        SocketAddress sockAddr = session.getRemoteAddress();
        if (!(sockAddr instanceof InetSocketAddress))
        {
            return AuthzResult.ABSTAIN; // We only deal with tcp sessions
        }
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

                        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();
                    }
                    catch(RuntimeException e)
                    {
View Full Code Here

                    Socket socket = null;
                    try
                    {
                        socket = _serverSocket.accept();

                        ProtocolEngine engine = _factory.newProtocolEngine(socket.getRemoteSocketAddress());

                        if(engine != null)
                        {
                            socket.setTcpNoDelay(_config.getTcpNoDelay());
                            socket.setSoTimeout(1000 * HANSHAKE_TIMEOUT);

                            final Integer sendBufferSize = _config.getSendBufferSize();
                            final Integer receiveBufferSize = _config.getReceiveBufferSize();

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


                            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();
                        }
                        else
                        {
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.