|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.objectweb.jonas_ejb.container.jorm.GenClassImpl
This class is a basic implementation of the PGenClassAccessor interface usefull for the multivalued relation.
Nested Class Summary | |
protected class |
GenClassImpl.ElementIterator
this class is an implementation of the Iterator interface which return only the existing objects. |
Field Summary | |
protected int[] |
deletedLength
This array represents the distance between two deleted elements in the pIndexedElems arraylist. |
protected JEntityContext |
ectx
|
protected org.objectweb.jorm.api.PClassMapping |
gcm
This field references the PClassMapping which manages the persistency of this GenClass. |
protected boolean |
isModified
true when GenClass has been modified and must be written |
protected GenClassListener |
listener
All the actions are send to this listener. |
protected org.objectweb.jorm.api.PBinding |
pb
This fields is the PBinding associated to this instance. |
protected java.util.ArrayList |
pIndexedElems
All elements of the gen class (unmodified, modified, created, deleted) This ArrayList contains GenClassElem objects |
protected boolean |
selectForUpdate
true when we want use select .. |
protected int |
size
This is the size of the relation. |
Constructor Summary | |
GenClassImpl()
A GenClassImpl object is created for each Multi-Valued CMR field See JEntityCmp2.vm It starts with an empty list. |
Method Summary | |
org.objectweb.jorm.api.PIndexedElem |
createPIndexedElem()
The default implementation of the PIndexedElem is GenClassElement. |
void |
doNotWrite(PObject po)
|
protected void |
gcAdd(PObject element,
boolean callListener)
This method add a new element in the collection. |
void |
gcClear(boolean delete)
Clear the GenClass. |
protected boolean |
gcContains(PObject element,
java.lang.Object connection)
|
protected PObject |
gcDeref(org.objectweb.jorm.naming.api.PName pn)
|
protected PObject |
gcGetElement(GenClassElement gce,
java.lang.Object connection)
It dereferences an element if needed |
org.objectweb.jorm.api.PBinding |
gcGetPBinding()
Get the PBinding used for this GenClass Used by JEntityCmp2.vm |
protected int |
gcGetRealIndex(int idx)
This method calculates the real index of an element. |
int |
gcGetSize()
|
boolean |
gcIsModified()
|
protected java.util.Iterator |
gcIterator()
|
protected java.util.Iterator |
gcIterator(java.lang.Object connection)
|
protected org.objectweb.jorm.naming.api.PName |
gcObject2ref(PObject value)
This method permits to find the PName of an object. |
protected java.lang.Object |
gcRemove(java.lang.Object element,
boolean callListener)
It removes the first occurence of an element from the relation. |
GenClassListener |
getListener()
|
java.lang.Object |
getMemoryInstance()
In most of cases this class is extented to personalize to a collection type. |
void |
paAdd(org.objectweb.jorm.api.PIndexedElem elem,
java.lang.Object conn)
It adds the elements in the list. |
boolean |
paDeltaSupported()
This implementation is able to isolate the modification by element of the gen class. |
int |
paGetNbElem()
This method is used by the PBinding to allocated data structure during a write operation. |
java.util.Iterator |
paIterator()
This method is used by the PBinding to fetch all PIndexedElem. |
void |
paSetNbElem(int nbelem)
This method is call in first during a read operation in order to indicate the size of the gen class. |
void |
printState()
|
void |
read(org.objectweb.jorm.naming.api.PName pn,
java.lang.Object connection,
java.lang.Object tx)
It loads the data of the gen class. |
void |
reset()
reset the GenClass to its initial state. |
void |
setEntityContext(JEntityContext ectx)
Set the EntityContext needed for setDirty calls |
void |
setListener(GenClassListener gcl)
|
void |
setPBinding(org.objectweb.jorm.api.PBinding pb)
Set the PBinding that will be used for this GenClass Used by JEntityCmp2.vm |
void |
setPClassMapping(org.objectweb.jorm.api.PClassMapping gcm)
Set the PClassMapping for this GenClass. |
void |
write(org.objectweb.jorm.naming.api.PName pn,
java.lang.Object connection)
It writes the data of the gen class if it was modified (see the field isModified). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.ArrayList pIndexedElems
protected int[] deletedLength
protected int size
protected boolean isModified
protected boolean selectForUpdate
protected org.objectweb.jorm.api.PClassMapping gcm
protected JEntityContext ectx
protected org.objectweb.jorm.api.PBinding pb
protected GenClassListener listener
Constructor Detail |
public GenClassImpl()
Method Detail |
public void setPClassMapping(org.objectweb.jorm.api.PClassMapping gcm)
gcm
- the PClassMappingpublic void setEntityContext(JEntityContext ectx)
public void reset()
public void setPBinding(org.objectweb.jorm.api.PBinding pb)
pb
- The PBinding for this GenClasspublic org.objectweb.jorm.api.PBinding gcGetPBinding()
public void setListener(GenClassListener gcl)
public GenClassListener getListener()
public boolean gcIsModified()
public void read(org.objectweb.jorm.naming.api.PName pn, java.lang.Object connection, java.lang.Object tx) throws org.objectweb.jorm.api.PException
pn
- is the PName of the genclassconnection
- is a connection to access to the support. If it is null
a connection is asked to the mapper and closed after its use.
org.objectweb.jorm.api.PException
public void write(org.objectweb.jorm.naming.api.PName pn, java.lang.Object connection) throws org.objectweb.jorm.api.PException
pn
- is the PName of the genclassconnection
- is a connection to access to the support. If it is null
a connection is asked to the mapper and closed after its use.
org.objectweb.jorm.api.PException
public void doNotWrite(PObject po)
public java.lang.Object getMemoryInstance()
getMemoryInstance
in interface org.objectweb.jorm.api.PAccessor
public void paAdd(org.objectweb.jorm.api.PIndexedElem elem, java.lang.Object conn) throws org.objectweb.jorm.api.PException
paAdd
in interface org.objectweb.jorm.api.PGenClassAccessor
org.objectweb.jorm.api.PException
public org.objectweb.jorm.api.PIndexedElem createPIndexedElem()
createPIndexedElem
in interface org.objectweb.jorm.api.PIndexedElemFactory
public boolean paDeltaSupported()
paDeltaSupported
in interface org.objectweb.jorm.api.PGenClassAccessor
public int paGetNbElem()
paGetNbElem
in interface org.objectweb.jorm.api.PGenClassAccessor
public java.util.Iterator paIterator()
paIterator
in interface org.objectweb.jorm.api.PGenClassAccessor
public void paSetNbElem(int nbelem)
paSetNbElem
in interface org.objectweb.jorm.api.PGenClassAccessor
protected int gcGetRealIndex(int idx)
idx
- the index valid in the colllection
protected void gcAdd(PObject element, boolean callListener)
element
- the object to addcallListener
- indicates if the gen class listener must be call
about this actionprotected java.lang.Object gcRemove(java.lang.Object element, boolean callListener) throws org.objectweb.jorm.api.PException
element
- an element which must be removedcallListener
- indicates if the gen class listener must be call
about this action
org.objectweb.jorm.api.PException
public int gcGetSize()
protected boolean gcContains(PObject element, java.lang.Object connection) throws org.objectweb.jorm.api.PException
org.objectweb.jorm.api.PException
protected java.util.Iterator gcIterator() throws org.objectweb.jorm.api.PException
org.objectweb.jorm.api.PException
protected java.util.Iterator gcIterator(java.lang.Object connection) throws org.objectweb.jorm.api.PException
connection
- the connection to use during the PName resolving (if it has not
already dereferenced).
org.objectweb.jorm.api.PException
protected PObject gcGetElement(GenClassElement gce, java.lang.Object connection) throws org.objectweb.jorm.api.PException
gce
- is the PIndexedElem which must be dereferencedconnection
- a connection to use to resolve the PName. If this parameter is
null a new connection is allocate via the mapper.
This connection is closed just after its use.
org.objectweb.jorm.api.PException
public void gcClear(boolean delete)
delete
- true if cascade delete must be checked (ONE - MANY)protected PObject gcDeref(org.objectweb.jorm.naming.api.PName pn)
protected org.objectweb.jorm.naming.api.PName gcObject2ref(PObject value) throws org.objectweb.jorm.api.PException
org.objectweb.jorm.api.PException
public void printState()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |