KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > speedo > genclass > GenClassElement


1 /**
2  * Copyright (C) 2001-2004 France Telecom R&D
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */

18 package org.objectweb.speedo.genclass;
19
20 import org.objectweb.jorm.api.PIndexedElem;
21 import org.objectweb.speedo.mim.api.SpeedoAccessor;
22
23 import javax.jdo.PersistenceManager;
24
25 /**
26  * Represents a element of a gen class. It matches to a reference element or
27  * a primitive element.
28  *
29  * @author S.Chassande-Barrioz
30  */

31 public interface GenClassElement extends PIndexedElem {
32
33     /**
34      * @return the index of this gen class element, possibly wrapped in an object.
35      */

36     Object JavaDoc getIndex();
37
38     /**
39      * Assignes the index of the element of the gen class. It is a user object.
40      * @param index to add, it cannot be null.
41      */

42     void setIndex (Object JavaDoc index);
43
44     /**
45      * @return the element of the gen class. It is a user object.
46      */

47     Object JavaDoc getElement();
48
49     /**
50      * Assignes the element of the gen class. It is a user object.
51      * @param element to add, it cannot be null.
52      */

53     void setElement(Object JavaDoc element);
54
55     /**
56      * @param pm is the persistence manager which permits to resolve the PName
57      * into a java reference.
58      * @return the element of the gen class. The element is a reference
59      * (SpeedoProxy).
60      */

61     Object JavaDoc getElement(PersistenceManager pm);
62
63     /**
64      * Assignes the jorm status of the PIndexedElement
65      * @param s the new status
66      */

67     void setStatus(byte s);
68
69
70     /**
71      * Retrieves the Speedo accessor associated to this gen class element.
72      */

73     SpeedoAccessor getSpeedoAccessor();
74
75     /**
76      * In case of the element of the generic class is a persistent class. The
77      * implementation of this method should replace the direct reference to
78      * the persistent object by its identifier (PName). The aim of the
79      * unswizzling feature is to permit to the cache to garbage unused instance.
80      * This unswizzling is done at commit time usualy.
81      */

82     void unSwizzle();
83     
84     /**
85      * When thin lock is enabled (locking managed at genclass element level
86      * instead of at genclass level), this method store the current status of
87      * the genclass element into another variable. This status is in fact the
88      * status of the genclass element during the working set. If the element
89      * is modified, the change(delta) has to be report on the reference state
90      * (cache) at commit time.
91      * @return a byte indicating the retained status
92      */

93     byte retainStatusForMerge();
94     
95     /**
96      * Forget the retained status.
97      * @see #retainStatusForMerge()
98      */

99     void cleanStatusForMerge();
100     
101     /**
102      * @return the retained status
103      * @see #retainStatusForMerge()
104      */

105     byte getStatusForMerge();
106     
107     /**
108      * @return a clone of the current gen class element.
109      */

110     GenClassElement cloneGCE();
111 }
112
Popular Tags