Package org.apache.activemq.command

Examples of org.apache.activemq.command.DataStructure


    Message getMessage(ReferenceData data) throws IOException {
        Location location = new Location();
        location.setDataFileId(data.getFileId());
        location.setOffset(data.getOffset());
        DataStructure rc = peristenceAdapter.readCommand(location);
        try {
            return (Message) rc;
        } catch (ClassCastException e) {
            throw new IOException("Could not read message  at location " + location + ", expected a message, but got: "
                    + rc);
View Full Code Here


    scanner.close()}

  private void process(Entry entry) throws Exception {

    Location location = entry.getLocation();
    DataStructure record = entry.getRecord();

    switch (record.getDataStructureType()) {
    case ActiveMQMessage.DATA_STRUCTURE_TYPE:
      entry.setType("ActiveMQMessage");
      entry.setFormater("message");
      display(entry);
      break;
View Full Code Here

        long start = System.currentTimeMillis();
        ConnectionContext context = new ConnectionContext(new NonCachedMessageEvaluationContext());
        // While we have records in the journal.
        while ((pos = asyncDataManager.getNextLocation(pos)) != null) {
            ByteSequence data = asyncDataManager.read(pos);
            DataStructure c = (DataStructure)wireFormat.unmarshal(data);
            if (c instanceof Message) {
                Message message = (Message)c;
                AMQMessageStore store = (AMQMessageStore)createMessageStore(message.getDestination());
                if (message.isInTransaction()) {
                    transactionStore.addMessage(store, message, pos);
                } else {
                    if (store.replayAddMessage(context, message, pos)) {
                        redoCounter++;
                    }
                }
            } else {
                switch (c.getDataStructureType()) {
                case SubscriptionInfo.DATA_STRUCTURE_TYPE: {
                    referenceStoreAdapter.recoverSubscription((SubscriptionInfo)c);
                }
                    break;
                case JournalQueueAck.DATA_STRUCTURE_TYPE: {
View Full Code Here

    try {
      Location curr = manager.getFirstLocation();
      while (curr != null) {

        ByteSequence data = manager.read(curr);
        DataStructure c = (DataStructure) wireFormat.unmarshal(data);

        Entry entry = new Entry();
        entry.setLocation(curr);
        entry.setRecord(c);
        entry.setData(data);
View Full Code Here

    try {
      Location curr = manager.getFirstLocation();
      while (curr != null) {

        ByteSequence data = manager.read(curr);
        DataStructure c = (DataStructure) wireFormat.unmarshal(data);

        Entry entry = new Entry();
        entry.setLocation(curr);
        entry.setRecord(c);
        entry.setData(data);
View Full Code Here

    }
    scanner.close()}

  private void process(Entry entry) throws Exception {

    DataStructure record = entry.getRecord();

    switch (record.getDataStructureType()) {
    case ActiveMQMessage.DATA_STRUCTURE_TYPE:
      entry.setType("ActiveMQMessage");
      entry.setFormater("message");
      display(entry);
      break;
View Full Code Here

        return dataManager.getNextLocation(last);
    }

    private Message getMessage(Location location) throws IOException {
        ByteSequence data = dataManager.read(location);
        DataStructure c = (DataStructure) wireFormat.unmarshal(data);
        if (c instanceof Message) {
            return (Message) c;
        }
        return null;
View Full Code Here

        return dataManager.getNextLocation(last);
    }

    private Message getMessage(Location location) throws IOException {
        ByteSequence data = dataManager.read(location);
        DataStructure c = (DataStructure) wireFormat.unmarshal(data);
        if (c instanceof Message) {
            return (Message) c;
        }
        return null;
View Full Code Here

                        if (in instanceof JmsMessage) {
                            JmsMessage jmsMessage = (JmsMessage) in;
                            javax.jms.Message value = jmsMessage.getJmsMessage();
                            if (value instanceof ActiveMQMessage) {
                                ActiveMQMessage activeMQMessage = (ActiveMQMessage) value;
                                DataStructure structure = activeMQMessage.getDataStructure();
                                if (structure instanceof DestinationInfo) {
                                    DestinationInfo destinationInfo = (DestinationInfo) structure;
                                    System.out.println("Received: " + destinationInfo);
                                }
                            }
View Full Code Here

        ConnectionContext context = new ConnectionContext(new NonCachedMessageEvaluationContext());

        // While we have records in the journal.
        while ((pos = journal.getNextRecordLocation(pos)) != null) {
            Packet data = journal.read(pos);
            DataStructure c = (DataStructure)wireFormat.unmarshal(toByteSequence(data));

            if (c instanceof Message) {
                Message message = (Message)c;
                JournalMessageStore store = (JournalMessageStore)createMessageStore(message.getDestination());
                if (message.isInTransaction()) {
                    transactionStore.addMessage(store, message, pos);
                } else {
                    store.replayAddMessage(context, message);
                    transactionCounter++;
                }
            } else {
                switch (c.getDataStructureType()) {
                case JournalQueueAck.DATA_STRUCTURE_TYPE: {
                    JournalQueueAck command = (JournalQueueAck)c;
                    JournalMessageStore store = (JournalMessageStore)createMessageStore(command.getDestination());
                    if (command.getMessageAck().isInTransaction()) {
                        transactionStore.removeMessage(store, command.getMessageAck(), pos);
View Full Code Here

TOP

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

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.