Tabnine Logo
MemoryTransactionStore
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: apache/activemq

@Override
public MessageStore createQueueMessageStore(ActiveMQQueue destination) throws IOException {
  MessageStore rc = queues.get(destination);
  if (rc == null) {
    rc = new MemoryMessageStore(destination);
    if (transactionStore != null) {
      rc = transactionStore.proxy(rc);
    }
    queues.put(destination, rc);
  }
  return rc;
}
origin: apache/activemq

@Override
public TransactionStore createTransactionStore() throws IOException {
  if (transactionStore == null) {
    transactionStore = new MemoryTransactionStore(this);
  }
  return transactionStore;
}
origin: apache/activemq

  @Override
  public void acknowledge(ConnectionContext context, String clientId, String subscriptionName, MessageId messageId, MessageAck ack)
    throws IOException {
    MemoryTransactionStore.this.acknowledge((TopicMessageStore) getDelegate(), clientId, subscriptionName, messageId, ack);
  }
};
origin: apache/activemq

@Override
public void addMessage(ConnectionContext context, final Message send, boolean canOptimize) throws IOException {
  MemoryTransactionStore.this.addMessage(context, getDelegate(), send);
}
origin: apache/activemq

  @Override
  public void removeAsyncMessage(ConnectionContext context, MessageAck ack) throws IOException {
    MemoryTransactionStore.this.removeMessage(getDelegate(), ack);
  }
};
origin: apache/activemq

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: apache/activemq

@Override
public void deleteAllMessages() throws IOException {
  for (Iterator<TopicMessageStore> iter = topics.values().iterator(); iter.hasNext();) {
    MemoryMessageStore store = asMemoryMessageStore(iter.next());
    if (store != null) {
      store.delete();
    }
  }
  for (Iterator<MessageStore> iter = queues.values().iterator(); iter.hasNext();) {
    MemoryMessageStore store = asMemoryMessageStore(iter.next());
    if (store != null) {
      store.delete();
    }
  }
  if (transactionStore != null) {
    transactionStore.delete();
  }
}
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: apache/activemq

onProxyQueueStore(proxyMessageStore);
return proxyMessageStore;
origin: apache/activemq

onProxyTopicStore(proxyTopicMessageStore);
return proxyTopicMessageStore;
origin: apache/activemq

@Override
public void addMessage(ConnectionContext context, final Message send) throws IOException {
  MemoryTransactionStore.this.addMessage(context, getDelegate(), send);
}
origin: apache/activemq

@Override
public void removeMessage(ConnectionContext context, final MessageAck ack) throws IOException {
  MemoryTransactionStore.this.removeMessage(getDelegate(), ack);
}
origin: apache/activemq

/**
 * @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

@Override
public void deleteAllMessages() throws IOException {
  for (Iterator<TopicMessageStore> iter = topics.values().iterator(); iter.hasNext();) {
    MemoryMessageStore store = asMemoryMessageStore(iter.next());
    if (store != null) {
      store.delete();
    }
  }
  for (Iterator<MessageStore> iter = queues.values().iterator(); iter.hasNext();) {
    MemoryMessageStore store = asMemoryMessageStore(iter.next());
    if (store != null) {
      store.delete();
    }
  }
  if (transactionStore != null) {
    transactionStore.delete();
  }
}
origin: org.apache.activemq/activemq-broker

@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-broker

onProxyQueueStore(proxyMessageStore);
return proxyMessageStore;
origin: org.apache.activemq/activemq-broker

onProxyTopicStore(proxyTopicMessageStore);
return proxyTopicMessageStore;
origin: apache/activemq

@Override
public TopicMessageStore createTopicMessageStore(ActiveMQTopic destination) throws IOException {
  TopicMessageStore rc = topics.get(destination);
  if (rc == null) {
    rc = new MemoryTopicMessageStore(destination);
    if (transactionStore != null) {
      rc = transactionStore.proxy(rc);
    }
    topics.put(destination, rc);
  }
  return rc;
}
origin: apache/activemq

@Override
public void addMessage(ConnectionContext context, final Message send) throws IOException {
  MemoryTransactionStore.this.addMessage(context, getDelegate(), send);
}
origin: apache/activemq

@Override
public void removeMessage(ConnectionContext context, final MessageAck ack) throws IOException {
  MemoryTransactionStore.this.removeMessage(getDelegate(), ack);
}
org.apache.activemq.store.memoryMemoryTransactionStore

Javadoc

Provides a TransactionStore implementation that can create transaction aware MessageStore objects from non transaction aware MessageStore objects.

Most used methods

  • proxy
  • <init>
  • acknowledge
  • addMessage
  • delete
  • getTx
  • removeMessage
  • onProxyQueueStore
  • onProxyTopicStore
  • onRecovered
  • recover
  • recover

Popular in Java

  • Running tasks concurrently on multiple threads
  • getApplicationContext (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • putExtra (Intent)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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