KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derbyTesting > unitTests > store > T_Compensation


1 /*
2
3    Derby - Class org.apache.derbyTesting.unitTests.store.T_DaemonService
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to You under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20  */

21
22 package org.apache.derbyTesting.unitTests.store;
23
24 import org.apache.derby.iapi.store.raw.*;
25
26 import org.apache.derby.iapi.services.io.FormatIdUtil;
27 import org.apache.derby.iapi.services.io.Formatable;
28 import org.apache.derby.iapi.services.io.StoredFormatIds;
29 import org.apache.derby.iapi.error.StandardException;
30 import org.apache.derby.iapi.store.raw.log.LogInstant;
31 import org.apache.derby.iapi.util.ByteArray;
32 import java.io.IOException JavaDoc;
33 import java.io.OutputStream JavaDoc;
34 import java.io.ObjectInput JavaDoc;
35 import java.io.ObjectOutput JavaDoc;
36 import org.apache.derby.iapi.services.io.LimitObjectInput;
37
38 public class T_Compensation
39 implements Compensation
40 {
41     // no-arg constructor, required by Formatable
42
public T_Compensation() { super(); }
43
44
45     /*
46       Loggable methods
47       */

48     public void doMe(Transaction xact, LogInstant instant,
49                      LimitObjectInput in)
50     {
51         //System.out.println("Loggable.doMe("+toString()+")");
52
return;
53     }
54
55     /*
56         methods to support prepared log
57         the following two methods should not be called during recover
58     */

59
60     public ByteArray getPreparedLog()
61     { return (ByteArray) null; }
62
63     public boolean needsRedo(Transaction xact) {return false;}
64     public void releaseResource(Transaction xact) {return;}
65     public int group() { return Loggable.COMPENSATION | Loggable.RAWSTORE; }
66
67     /*
68       Compensation methods.
69       */

70     public void setUndoOp(Undoable op) {return;}
71
72     /*
73       Formatable methods
74       */

75     public void writeExternal(ObjectOutput JavaDoc out)
76     throws IOException JavaDoc
77     {return;}
78
79     public void readExternal(ObjectInput JavaDoc in)
80     throws IOException JavaDoc,ClassNotFoundException JavaDoc
81     {return;}
82
83     public int getTypeFormatId()
84     {
85         return StoredFormatIds.SERIALIZABLE_FORMAT_ID;
86     }
87 }
88
Popular Tags