Package org.apache.activemq.command

Examples of org.apache.activemq.command.DataStructure


     *
     */
    public Message getMessage(MessageId identity) throws IOException {
        Location location = getLocation(identity);
        if (location != null) {
            DataStructure rc = peristenceAdapter.readCommand(location);
            try {
                return (Message) rc;
            } catch (ClassCastException e) {
                throw new IOException("Could not read message " + identity + " at location " + location
                        + ", expected a message, but got: " + rc);
View Full Code Here


    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

        ConnectionContext context = new ConnectionContext();

        // 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()) {
View Full Code Here

        ConnectionContext context = new ConnectionContext();

        // 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;
                RapidMessageStore store = (RapidMessageStore) createMessageStore(message.getDestination());
                if ( message.isInTransaction()) {
                    transactionStore.addMessage(store, message, pos);
                }
                else {
                    store.replayAddMessage(context, message, pos);
                    transactionCounter++;
                }
            } else {
                switch (c.getDataStructureType()) {
                case JournalQueueAck.DATA_STRUCTURE_TYPE:
                {
                    JournalQueueAck command = (JournalQueueAck) c;
                    RapidMessageStore store = (RapidMessageStore) createMessageStore(command.getDestination());
                    if (command.getMessageAck().isInTransaction()) {
View Full Code Here

    protected DataStructure tightUnmarsalCachedObject(OpenWireFormat wireFormat, DataInput dataIn, BooleanStream bs) throws IOException {
        if( wireFormat.isCacheEnabled() ) {
            if( bs.readBoolean() ) {
                short index = dataIn.readShort();
                DataStructure object = wireFormat.tightUnmarshalNestedObject(dataIn, bs);
                wireFormat.setInUnmarshallCache(index, object);
                return object;
            } else {
                short index = dataIn.readShort();
                return wireFormat.getFromUnmarshallCache(index);
View Full Code Here

    protected DataStructure looseUnmarsalCachedObject(OpenWireFormat wireFormat, DataInput dataIn) throws IOException {
        if( wireFormat.isCacheEnabled() ) {
            if( dataIn.readBoolean() ) {
                short index = dataIn.readShort();
                DataStructure object = wireFormat.looseUnmarshalNestedObject(dataIn);
                wireFormat.setInUnmarshallCache(index, object);
                return object;
            } else {
                short index = dataIn.readShort();
                return wireFormat.getFromUnmarshallCache(index);
View Full Code Here

        ConnectionContext context = new ConnectionContext();

        // 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;
                QuickJournalMessageStore store = (QuickJournalMessageStore) createMessageStore(message.getDestination());
                if ( message.isInTransaction()) {
                    transactionStore.addMessage(store, message, pos);
                }
                else {
                    store.replayAddMessage(context, message, pos);
                    transactionCounter++;
                }
            } else {
                switch (c.getDataStructureType()) {
                case JournalQueueAck.DATA_STRUCTURE_TYPE:
                {
                    JournalQueueAck command = (JournalQueueAck) c;
                    QuickJournalMessageStore store = (QuickJournalMessageStore) createMessageStore(command.getDestination());
                    if (command.getMessageAck().isInTransaction()) {
View Full Code Here

    protected DataStructure tightUnmarsalCachedObject(OpenWireFormat wireFormat, DataInput dataIn, BooleanStream bs) throws IOException {
        if( wireFormat.isCacheEnabled() ) {
            if( bs.readBoolean() ) {
                short index = dataIn.readShort();
                DataStructure object = wireFormat.tightUnmarshalNestedObject(dataIn, bs);
                wireFormat.setInUnmarshallCache(index, object);
                return object;
            } else {
                short index = dataIn.readShort();
                return wireFormat.getFromUnmarshallCache(index);
View Full Code Here

    protected DataStructure looseUnmarsalCachedObject(OpenWireFormat wireFormat, DataInput dataIn) throws IOException {
        if( wireFormat.isCacheEnabled() ) {
            if( dataIn.readBoolean() ) {
                short index = dataIn.readShort();
                DataStructure object = wireFormat.looseUnmarshalNestedObject(dataIn);
                wireFormat.setInUnmarshallCache(index, object);
                return object;
            } else {
                short index = dataIn.readShort();
                return wireFormat.getFromUnmarshallCache(index);
View Full Code Here

            } catch (JMSException e) {
                connection.onAsyncException(e);
            }
        }
       
        DataStructure o = md.getMessage().getDataStructure();
        if( o!=null && o.getClass() == DestinationInfo.class ) {
            processDestinationInfo((DestinationInfo) o);
        } else {
            connection.onAsyncException(new JMSException("Unexpected message was dispatched to the AdvisoryConsumer: "+md));
        }
       
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.