mirror of https://github.com/apache/activemq.git
return a lock for the store
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@618774 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f81d0d59d3
commit
fdd977aab8
|
@ -19,6 +19,8 @@ package org.apache.activemq.store.jpa;
|
|||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.Query;
|
||||
|
@ -43,6 +45,7 @@ public class JPAReferenceStore implements ReferenceStore {
|
|||
protected final ActiveMQDestination destination;
|
||||
protected final String destinationName;
|
||||
protected AtomicLong lastMessageId = new AtomicLong(-1);
|
||||
protected final Lock lock = new ReentrantLock();
|
||||
|
||||
public JPAReferenceStore(JPAPersistenceAdapter adapter, ActiveMQDestination destination) {
|
||||
this.adapter = adapter;
|
||||
|
@ -51,6 +54,10 @@ public class JPAReferenceStore implements ReferenceStore {
|
|||
this.wireFormat = this.adapter.getWireFormat();
|
||||
}
|
||||
|
||||
public Lock getStoreLock() {
|
||||
return lock;
|
||||
}
|
||||
|
||||
public ActiveMQDestination getDestination() {
|
||||
return destination;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue