Package org.apache.activemq.state

Examples of org.apache.activemq.state.ConnectionStateTracker


  public void testCommandsIgnoredWhenOffline() throws Exception {
    this.transport = createTransport();

    assertNotNull(failoverTransport);

    ConnectionStateTracker tracker = failoverTransport.getStateTracker();
    assertNotNull(tracker);

    ConnectionId id = new ConnectionId("1");
    ConnectionInfo connection = new ConnectionInfo(id);

    // Track a connection
    tracker.track(connection);
    try {
      this.transport.oneway(new RemoveInfo(new ConnectionId("1")));
    } catch(Exception e) {
      fail("Should not have failed to remove this known connection");
    }
View Full Code Here


    public void testCommandsIgnoredWhenOffline() throws Exception {
        this.transport = createTransport();

        assertNotNull(failoverTransport);

        ConnectionStateTracker tracker = failoverTransport.getStateTracker();
        assertNotNull(tracker);

        ConnectionId id = new ConnectionId("1");
        ConnectionInfo connection = new ConnectionInfo(id);

        // Track a connection
        tracker.track(connection);
        try {
            this.transport.oneway(new RemoveInfo(new ConnectionId("1")));
        } catch(Exception e) {
            fail("Should not have failed to remove this known connection");
        }
View Full Code Here

        ResponseCorrelator respCorr = (ResponseCorrelator) connection.getTransport();
        MutexTransport mutexTrans = (MutexTransport) respCorr.getNext();
        FailoverTransport failoverTrans = (FailoverTransport) mutexTrans.getNext();
        Field stateTrackerField = FailoverTransport.class.getDeclaredField("stateTracker");
        stateTrackerField.setAccessible(true);
        ConnectionStateTracker stateTracker = (ConnectionStateTracker) stateTrackerField.get(failoverTrans);
        Field statesField = ConnectionStateTracker.class.getDeclaredField("connectionStates");
        statesField.setAccessible(true);
        ConcurrentHashMap<ConnectionId, ConnectionState> states =
                (ConcurrentHashMap<ConnectionId, ConnectionState>) statesField.get(stateTracker);
View Full Code Here

    public void testCommandsIgnoredWhenOffline() throws Exception {
        this.transport = createTransport();

        assertNotNull(failoverTransport);

        ConnectionStateTracker tracker = failoverTransport.getStateTracker();
        assertNotNull(tracker);

        ConnectionId id = new ConnectionId("1");
        ConnectionInfo connection = new ConnectionInfo(id);

        // Track a connection
        tracker.track(connection);
        try {
            this.transport.oneway(new RemoveInfo(new ConnectionId("1")));
        } catch(Exception e) {
            fail("Should not have failed to remove this known connection");
        }
View Full Code Here

        ResponseCorrelator respCorr = (ResponseCorrelator) connection.getTransport();
        MutexTransport mutexTrans = (MutexTransport) respCorr.getNext();
        FailoverTransport failoverTrans = (FailoverTransport) mutexTrans.getNext();
        Field stateTrackerField = FailoverTransport.class.getDeclaredField("stateTracker");
        stateTrackerField.setAccessible(true);
        ConnectionStateTracker stateTracker = (ConnectionStateTracker) stateTrackerField.get(failoverTrans);
        Field statesField = ConnectionStateTracker.class.getDeclaredField("connectionStates");
        statesField.setAccessible(true);
        ConcurrentHashMap<ConnectionId, ConnectionState> states =
                (ConcurrentHashMap<ConnectionId, ConnectionState>) statesField.get(stateTracker);
View Full Code Here

TOP

Related Classes of org.apache.activemq.state.ConnectionStateTracker

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.