Package org.apache.activemq.command

Examples of org.apache.activemq.command.RemoveInfo


public class RemoveInfoTest extends BaseCommandTestSupport {

    public static final RemoveInfoTest SINGLETON = new RemoveInfoTest();

    public Object createObject() throws Exception {
        RemoveInfo info = new RemoveInfo();
        populateObject(info);
        return info;
    }
View Full Code Here


        return info;
    }

    protected void populateObject(Object object) throws Exception {
        super.populateObject(object);
        RemoveInfo info = (RemoveInfo)object;
        info.setObjectId(createDataStructure("ObjectId:1"));

    }
View Full Code Here

        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


    public static final RemoveInfoTest SINGLETON = new RemoveInfoTest();

    public Object createObject() throws Exception {
        RemoveInfo info = new RemoveInfo();
        populateObject(info);
        return info;
    }
View Full Code Here

        return info;
    }

    protected void populateObject(Object object) throws Exception {
        super.populateObject(object);
        RemoveInfo info = (RemoveInfo) object;

        info.setObjectId(createDataStructure("ObjectId:1"));
    }
View Full Code Here

                    this.activeTempDestinations.clear();

                    if (isConnectionInfoSentToBroker) {
                        // If we announced ourselves 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

    }

    private void doClose() throws JMSException {
        boolean interrupted = Thread.interrupted();
        dispose();
        RemoveInfo removeCommand = info.createRemoveCommand();
        removeCommand.setLastDeliveredSequenceId(lastDeliveredSequenceId);
        connection.asyncSendPacket(removeCommand);
        if (interrupted) {
            Thread.currentThread().interrupt();
        }
    }
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

        if (subs != null) {
            ConsumerInfo info = subs.getConsumerInfo();
            if (info != null) {
                subscriptionsByConsumerId.remove(info.getConsumerId());
            }
            RemoveInfo removeInfo = null;
            if (info != null) {
                removeInfo = info.createRemoveCommand();
            }
            sendToActiveMQ(removeInfo, null);
        }
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.