git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@729940 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2008-12-29 16:50:21 +00:00
parent 63e3f41af2
commit f42627054c
2 changed files with 6 additions and 32 deletions

View File

@ -30,6 +30,7 @@ import org.apache.activemq.command.MessageAck;
import org.apache.activemq.command.MessageId;
import org.apache.activemq.store.MessageRecoveryListener;
import org.apache.activemq.store.MessageStore;
import org.apache.activemq.store.AbstractMessageStore;
import org.apache.activemq.store.jpa.model.StoredMessage;
import org.apache.activemq.usage.MemoryUsage;
import org.apache.activemq.usage.SystemUsage;
@ -37,17 +38,16 @@ import org.apache.activemq.util.ByteSequence;
import org.apache.activemq.util.IOExceptionSupport;
import org.apache.activemq.wireformat.WireFormat;
public class JPAMessageStore implements MessageStore {
public class JPAMessageStore extends AbstractMessageStore {
protected final JPAPersistenceAdapter adapter;
protected final WireFormat wireFormat;
protected final ActiveMQDestination destination;
protected final String destinationName;
protected AtomicLong lastMessageId = new AtomicLong(-1);
public JPAMessageStore(JPAPersistenceAdapter adapter, ActiveMQDestination destination) {
super(destination);
this.adapter = adapter;
this.destination = destination;
this.destinationName = destination.getQualifiedName();
this.wireFormat = this.adapter.getWireFormat();
}
@ -76,10 +76,6 @@ public class JPAMessageStore implements MessageStore {
adapter.commitEntityManager(context, manager);
}
public ActiveMQDestination getDestination() {
return destination;
}
public Message getMessage(MessageId identity) throws IOException {
Message rc;
EntityManager manager = adapter.beginEntityManager(null);
@ -190,13 +186,4 @@ public class JPAMessageStore implements MessageStore {
public void resetBatching() {
lastMessageId.set(-1);
}
public void setMemoryUsage(MemoryUsage memoeyUSage){
}
public void start() throws Exception {
}
public void stop() throws Exception {
}
}

View File

@ -32,24 +32,24 @@ import org.apache.activemq.command.MessageAck;
import org.apache.activemq.command.MessageId;
import org.apache.activemq.store.MessageRecoveryListener;
import org.apache.activemq.store.ReferenceStore;
import org.apache.activemq.store.AbstractMessageStore;
import org.apache.activemq.store.jpa.model.StoredMessageReference;
import org.apache.activemq.usage.MemoryUsage;
import org.apache.activemq.usage.SystemUsage;
import org.apache.activemq.util.IOExceptionSupport;
import org.apache.activemq.wireformat.WireFormat;
public class JPAReferenceStore implements ReferenceStore {
public class JPAReferenceStore extends AbstractMessageStore implements ReferenceStore {
protected final JPAPersistenceAdapter adapter;
protected final WireFormat wireFormat;
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) {
super(destination);
this.adapter = adapter;
this.destination = destination;
this.destinationName = destination.getQualifiedName();
this.wireFormat = this.adapter.getWireFormat();
}
@ -58,10 +58,6 @@ public class JPAReferenceStore implements ReferenceStore {
return lock;
}
public ActiveMQDestination getDestination() {
return destination;
}
public void addMessage(ConnectionContext context, Message message) throws IOException {
throw new RuntimeException("Use addMessageReference instead");
}
@ -206,15 +202,6 @@ public class JPAReferenceStore implements ReferenceStore {
lastMessageId.set(-1);
}
public void setMemoryUsage(MemoryUsage memoeyUSage){
}
public void start() throws Exception {
}
public void stop() throws Exception {
}
public void setBatch(MessageId startAfter) {
}