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

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


        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


    }

    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

    }

    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

     * Not synchronize since the Journal has better throughput if you increase the number of concurrent writes that it
     * is doing.
     */
    public final void addMessage(ConnectionContext context, final Message message) throws IOException {
        final MessageId id = message.getMessageId();
        final Location location = peristenceAdapter.writeCommand(message, message.isResponseRequired());
        if (!context.isInTransaction()) {
            if (debug) {
                LOG.debug("Journalled message add for: " + id + ", at: " + location);
            }
            this.peristenceAdapter.addInProgressDataFile(this, location.getDataFileId());
            addMessage(message, location);
        } else {
            if (debug) {
                LOG.debug("Journalled transacted message add for: " + id + ", at: " + location);
            }
View Full Code Here

     */
    public void removeMessage(final ConnectionContext context, final MessageAck ack) throws IOException {
        JournalQueueAck remove = new JournalQueueAck();
        remove.setDestination(destination);
        remove.setMessageAck(ack);
        final Location location = peristenceAdapter.writeCommand(remove, ack.isResponseRequired());
        if (!context.isInTransaction()) {
            if (debug) {
                LOG.debug("Journalled message remove for: " + ack.getLastMessageId() + ", at: " + location);
            }
            removeMessage(ack, location);
View Full Code Here

     */
    protected Location doAsyncWrite() throws IOException {
        final List<MessageAck> cpRemovedMessageLocations;
        final List<Location> cpActiveJournalLocations;
        final int maxCheckpointMessageAddSize = peristenceAdapter.getMaxCheckpointMessageAddSize();
        final Location lastLocation;
        // swap out the message hash maps..
        lock.lock();
        try {
            cpAddedMessageIds = this.messages;
            cpRemovedMessageLocations = this.messageAcks;
View Full Code Here

    /**
     *
     */
    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) {
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.