Examples of AMQStateManager

  • org.apache.qpid.server.protocol.v0_8.state.AMQStateManager
    The state manager is responsible for managing the state of the protocol session.

    For each AMQProtocolHandler there is a separate state manager.

  • org.apache.qpid.server.state.AMQStateManager
    The state manager is responsible for managing the state of the protocol session.

    For each AMQProtocolHandler there is a separate state manager.


  • Examples of org.apache.qpid.client.state.AMQStateManager

         */
        public AMQProtocolHandler(AMQConnection con)
        {
            _connection = con;
            _protocolSession = new AMQProtocolSession(this, _connection);
            _stateManager = new AMQStateManager(_protocolSession);
            _codecFactory = new AMQCodecFactory(false, _protocolSession);
            _readJob = new Job(_poolReference, Job.MAX_JOB_EVENTS, true);
            _writeJob = new Job(_poolReference, Job.MAX_JOB_EVENTS, false);
            _poolReference.acquireExecutorService();
            _failoverHandler = new FailoverHandler(this);
    View Full Code Here

    Examples of org.apache.qpid.client.state.AMQStateManager

                // We switch in a new state manager temporarily so that the interaction to get to the "connection open"
                // state works, without us having to terminate any existing "state waiters". We could theoretically
                // have a state waiter waiting until the connection is closed for some reason. Or in future we may have
                // a slightly more complex state model therefore I felt it was worthwhile doing this.
                AMQStateManager existingStateManager = _amqProtocolHandler.getStateManager();
                _amqProtocolHandler.setStateManager(new AMQStateManager(_amqProtocolHandler.getProtocolSession()));
                if (!_amqProtocolHandler.getConnection().firePreFailover(_host != null))
                {
                    _logger.info("Failover process veto-ed by client");

                    _amqProtocolHandler.setStateManager(existingStateManager);

                    //todo: ritchiem these exceptions are useless... Would be better to attempt to propogate exception that
                    // prompted the failover event.
                    if (_host != null)
                    {
                        _amqProtocolHandler.getConnection().exceptionReceived(new AMQDisconnectedException(
                                "Redirect was vetoed by client"));
                    }
                    else
                    {
                        _amqProtocolHandler.getConnection().exceptionReceived(new AMQDisconnectedException(
                                "Failover was vetoed by client"));
                    }

                    _amqProtocolHandler.getFailoverLatch().countDown();
                    _amqProtocolHandler.setFailoverLatch(null);

                    return;
                }

                _logger.info("Starting failover process");

                boolean failoverSucceeded;
                // when host is non null we have a specified failover host otherwise we all the client to cycle through
                // all specified hosts

                // if _host has value then we are performing a redirect.
                if (_host != null)
                {
                    failoverSucceeded = _amqProtocolHandler.getConnection().attemptReconnection(_host, _port);
                }
                else
                {
                    failoverSucceeded = _amqProtocolHandler.getConnection().attemptReconnection();
                }

                if (!failoverSucceeded)
                {
                    _amqProtocolHandler.setStateManager(existingStateManager);
                    _amqProtocolHandler.getConnection().exceptionReceived(new AMQDisconnectedException(
                            "Server closed connection and no failover " + "was successful"));
                }
                else
                {
                    existingStateManager.setProtocolSession(_amqProtocolHandler.getProtocolSession());               
                    _amqProtocolHandler.setStateManager(existingStateManager);
                    try
                    {
                        if (_amqProtocolHandler.getConnection().firePreResubscribe())
                        {
    View Full Code Here

    Examples of org.apache.qpid.client.state.AMQStateManager

        private final AMQConnection _connection;
        private static final int FAST_CHANNEL_ACCESS_MASK = 0xFFFFFFF0;

        public AMQProtocolSession(AMQProtocolHandler protocolHandler, IoSession protocolSession, AMQConnection connection)
        {
            this(protocolHandler, protocolSession, connection, new AMQStateManager());

        }
    View Full Code Here

    Examples of org.apache.qpid.client.state.AMQStateManager

                    lastException = e;

                    //We need to change protocol handler here as an error during the connect will not
                    // cause the StateManager to be replaced. So the state is out of sync on reconnect
                    // This can be seen when a exception occurs during connection. i.e. log4j NoSuchMethod. (using < 1.2.12)
                    _protocolHandler.setStateManager(new AMQStateManager());

                    if (_logger.isInfoEnabled())
                    {
                        _logger.info("Unable to connect to broker at " + _failoverPolicy.getCurrentBrokerDetails(),
                                     e.getCause());
    View Full Code Here

    Examples of org.apache.qpid.server.protocol.v0_8.state.AMQStateManager

            _broker = broker;
            _port = port;
            _transport = transport;
            _maxNoOfChannels = (Integer)broker.getAttribute(Broker.CONNECTION_SESSION_COUNT_LIMIT);
            _receivedLock = new ReentrantLock();
            _stateManager = new AMQStateManager(broker, this);
            _codecFactory = new AMQCodecFactory(true, this);

            setNetworkConnection(network);
            _connectionID = connectionId;
    View Full Code Here

    Examples of org.apache.qpid.server.protocol.v0_8.state.AMQStateManager

            _broker = broker;
            _port = port;
            _transport = transport;
            _maxNoOfChannels = (Integer)broker.getAttribute(Broker.CONNECTION_SESSION_COUNT_LIMIT);
            _receivedLock = new ReentrantLock();
            _stateManager = new AMQStateManager(broker, this);
            _codecFactory = new AMQCodecFactory(true, this);

            setNetworkConnection(network);
            _connectionID = connectionId;
    View Full Code Here

    Examples of org.apache.qpid.server.protocol.v0_8.state.AMQStateManager

            _broker = broker;
            _port = port;
            _transport = transport;
            _maxNoOfChannels = (Integer)broker.getAttribute(Broker.CONNECTION_SESSION_COUNT_LIMIT);
            _receivedLock = new ReentrantLock();
            _stateManager = new AMQStateManager(broker, this);
            _codecFactory = new AMQCodecFactory(true, this);
            _connectionID = connectionId;
            _logSubject = new ConnectionLogSubject(this);

            _authorizedSubject.getPrincipals().add(new ConnectionPrincipal(this));
    View Full Code Here

    Examples of org.apache.qpid.server.protocol.v0_8.state.AMQStateManager

            _broker = broker;
            _port = port;
            _transport = transport;
            _maxNoOfChannels = broker.getConnection_sessionCountLimit();
            _receivedLock = new ReentrantLock();
            _stateManager = new AMQStateManager(broker, this);
            _decoder = new AMQDecoder(true, this);
            _connectionID = connectionId;
            _logSubject = new ConnectionLogSubject(this);

            _authorizedSubject.getPrincipals().add(new ConnectionPrincipal(this));
    View Full Code Here

    Examples of org.apache.qpid.server.state.AMQStateManager


        public AMQProtocolEngine(VirtualHostRegistry virtualHostRegistry, NetworkConnection network, final long connectionId)
        {
            _receivedLock = new ReentrantLock();
            _stateManager = new AMQStateManager(virtualHostRegistry, this);
            _codecFactory = new AMQCodecFactory(true, this);

            setNetworkConnection(network);
            _connectionID = connectionId;
    View Full Code Here

    Examples of org.apache.qpid.server.state.AMQStateManager

        private final Lock _receivedLock;

        public AMQProtocolEngine(VirtualHostRegistry virtualHostRegistry, NetworkConnection network, final long connectionId)
        {
            _receivedLock = new ReentrantLock();
            _stateManager = new AMQStateManager(virtualHostRegistry, this);
            _codecFactory = new AMQCodecFactory(true, this);

            setNetworkConnection(network);
            _connectionID = connectionId;
    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.