KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > impl > store > raw > xact > SavePoint


1 /*
2
3    Derby - Class org.apache.derby.impl.store.raw.xact.SavePoint
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.derby.impl.store.raw.xact;
23
24 import org.apache.derby.iapi.store.raw.log.LogInstant;
25
26 import org.apache.derby.iapi.services.sanity.SanityManager;
27
28 class SavePoint
29 {
30     /*
31     ** Fields
32     */

33
34     private LogInstant savePoint;
35     private final String JavaDoc name;
36     //kindOfSavepoint can have 3 possible values.
37
//A NULL value means it is an internal savepoint (ie not a user defined savepoint)
38
//Non NULL value means it is a user defined savepoint which can be a SQL savepoint or a JDBC savepoint
39
// A String value for kindOfSavepoint would mean it is SQL savepoint
40
// A JDBC Savepoint object value for kindOfSavepoint would mean it is JDBC savepoint
41
private Object JavaDoc kindOfSavepoint;
42
43     /*
44     ** Constructor
45     */

46
47     SavePoint(String JavaDoc name, Object JavaDoc kindOfSavepoint) {
48         super();
49         this.name = name;
50         this.kindOfSavepoint = kindOfSavepoint;
51     }
52
53
54     void setSavePoint(LogInstant savePoint) {
55         if (SanityManager.DEBUG)
56         {
57             SanityManager.ASSERT((savePoint == null) || (this.savePoint == null));
58         }
59
60         this.savePoint = savePoint;
61     }
62
63     LogInstant getSavePoint() {
64         return savePoint;
65     }
66
67     String JavaDoc getName() {
68         return name;
69     }
70
71     boolean isThisUserDefinedsavepoint() {
72         return (kindOfSavepoint != null ? true : false);
73     }
74
75     Object JavaDoc getKindOfSavepoint() {
76         return kindOfSavepoint;
77     }
78
79 }
80
Popular Tags