KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > test > transactions > NullTransactionalObject


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.test.transactions;
5
6 /**
7  * A {@link TransactionalObject} that doesn't actually check anything.
8  */

9 public class NullTransactionalObject implements TransactionalObject {
10
11   private static class NullContext implements TransactionalObject.Context {
12     // Nothing here.
13
}
14
15   private static final Context CONTEXT = new NullContext();
16
17   public Context startWrite(Object JavaDoc value) {
18     return CONTEXT;
19   }
20
21   public Context startWrite(Object JavaDoc value, long now) {
22     return CONTEXT;
23   }
24
25   public void endWrite(Context rawWrite) {
26     // Nothing here.
27
}
28
29   public void endWrite(Context rawWrite, long now) {
30     // Nothing here.
31
}
32
33   public Context startRead() {
34     return CONTEXT;
35   }
36
37   public Context startRead(long now) {
38     return CONTEXT;
39   }
40
41   public void endRead(Context rawRead, Object JavaDoc result) {
42     // Nothing here.
43
}
44
45   public void endRead(Context rawRead, Object JavaDoc result, long now) {
46     // Nothing here.
47
}
48
49 }
50
Popular Tags