congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
MemoryTransactionStore$Tx
Code IndexAdd Tabnine to your IDE (free)

How to use
MemoryTransactionStore$Tx
in
org.apache.activemq.store.memory

Best Java code snippets using org.apache.activemq.store.memory.MemoryTransactionStore$Tx (Showing top 20 results out of 315)

origin: apache/activemq

public Tx getTx(Object txid) {
  Tx tx = inflightTransactions.get(txid);
  if (tx == null) {
    synchronized (inflightTransactions) {
      tx = inflightTransactions.get(txid);
      if ( tx == null) {
        tx = new Tx();
        inflightTransactions.put(txid, tx);
      }
    }
  }
  return tx;
}
origin: apache/activemq

@Override
public void commit(TransactionId txid, boolean wasPrepared, Runnable preCommit, Runnable postCommit) throws IOException {
  if (preCommit != null) {
    preCommit.run();
  }
  Tx tx;
  if (wasPrepared) {
    tx = preparedTransactions.get(txid);
  } else {
    tx = inflightTransactions.remove(txid);
  }
  if (tx != null) {
    tx.commit();
  }
  if (wasPrepared) {
    preparedTransactions.remove(txid);
  }
  if (postCommit != null) {
    postCommit.run();
  }
}
origin: apache/activemq

@Override
public synchronized void recover(TransactionRecoveryListener listener) throws IOException {
  // All the inflight transactions get rolled back..
  inflightTransactions.clear();
  this.doingRecover = true;
  try {
    for (Iterator<TransactionId> iter = preparedTransactions.keySet().iterator(); iter.hasNext();) {
      Object txid = iter.next();
      Tx tx = preparedTransactions.get(txid);
      listener.recover((XATransactionId) txid, tx.getMessages(), tx.getAcks());
      onRecovered(tx);
    }
  } finally {
    this.doingRecover = false;
  }
}
origin: org.apache.activemq/activemq-jdbc-store

final MessageAck ack = new MessageAck();
ack.setDestination(destination);
tx.add(new LastAckCommand() {
  JDBCTopicMessageStore jdbcTopicMessageStore;
origin: org.apache.activemq/activemq-jdbc-store

tx.add(new LastAckCommand() {
  public MessageAck getMessageAck() {
    return ack;
origin: org.apache.activemq/activemq-all

tx.add(new LastAckCommand() {
  public MessageAck getMessageAck() {
    return ack;
origin: org.apache.activemq/activemq-all

final MessageAck ack = new MessageAck();
ack.setDestination(destination);
tx.add(new LastAckCommand() {
  JDBCTopicMessageStore jdbcTopicMessageStore;
origin: org.apache.activemq/activemq-osgi

tx.add(new LastAckCommand() {
  public MessageAck getMessageAck() {
    return ack;
origin: org.apache.activemq/activemq-osgi

final MessageAck ack = new MessageAck();
ack.setDestination(destination);
tx.add(new LastAckCommand() {
  JDBCTopicMessageStore jdbcTopicMessageStore;
origin: org.apache.activemq/activemq-osgi

tx.add(new AddMessageCommand() {
  @SuppressWarnings("unused")
  MessageStore messageStore = destination;
origin: org.apache.activemq/activemq-all

tx.add(new AddMessageCommand() {
  @SuppressWarnings("unused")
  MessageStore messageStore = destination;
origin: org.apache.activemq/activemq-broker

tx.add(new AddMessageCommand() {
  @SuppressWarnings("unused")
  MessageStore messageStore = destination;
origin: org.apache.activemq/activemq-all

public void acknowledge(final TopicMessageStore destination, final String clientId, final String subscriptionName, final MessageId messageId,
  final MessageAck ack) throws IOException {
  if (doingRecover) {
    return;
  }
  if (ack.isInTransaction()) {
    Tx tx = getTx(ack.getTransactionId());
    tx.add(new RemoveMessageCommand() {
      @Override
      public MessageAck getMessageAck() {
        return ack;
      }
      @Override
      public void run(ConnectionContext ctx) throws IOException {
        destination.acknowledge(ctx, clientId, subscriptionName, messageId, ack);
      }
      @Override
      public MessageStore getMessageStore() {
        return destination;
      }
    });
  } else {
    destination.acknowledge(null, clientId, subscriptionName, messageId, ack);
  }
}
origin: org.apache.activemq/activemq-osgi

/**
 * @param ack
 * @throws IOException
 */
final void removeMessage(final MessageStore destination, final MessageAck ack) throws IOException {
  if (doingRecover) {
    return;
  }
  if (ack.isInTransaction()) {
    Tx tx = getTx(ack.getTransactionId());
    tx.add(new RemoveMessageCommand() {
      @Override
      public MessageAck getMessageAck() {
        return ack;
      }
      @Override
      public void run(ConnectionContext ctx) throws IOException {
        destination.removeMessage(ctx, ack);
      }
      @Override
      public MessageStore getMessageStore() {
        return destination;
      }
    });
  } else {
    destination.removeMessage(null, ack);
  }
}
origin: org.apache.activemq/activemq-all

/**
 * @param ack
 * @throws IOException
 */
final void removeMessage(final MessageStore destination, final MessageAck ack) throws IOException {
  if (doingRecover) {
    return;
  }
  if (ack.isInTransaction()) {
    Tx tx = getTx(ack.getTransactionId());
    tx.add(new RemoveMessageCommand() {
      @Override
      public MessageAck getMessageAck() {
        return ack;
      }
      @Override
      public void run(ConnectionContext ctx) throws IOException {
        destination.removeMessage(ctx, ack);
      }
      @Override
      public MessageStore getMessageStore() {
        return destination;
      }
    });
  } else {
    destination.removeMessage(null, ack);
  }
}
origin: org.apache.activemq/activemq-broker

/**
 * @param ack
 * @throws IOException
 */
final void removeMessage(final MessageStore destination, final MessageAck ack) throws IOException {
  if (doingRecover) {
    return;
  }
  if (ack.isInTransaction()) {
    Tx tx = getTx(ack.getTransactionId());
    tx.add(new RemoveMessageCommand() {
      @Override
      public MessageAck getMessageAck() {
        return ack;
      }
      @Override
      public void run(ConnectionContext ctx) throws IOException {
        destination.removeMessage(ctx, ack);
      }
      @Override
      public MessageStore getMessageStore() {
        return destination;
      }
    });
  } else {
    destination.removeMessage(null, ack);
  }
}
origin: org.apache.activemq/activemq-jdbc-store

public void recoverAck(long id, byte[] xid, byte[] message) throws IOException {
  Message msg = (Message) ((JDBCPersistenceAdapter)persistenceAdapter).getWireFormat().unmarshal(new ByteSequence(message));
  msg.getMessageId().setFutureOrSequenceLong(id);
  msg.getMessageId().setEntryLocator(id);
  Tx tx = getPreparedTx(new XATransactionId(xid));
  final MessageAck ack = new MessageAck(msg, MessageAck.STANDARD_ACK_TYPE, 1);
  tx.add(new RemoveMessageCommand() {
    @Override
    public MessageAck getMessageAck() {
      return ack;
    }
    @Override
    public void run(ConnectionContext context) throws IOException {
      ((JDBCPersistenceAdapter)persistenceAdapter).commitRemove(context, ack);
    }
    @Override
    public MessageStore getMessageStore() {
      return null;
    }
  });
}
origin: org.apache.activemq/activemq-osgi

public void recoverAck(long id, byte[] xid, byte[] message) throws IOException {
  Message msg = (Message) ((JDBCPersistenceAdapter)persistenceAdapter).getWireFormat().unmarshal(new ByteSequence(message));
  msg.getMessageId().setFutureOrSequenceLong(id);
  msg.getMessageId().setEntryLocator(id);
  Tx tx = getPreparedTx(new XATransactionId(xid));
  final MessageAck ack = new MessageAck(msg, MessageAck.STANDARD_ACK_TYPE, 1);
  tx.add(new RemoveMessageCommand() {
    @Override
    public MessageAck getMessageAck() {
      return ack;
    }
    @Override
    public void run(ConnectionContext context) throws IOException {
      ((JDBCPersistenceAdapter)persistenceAdapter).commitRemove(context, ack);
    }
    @Override
    public MessageStore getMessageStore() {
      return null;
    }
  });
}
origin: org.apache.activemq/activemq-osgi

public void acknowledge(final TopicMessageStore destination, final String clientId, final String subscriptionName, final MessageId messageId,
  final MessageAck ack) throws IOException {
  if (doingRecover) {
    return;
  }
  if (ack.isInTransaction()) {
    Tx tx = getTx(ack.getTransactionId());
    tx.add(new RemoveMessageCommand() {
      @Override
      public MessageAck getMessageAck() {
        return ack;
      }
      @Override
      public void run(ConnectionContext ctx) throws IOException {
        destination.acknowledge(ctx, clientId, subscriptionName, messageId, ack);
      }
      @Override
      public MessageStore getMessageStore() {
        return destination;
      }
    });
  } else {
    destination.acknowledge(null, clientId, subscriptionName, messageId, ack);
  }
}
origin: org.apache.activemq/activemq-all

public void recoverAck(long id, byte[] xid, byte[] message) throws IOException {
  Message msg = (Message) ((JDBCPersistenceAdapter)persistenceAdapter).getWireFormat().unmarshal(new ByteSequence(message));
  msg.getMessageId().setFutureOrSequenceLong(id);
  msg.getMessageId().setEntryLocator(id);
  Tx tx = getPreparedTx(new XATransactionId(xid));
  final MessageAck ack = new MessageAck(msg, MessageAck.STANDARD_ACK_TYPE, 1);
  tx.add(new RemoveMessageCommand() {
    @Override
    public MessageAck getMessageAck() {
      return ack;
    }
    @Override
    public void run(ConnectionContext context) throws IOException {
      ((JDBCPersistenceAdapter)persistenceAdapter).commitRemove(context, ack);
    }
    @Override
    public MessageStore getMessageStore() {
      return null;
    }
  });
}
org.apache.activemq.store.memoryMemoryTransactionStore$Tx

Most used methods

  • add
  • <init>
  • commit
  • getAcks
  • getMessages

Popular in Java

  • Reading from database using SQL prepared statement
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getApplicationContext (Context)
  • setRequestProperty (URLConnection)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now