Package org.apache.activemq.kaha.impl.async

Examples of org.apache.activemq.kaha.impl.async.Location


            data = referenceStore.getMessageReference(messageId);
            if (data == null) {
                return null;
            }
        }
        Location location = new Location();
        location.setDataFileId(data.getFileId());
        location.setOffset(data.getOffset());
        return location;
    }
View Full Code Here


            referenceStore.recoverNextMessages(maxReturned, recoveryListener);
        }
    }

    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: "
View Full Code Here

    }

    ReadOnlyAsyncDataManager manager = new ReadOnlyAsyncDataManager(getDirs());
    manager.start();
    try {
      Location curr = manager.getFirstLocation();
      while (curr != null) {

        ByteSequence data = manager.read(curr);
        DataStructure c = (DataStructure) wireFormat.unmarshal(data);
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");
View Full Code Here

        ack.setMessageId(messageId);
        ack.setMessageSequenceId(messageId.getBrokerSequenceId());
        ack.setSubscritionName(subscriptionName);
        ack.setClientId(clientId);
        ack.setTransactionId(context.getTransaction() != null ? context.getTransaction().getTransactionId() : null);
        final Location location = peristenceAdapter.writeCommand(ack, false);
        final SubscriptionKey key = new SubscriptionKey(clientId, subscriptionName);
        if (!context.isInTransaction()) {
            if (debug) {
                LOG.debug("Journalled acknowledge for: " + messageId + ", at: " + location);
            }
View Full Code Here

    public AMQTxMarshaller(WireFormat wireFormat) {
        this.wireFormat = wireFormat;
    }

    public AMQTx readPayload(DataInput dataIn) throws IOException {
        Location location = new Location();
        location.readExternal(dataIn);
        AMQTx result = new AMQTx(location);
        int size = dataIn.readInt();
        for (int i = 0; i < size; i++) {
            AMQTxOperation op = new AMQTxOperation();
            op.readExternal(wireFormat, dataIn);
View Full Code Here

        dos.writeInt(packet.length);
        dos.write(packet.data, packet.offset, packet.length);
    }

    public void readExternal(WireFormat wireFormat, DataInput dis) throws IOException {
        this.location = new Location();
        this.location.readExternal(dis);
        int size = dis.readInt();
        byte[] data = new byte[size];
        dis.readFully(data);
        setData(wireFormat.unmarshal(new ByteSequence(data)));
View Full Code Here

    }

    ReadOnlyAsyncDataManager manager = new ReadOnlyAsyncDataManager(getDirs());
    manager.start();
    try {
      Location curr = manager.getFirstLocation();
      while (curr != null) {

        ByteSequence data = manager.read(curr);
        DataStructure c = (DataStructure) wireFormat.unmarshal(data);
View Full Code Here

        MessageLocation result = lastLocation;
        if (result != null) {
            result.setMessage(null);
        }
        Message message = null;
        Location pos = lastLocation != null ? lastLocation.getLocation() : null;
        while ((pos = getNextLocation(file, pos)) != null) {
            message = getMessage(pos);
            if (message != null) {
                if (result == null) {
                    result = new MessageLocation();
View Full Code Here

        MessageLocation result = lastLocation;
        if (result != null) {
            result.setMessage(null);
        }
        Message message = null;
        Location pos = lastLocation != null ? lastLocation.getLocation() : null;
        while ((pos = getNextLocation(file, pos)) != null) {
            message = getMessage(pos);
            if (message != null) {
                if (result == null) {
                    result = new MessageLocation();
View Full Code Here

TOP

Related Classes of org.apache.activemq.kaha.impl.async.Location

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.