Package org.apache.activemq.command

Examples of org.apache.activemq.command.RemoveInfo


    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");
    }

    try {
      this.transport.oneway(new RemoveInfo(new ConnectionId("2")));
    } catch(Exception e) {
      fail("Should not have failed to remove this unknown connection");
    }

    this.transport.oneway(new MessageAck());
View Full Code Here


  public void testResponsesSentWhenRequestForIgnoredCommands() throws Exception {
    this.transport = createTransport();
    assertNotNull(failoverTransport);
    MessageAck ack = new MessageAck();
    assertNotNull("Should have received a Response", this.transport.request(ack));
    RemoveInfo info = new RemoveInfo(new ConnectionId("2"));
    assertNotNull("Should have received a Response", this.transport.request(info));
  }
View Full Code Here

                    if (isConnectionInfoSentToBroker) {
                        // If we announced ourselfs to the broker.. Try to let
                        // the broker
                        // know that the connection is being shutdown.
                        RemoveInfo removeCommand = info.createRemoveCommand();
                        removeCommand.setLastDeliveredSequenceId(lastDeliveredSequenceId);
                        doSyncSendPacket(info.createRemoveCommand(), closeTimeout);
                        doAsyncSendPacket(new ShutdownInfo());
                    }

                    started.set(false);
View Full Code Here

    void doClose() throws JMSException {
        // Store interrupted state and clear so that Transport operations don't
        // throw InterruptedException and we ensure that resources are clened up.
        boolean interrupted = Thread.interrupted();
        dispose();
        RemoveInfo removeCommand = info.createRemoveCommand();
        if (LOG.isDebugEnabled()) {
            LOG.debug("remove: " + this.getConsumerId() + ", lastDeliveredSequenceId:" + lastDeliveredSequenceId);
        }
        removeCommand.setLastDeliveredSequenceId(lastDeliveredSequenceId);
        this.session.asyncSendPacket(removeCommand);
        if (interrupted) {
            Thread.currentThread().interrupt();
        }    }
View Full Code Here

        }
    }

    private void doClose() throws JMSException {
        dispose();
        RemoveInfo removeCommand = info.createRemoveCommand();
        removeCommand.setLastDeliveredSequenceId(lastDeliveredSequenceId);
        connection.asyncSendPacket(removeCommand);
    }
View Full Code Here

        // We should get an advisory of the second connection closing
        m1 = receiveMessage(connection1);
        assertNotNull(m1);
        assertNotNull(m1.getDataStructure());
        RemoveInfo r = (RemoveInfo) m1.getDataStructure();
        assertEquals(r.getObjectId(), connectionInfo2.getConnectionId());
       
        assertNoMessagesLeft(connection1);
    }
View Full Code Here

        // We should get an advisory of the consumer closing
        m1 = receiveMessage(connection1);
        assertNotNull(m1);
        assertNotNull(m1.getDataStructure());
        RemoveInfo r = (RemoveInfo) m1.getDataStructure();
        assertEquals(r.getObjectId(), consumerInfo2.getConsumerId());
       
        assertNoMessagesLeft(connection2);
    }
View Full Code Here

        // We should get an advisory of the consumer closing
        m1 = receiveMessage(connection1);
        assertNotNull(m1);
        assertNotNull(m1.getDataStructure());
        RemoveInfo r = (RemoveInfo) m1.getDataStructure();
        assertEquals(r.getObjectId(), consumerInfo2.getConsumerId());
       
        assertNoMessagesLeft(connection2);
    }
View Full Code Here

        // We should get an advisory of the producer closing
        m1 = receiveMessage(connection1);
        assertNotNull(m1);
        assertNotNull(m1.getDataStructure());
        RemoveInfo r = (RemoveInfo) m1.getDataStructure();
        assertEquals(r.getObjectId(), producerInfo2.getProducerId());
       
        assertNoMessagesLeft(connection2);
    }
View Full Code Here

        // We should get an advisory of the producer closing
        m1 = receiveMessage(connection1);
        assertNotNull(m1);
        assertNotNull(m1.getDataStructure());
        RemoveInfo r = (RemoveInfo) m1.getDataStructure();
        assertEquals(r.getObjectId(), producerInfo2.getProducerId());
       
        assertNoMessagesLeft(connection2);
    }
View Full Code Here

TOP

Related Classes of org.apache.activemq.command.RemoveInfo

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.