org.objectweb.speedo.genclass
Class GenClassAccessor

java.lang.Object
  extended byorg.objectweb.speedo.mim.lib.BasicSpeedoAccessor
      extended byorg.objectweb.speedo.genclass.GenClassAccessor
All Implemented Interfaces:
java.io.Serializable, SpeedoAccessor, SpeedoGenClassCoherence
Direct Known Subclasses:
CollectionAccessor, MapAccessor

public abstract class GenClassAccessor
extends BasicSpeedoAccessor
implements SpeedoGenClassCoherence

This class represents an accessor of a genclass structure. This accessor is used in case of the generic class is persistent.

Author:
S.Chassande-Barrioz
See Also:
Serialized Form

Field Summary
 java.util.List elements
          The ArrayList used to store the indexed elements of the genclass.
 java.lang.Object inner
           
 SpeedoGenClassProxy jdoProxy
          The SpeedoProxy attached to this state representation.
protected  Logger logger
           
 boolean supportDelta
          Indicates if this accessor support the dela mode
protected  GenClassElement tmpelem
          A temporary variable which is used to search an element into the "elements" list.
 
Fields inherited from class org.objectweb.speedo.mim.lib.BasicSpeedoAccessor
hasBeenFlush, jdoStatus, proxy
 
Constructor Summary
GenClassAccessor(SpeedoGenClassProxy jdoProxy)
           
 
Method Summary
 PIndexedElem createPIndexedElem()
           
abstract  PIndexedElem createPIndexedElem(GenClassAccessor gca)
           
 java.lang.Object getInner()
           
 Logger getLogger()
           
 java.lang.Object getMemoryInstance()
           
abstract  void jdoDeletePersistent(ProxyManager pm)
           
abstract  void jdoLoadFieldsFromAccessor(SpeedoAccessor sa)
           
 void jdoSetFlushed(boolean val)
          When the gen class is flushed to the data support (parameter = true), the internal structure is clean: - really remove the deleted element - mark the genclass as supporting the delta
 void paAdd(PIndexedElem elem, java.lang.Object conn)
           
 boolean paDeltaSupported()
           
 int paGetNbElem()
           
 java.util.Iterator paIterator()
           
 void paSetNbElem(int nbelem)
           
 void prepareWrite()
          To prepare the write operation the inner genclass are copied into the accessor.
abstract  void setGCValue(java.lang.Object o)
           
 void setInner(java.lang.Object inner)
           
 boolean speedoAdd(java.lang.Object elemToAdd)
          Askes the adding of an element into a generic class.
 boolean speedoRemove(java.lang.Object elemToRemove)
          Askes the removing of an element from a generic class.
 void workingSetClosed()
          At the end of the working set, the writing mode is initialized (deltaSupported), and the reference to the persistent are unswilled
 
Methods inherited from class org.objectweb.speedo.mim.lib.BasicSpeedoAccessor
getCacheEntry, jdoChangeStatus, jdoGetSpeedoProxy, jdoGetStatus, jdoHasBeenFlush, jdoSetSpeedoProxy, jdoSetStatus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jdoProxy

public SpeedoGenClassProxy jdoProxy
The SpeedoProxy attached to this state representation.


supportDelta

public boolean supportDelta
Indicates if this accessor support the dela mode


tmpelem

protected GenClassElement tmpelem
A temporary variable which is used to search an element into the "elements" list.


logger

protected Logger logger

elements

public java.util.List elements
The ArrayList used to store the indexed elements of the genclass. Then this list contains also the deleted elements.


inner

public java.lang.Object inner
Constructor Detail

GenClassAccessor

public GenClassAccessor(SpeedoGenClassProxy jdoProxy)
Method Detail

createPIndexedElem

public abstract PIndexedElem createPIndexedElem(GenClassAccessor gca)

setGCValue

public abstract void setGCValue(java.lang.Object o)

getInner

public java.lang.Object getInner()

getLogger

public Logger getLogger()

setInner

public void setInner(java.lang.Object inner)

prepareWrite

public void prepareWrite()
To prepare the write operation the inner genclass are copied into the accessor.

Specified by:
prepareWrite in interface SpeedoAccessor
Overrides:
prepareWrite in class BasicSpeedoAccessor

jdoSetFlushed

public void jdoSetFlushed(boolean val)
When the gen class is flushed to the data support (parameter = true), the internal structure is clean: - really remove the deleted element - mark the genclass as supporting the delta

Specified by:
jdoSetFlushed in interface SpeedoAccessor
Overrides:
jdoSetFlushed in class BasicSpeedoAccessor

workingSetClosed

public void workingSetClosed()
At the end of the working set, the writing mode is initialized (deltaSupported), and the reference to the persistent are unswilled

Specified by:
workingSetClosed in interface SpeedoAccessor
Overrides:
workingSetClosed in class BasicSpeedoAccessor

jdoDeletePersistent

public abstract void jdoDeletePersistent(ProxyManager pm)

jdoLoadFieldsFromAccessor

public abstract void jdoLoadFieldsFromAccessor(SpeedoAccessor sa)

speedoAdd

public boolean speedoAdd(java.lang.Object elemToAdd)
Description copied from interface: SpeedoGenClassCoherence
Askes the adding of an element into a generic class. The consistency of relations must not be managed: this is done by the caller of this method.

Specified by:
speedoAdd in interface SpeedoGenClassCoherence
Parameters:
elemToAdd - is the element to add

speedoRemove

public boolean speedoRemove(java.lang.Object elemToRemove)
Description copied from interface: SpeedoGenClassCoherence
Askes the removing of an element from a generic class. The consistency of relations must not be managed: this is done by the caller of this method.

Specified by:
speedoRemove in interface SpeedoGenClassCoherence
Parameters:
elemToRemove - is the element to remove

createPIndexedElem

public PIndexedElem createPIndexedElem()

getMemoryInstance

public java.lang.Object getMemoryInstance()
Overrides:
getMemoryInstance in class BasicSpeedoAccessor

paAdd

public void paAdd(PIndexedElem elem,
                  java.lang.Object conn)
           throws PExceptionIO
Throws:
PExceptionIO

paGetNbElem

public int paGetNbElem()

paIterator

public java.util.Iterator paIterator()

paDeltaSupported

public boolean paDeltaSupported()

paSetNbElem

public void paSetNbElem(int nbelem)