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.
 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
detachedStatus, hasBeenFlush, jdoStatus, proxy
 
Constructor Summary
GenClassAccessor(SpeedoGenClassProxy jdoProxy)
           
 
Method Summary
 PIndexedElem createPIndexedElem()
           
abstract  PIndexedElem createPIndexedElem(GenClassAccessor gca)
           
 Logger getLogger()
           
 java.lang.Object getMemoryInstance()
           
abstract  void jdoAttachCopy(ProxyManager pm, java.util.Map map, SpeedoAccessor fieldsClone, boolean makeTransactional)
           
abstract  void jdoDeletePersistent(ProxyManager pm)
           
abstract  void jdoDetachCopy(ProxyManager pm, java.util.Map map, SpeedoAccessor fieldsClone, java.util.Collection fgHints)
           
abstract  void jdoLoadFieldsFromAccessor(SpeedoAccessor sa)
           
abstract  void jdoRefresh(ProxyManager pm, java.util.Map map, java.util.Collection fgHints)
           
 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)
           
abstract  void setElements(java.lang.Object o)
           
abstract  boolean speedoAdd(java.lang.Object elemToAdd, java.lang.Object hints)
          Askes the adding of an element into a generic class.
abstract  boolean speedoRemove(java.lang.Object elemToRemove, java.lang.Object hints)
          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, getDetachedStatus, getTimeStamp, jdoChangeStatus, jdoGetSpeedoProxy, jdoGetStatus, jdoHasBeenFlush, jdoSetSpeedoProxy, jdoSetStatus, prepareWrite, setDetachedStatus, setTimeStamp
 
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.

Constructor Detail

GenClassAccessor

public GenClassAccessor(SpeedoGenClassProxy jdoProxy)
Method Detail

createPIndexedElem

public abstract PIndexedElem createPIndexedElem(GenClassAccessor gca)

setElements

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

getLogger

public Logger getLogger()

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)

jdoDetachCopy

public abstract void jdoDetachCopy(ProxyManager pm,
                                   java.util.Map map,
                                   SpeedoAccessor fieldsClone,
                                   java.util.Collection fgHints)

jdoAttachCopy

public abstract void jdoAttachCopy(ProxyManager pm,
                                   java.util.Map map,
                                   SpeedoAccessor fieldsClone,
                                   boolean makeTransactional)

jdoRefresh

public abstract void jdoRefresh(ProxyManager pm,
                                java.util.Map map,
                                java.util.Collection fgHints)

speedoAdd

public abstract boolean speedoAdd(java.lang.Object elemToAdd,
                                  java.lang.Object hints)
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 abstract boolean speedoRemove(java.lang.Object elemToRemove,
                                     java.lang.Object hints)
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)