comparison src/org/dancres/blitz/meta/RegistryAccessorImpl.java @ 0:3dc0c5604566

Initial checkin of blitz 2.0 fcs - no installer yet.
author Dan Creswell <dan.creswell@gmail.com>
date Sat, 21 Mar 2009 11:00:06 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:3dc0c5604566
1 package org.dancres.blitz.meta;
2
3 import java.io.IOException;
4 import java.io.Serializable;
5
6 import org.dancres.blitz.disk.DiskTxn;
7
8 class RegistryAccessorImpl implements RegistryAccessor {
9 private DiskTxn theTxn;
10 private RegistryImpl theRegistry;
11
12 RegistryAccessorImpl(RegistryImpl aRegistry) {
13 this(aRegistry, DiskTxn.getActiveTxn());
14 }
15
16 RegistryAccessorImpl(RegistryImpl aRegistry, DiskTxn aTxn) {
17 theTxn = aTxn;
18 theRegistry = aRegistry;
19 }
20
21 public byte[] loadRaw(byte[] aKey) throws IOException {
22 return theRegistry.loadRaw(theTxn, aKey);
23 }
24
25 public Serializable load(byte[] aKey) throws IOException {
26 return theRegistry.load(theTxn, aKey);
27 }
28
29 public void save(byte[] aKey, Serializable anObject) throws IOException {
30 theRegistry.save(theTxn, aKey, anObject);
31 }
32
33 public void delete(byte[] aKey) throws IOException {
34 theRegistry.delete(theTxn, aKey);
35 }
36
37 public MetaIterator readAll() throws IOException {
38 return theRegistry.readAll(theTxn);
39 }
40 }