|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | 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.
Inner 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 org.objectweb.jorm.api.PClassMapping |
gcm
This field reference the PClassMapping which manages the persistency of the instanceof of this class. |
protected boolean |
isModified
|
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 PIndexedElem objects |
protected int |
size
This is the size of the relation. |
Constructor Summary | |
GenClassImpl()
It buils an empty list. |
|
GenClassImpl(org.objectweb.jorm.api.PClassMapping gcm)
It buils 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 isMaster,
boolean callListener)
This method add a new element in the collection. |
protected void |
gcClear()
|
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()
|
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 isMaster,
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. if the value is equals to -1 then that means the data support is unable to known the size of the relation in advance. |
void |
printState()
|
void |
read(org.objectweb.jorm.naming.api.PName pn,
java.lang.Object connection)
It loads the data of the gen class. |
void |
reset()
|
void |
setListener(GenClassListener gcl)
|
void |
setPBinding(org.objectweb.jorm.api.PBinding pb)
|
void |
setPClassMapping(org.objectweb.jorm.api.PClassMapping gcm)
|
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 org.objectweb.jorm.api.PClassMapping gcm
protected org.objectweb.jorm.api.PBinding pb
protected GenClassListener listener
Constructor Detail |
public GenClassImpl(org.objectweb.jorm.api.PClassMapping gcm)
public GenClassImpl()
Method Detail |
public void setPClassMapping(org.objectweb.jorm.api.PClassMapping gcm)
public void reset()
public void setPBinding(org.objectweb.jorm.api.PBinding pb)
public 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) 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.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.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
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)
is
- the index valid in the colllectionprotected void gcAdd(PObject element, boolean isMaster, boolean callListener)
element
- the object to addis
- the status of the added element if it has not been already
removed in the collectioncallListener
- indicates if the gen class listener must be call
about this actionprotected java.lang.Object gcRemove(java.lang.Object element, boolean isMaster, boolean callListener) throws org.objectweb.jorm.api.PException
an
- element which must be removedis
- the status of the removed elementcallListener
- indicates if the gen class listener must be call
about this actionpublic int gcGetSize()
protected boolean gcContains(PObject element, java.lang.Object connection) throws org.objectweb.jorm.api.PException
protected java.util.Iterator gcIterator() throws org.objectweb.jorm.api.PException
protected java.util.Iterator gcIterator(java.lang.Object connection) throws org.objectweb.jorm.api.PException
is
- the connection to use during the PName resolving (if it has not
already dereferenced).protected PObject gcGetElement(GenClassElement gce, java.lang.Object connection) throws org.objectweb.jorm.api.PException
gce
- is the PIndexedElem which must be dereferenceda
- 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.protected void gcClear()
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
public void printState()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |