01: package org.apache.ojb.odmg.states;
02:
03: /* Copyright 2002-2005 The Apache Software Foundation
04: *
05: * Licensed under the Apache License, Version 2.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: import org.apache.ojb.odmg.ObjectEnvelope;
19:
20: /**
21: * this state represents old Objects (i.e. already persistent but not changed during tx)
22: * --> no need to do anything for commit or rollback
23: */
24: public class StateOldClean extends ModificationState {
25: private static StateOldClean _instance = new StateOldClean();
26:
27: /**
28: * private constructor: use singleton instance
29: */
30: private StateOldClean() {
31:
32: }
33:
34: /**
35: * perform a checkpoint, i.e. perform updates on underlying db but keep locks on objects
36: */
37: public static StateOldClean getInstance() {
38: return _instance;
39: }
40:
41: /**
42: * return resulting state after marking clean
43: */
44: public ModificationState markClean() {
45: return this ;
46: }
47:
48: /**
49: * return resulting state after marking delete
50: */
51: public ModificationState markDelete() {
52: return StateOldDelete.getInstance();
53: }
54:
55: /**
56: * return resulting state after marking dirty
57: */
58: public ModificationState markDirty() {
59: return StateOldDirty.getInstance();
60: }
61:
62: /**
63: * return resulting state after marking new
64: */
65: public ModificationState markNew() {
66: return this ;
67: }
68:
69: /**
70: * return resulting state after marking old
71: */
72: public ModificationState markOld() {
73: return this ;
74: }
75:
76: /**
77: * rollback the ObjectModification
78: */
79: public void checkpoint(ObjectEnvelope mod) {
80:
81: }
82:
83: /**
84: * commit the associated transaction
85: */
86: public void commit(ObjectEnvelope mod) {
87:
88: }
89:
90: /**
91: *
92: */
93: public void rollback(ObjectEnvelope mod) {
94:
95: }
96: }
|