KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > pss > runtime > common > lib > StorageObjectBase


1 /*====================================================================
2
3 OpenCCM: The Open CORBA Component Model Platform
4 Copyright (C) 2000-2004 INRIA & USTL - LIFL - GOAL
5 Contact: openccm@objectweb.org
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 USA
21
22 Initial developer(s): Christophe Demarey.
23 Contributor(s): ______________________________________.
24
25 ====================================================================*/

26
27 package org.objectweb.openccm.pss.runtime.common.lib;
28
29 /**
30  * This is a base class for Storage Objects implemented with JDO.
31  *
32  * @author <a HREF="mailto:Christophe.Demarey@lifl.fr">Christophe Demarey</a>
33  *
34  * @version 0.1
35  */

36 public abstract class StorageObjectBase
37            implements org.objectweb.openccm.pss.runtime.common.api.StorageObject
38 {
39     // ==================================================================
40
//
41
// Internal state.
42
//
43
// ==================================================================
44

45     /**
46      * Storage Object PID
47      */

48     protected byte[] _pid;
49
50     /**
51      * Storage Home Base.
52      */

53     private org.omg.CosPersistentState.StorageHomeBase _storage_home;
54
55     // ==================================================================
56
//
57
// Constructor.
58
//
59
// ==================================================================
60

61     /**
62      * The default constructor.
63      */

64     public StorageObjectBase()
65     {
66         _pid = null;
67         _storage_home = null;
68     }
69
70     // ==================================================================
71
//
72
// Internal methods.
73
//
74
// ==================================================================
75

76     // ==================================================================
77
//
78
// Public methods.
79
//
80
// ==================================================================
81

82     // ==================================================================
83
//
84
// Methods for org.omg.CosPersistentState.StorageObject
85
//
86
// ==================================================================
87

88     /**
89      * Destroy the associated Storage Object.
90      */

91     public abstract void
92     destroy_object();
93
94     /**
95      * Test if the target incarnation represents an actual storage object.
96      *
97      * @return True if the target incarnation represents an actual storage object, else false.
98      */

99     public boolean
100     object_exists()
101     {
102         // Don't know how to implement this method.
103
return true;
104     }
105
106     /**
107      * Get the PID.
108      */

109     public abstract byte[]
110     get_pid();
111
112     /**
113      * Get the short PID.
114      */

115     public byte[]
116     get_short_pid()
117     {
118         return org.objectweb.openccm.pss.runtime.common.lib.PIDHelper.get_short_pid( get_pid() );
119     }
120
121     /**
122      * Get the storage home instance that manages the target storage object instance.
123      *
124      * @return The storage home instance.
125      */

126     public org.omg.CosPersistentState.StorageHomeBase
127     get_storage_home()
128     {
129         return _storage_home;
130     }
131
132     // ==================================================================
133
//
134
// Methods for org.objectweb.openccm.pss.runtime.common.api.StorageObject
135
//
136
// ==================================================================
137

138     /**
139      * Initialize the storage object.
140      *
141      * @param storage_home - The storage home managing this object.
142      */

143     public void
144     initialize(org.omg.CosPersistentState.StorageHomeBase storage_home)
145     {
146         _storage_home = storage_home;
147     }
148 }
149
Popular Tags