Package org.apache.qpid.management.common.mbeans

Examples of org.apache.qpid.management.common.mbeans.ManagedConnection


    }

    public void testGetAttributes() throws Exception
    {
        _connection = getConnection();
        final ManagedConnection mBean = getConnectionMBean();

        checkAuthorisedId(mBean);
        checkClientVersion(mBean);
        checkClientId(mBean);
    }
View Full Code Here


        boolean transactional = false;
        boolean flowBlocked = false;

        _connection.createSession(transactional, Session.AUTO_ACKNOWLEDGE);

        final ManagedConnection mBean = getConnectionMBean();
        final CompositeDataSupport row = getTheOneChannelRow(mBean);
        assertChannelRowData(row, 0, transactional, flowBlocked);
    }
View Full Code Here

        final MessageConsumer consumer = session.createConsumer(destination);

        sendMessage(session, destination, numberOfMessages);
        receiveMessagesWithoutCommit(consumer, numberOfMessages);

        final ManagedConnection mBean = getConnectionMBean();
        final CompositeDataSupport row = getTheOneChannelRow(mBean);
        boolean flowBlocked = false;
        assertChannelRowData(row, numberOfMessages, transactional, flowBlocked);

        // check that commit advances the lastIoTime
        final Date initialLastIOTime = mBean.getLastIoTime();
        session.commit();
        assertTrue("commit should have caused last IO time to advance", mBean.getLastIoTime().after(initialLastIOTime));

        // check that channels() now returns one session with no unacknowledged messages
        final CompositeDataSupport rowAfterCommit = getTheOneChannelRow(mBean);
        final Number unackCountAfterCommit = (Number) rowAfterCommit.get(ManagedConnection.UNACKED_COUNT);
        assertEquals("Unexpected number of unacknowledged messages", 0, unackCountAfterCommit);
View Full Code Here

        ManagedQueue managedQueue = _jmxUtils.getManagedQueue(queueName);
        managedQueue.setFlowResumeCapacity(DEFAULT_MESSAGE_SIZE * 2l);
        managedQueue.setCapacity(DEFAULT_MESSAGE_SIZE * 3l);

        final ManagedConnection managedConnection = getConnectionMBean();

        // Check that producer flow is not block before test
        final CompositeDataSupport rowBeforeSend = getTheOneChannelRow(managedConnection);
        assertFlowBlocked(rowBeforeSend, false);

View Full Code Here

    private ManagedConnection getConnectionMBean()
    {
        List<ManagedConnection> connections = getManagedConnections();
        assertNotNull("Connection MBean is not found", connections);
        assertEquals("Unexpected number of connection mbeans", 1, connections.size());
        final ManagedConnection mBean = connections.get(0);
        assertNotNull("Connection MBean is null", mBean);
        return mBean;
    }
View Full Code Here

        //Remove the connection close from any 0-10 connections
        _monitor.markDiscardPoint();

        // Get a managedConnection
        ManagedConnection mangedConnection = _jmxUtils.getManagedObject(ManagedConnection.class, "org.apache.qpid:type=VirtualHost.Connection,*");

        //Close the connection
        mangedConnection.closeConnection();

        //Wait for the connection to close
        assertTrue("Timed out waiting for conneciton to report close",
                   exceptionReceived.await(2, TimeUnit.SECONDS));

View Full Code Here

    private void checkSingleConnectionOnVHostStatistics(String vHostName, long messagesSent, long messagesReceived, long dataSent, long dataReceived)
    {
        List<ManagedConnection> managedConnections = _jmxUtils.getManagedConnections(vHostName);
        assertEquals(1, managedConnections.size());

        ManagedConnection managedConnection = managedConnections.get(0);

        assertEquals(messagesSent, managedConnection.getTotalMessagesReceived());
        assertEquals(messagesReceived, managedConnection.getTotalMessagesDelivered());

        assertEquals(dataSent, managedConnection.getTotalDataReceived());
        assertEquals(dataReceived, managedConnection.getTotalDataDelivered());
    }
View Full Code Here

        //Remove the connection close from any 0-10 connections
        _monitor.markDiscardPoint();

        // Get a managedConnection
        ManagedConnection mangedConnection = _jmxUtils.getManagedObject(ManagedConnection.class, "org.apache.qpid:type=VirtualHost.Connection,*");

        //Close the connection
        mangedConnection.closeConnection();

        //Wait for the connection to close
        assertTrue("Timed out waiting for conneciton to report close",
                   exceptionReceived.await(2, TimeUnit.SECONDS));

View Full Code Here

        //Remove the connection close from any 0-10 connections
        _monitor.reset();

        // Get a managedConnection
        ManagedConnection mangedConnection = _jmxUtils.getManagedObject(ManagedConnection.class, "org.apache.qpid:type=VirtualHost.Connection,*");

        //Close the connection
        mangedConnection.closeConnection();

        //Wait for the connection to close
        assertTrue("Timed out waiting for conneciton to report close",
                   exceptionReceived.await(2, TimeUnit.SECONDS));

View Full Code Here

    private void checkSingleConnectionOnVHostStatistics(String vHostName, long messagesSent, long messagesReceived, long dataSent, long dataReceived)
    {
        List<ManagedConnection> managedConnections = _jmxUtils.getManagedConnections(vHostName);
        assertEquals(1, managedConnections.size());

        ManagedConnection managedConnection = managedConnections.get(0);

        assertEquals(messagesSent, managedConnection.getTotalMessagesReceived());
        assertEquals(messagesReceived, managedConnection.getTotalMessagesDelivered());

        assertEquals(dataSent, managedConnection.getTotalDataReceived());
        assertEquals(dataReceived, managedConnection.getTotalDataDelivered());
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.management.common.mbeans.ManagedConnection

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.