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:
Robert Davies 2008-02-05 20:52:10 +00:00
parent f81d0d59d3
commit fdd977aab8
1 changed files with 8 additions and 1 deletions

View File

@ -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,13 +45,18 @@ 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;
this.destination = destination;
this.destinationName = destination.getQualifiedName();
this.wireFormat = this.adapter.getWireFormat();
}
public Lock getStoreLock() {
return lock;
}
public ActiveMQDestination getDestination() {
return destination;