use of com.swiftmq.impl.store.standard.swap.SwapAddress in project swiftmq-ce by iitsoftware.
the class NonPersistentStoreImpl method get.
public StoreEntry get(Object key) throws StoreException {
if (ctx.traceSpace.enabled)
ctx.traceSpace.trace("sys$store", toString() + "/get, key=" + key);
StoreEntry entry = null;
try {
SwapAddress sa = (SwapAddress) key;
entry = sa.swapFile.get(sa.filePointer);
entry.key = key;
} catch (Exception e) {
throw new StoreException(e.getMessage());
}
if (ctx.traceSpace.enabled)
ctx.traceSpace.trace("sys$store", toString() + "/get done, key=" + key + ", entry=" + entry);
return entry;
}
use of com.swiftmq.impl.store.standard.swap.SwapAddress in project swiftmq-ce by iitsoftware.
the class NonPersistentStoreImpl method delete.
public void delete(Object key) throws StoreException {
if (ctx.traceSpace.enabled)
ctx.traceSpace.trace("sys$store", toString() + "/delete, key=" + key);
try {
SwapAddress sa = (SwapAddress) key;
sa.swapFile.remove(sa.filePointer);
if (sa.swapFile.getNumberMessages() == 0) {
sa.swapFile.close();
swapFiles.remove(sa.swapFile);
if (actSwapFile == sa.swapFile)
actSwapFile = null;
}
} catch (Exception e) {
throw new StoreException(e.getMessage());
}
if (ctx.traceSpace.enabled)
ctx.traceSpace.trace("sys$store", toString() + "/delete done, key=" + key);
}
use of com.swiftmq.impl.store.standard.swap.SwapAddress in project swiftmq-ce by iitsoftware.
the class NonPersistentStoreImpl method updateDeliveryCount.
public void updateDeliveryCount(Object key, int deliveryCount) throws StoreException {
if (ctx.traceSpace.enabled)
ctx.traceSpace.trace("sys$store", toString() + "/updateDeliveryCount, key=" + key + ", deliveryCount=" + deliveryCount);
try {
SwapAddress sa = (SwapAddress) key;
sa.swapFile.updateDeliveryCount(sa.filePointer, deliveryCount);
} catch (Exception e) {
throw new StoreException(e.getMessage());
}
if (ctx.traceSpace.enabled)
ctx.traceSpace.trace("sys$store", toString() + "/updateDeliveryCount done, key=" + key + ", deliveryCount=" + deliveryCount);
}
use of com.swiftmq.impl.store.standard.swap.SwapAddress in project swiftmq-ce by iitsoftware.
the class NonPersistentStoreImpl method insert.
public void insert(StoreEntry storeEntry) throws StoreException {
if (ctx.traceSpace.enabled)
ctx.traceSpace.trace("sys$store", toString() + "/insert, storeEntry=" + storeEntry);
try {
checkSwapFile();
SwapAddress sa = new SwapAddress();
sa.swapFile = actSwapFile;
sa.filePointer = sa.swapFile.add(storeEntry);
storeEntry.key = sa;
} catch (Exception e) {
throw new StoreException(e.getMessage());
}
if (ctx.traceSpace.enabled)
ctx.traceSpace.trace("sys$store", toString() + "/insert done, storeEntry=" + storeEntry);
}
Aggregations