01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.test.transactions;
05:
06: /**
07: * A {@link TransactionalObject} that doesn't actually check anything.
08: */
09: public class NullTransactionalObject implements TransactionalObject {
10:
11: private static class NullContext implements
12: TransactionalObject.Context {
13: // Nothing here.
14: }
15:
16: private static final Context CONTEXT = new NullContext();
17:
18: public Context startWrite(Object value) {
19: return CONTEXT;
20: }
21:
22: public Context startWrite(Object value, long now) {
23: return CONTEXT;
24: }
25:
26: public void endWrite(Context rawWrite) {
27: // Nothing here.
28: }
29:
30: public void endWrite(Context rawWrite, long now) {
31: // Nothing here.
32: }
33:
34: public Context startRead() {
35: return CONTEXT;
36: }
37:
38: public Context startRead(long now) {
39: return CONTEXT;
40: }
41:
42: public void endRead(Context rawRead, Object result) {
43: // Nothing here.
44: }
45:
46: public void endRead(Context rawRead, Object result, long now) {
47: // Nothing here.
48: }
49:
50: }
|