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
abstract  void attachCopy(ProxyManager pm, java.util.Map map, SpeedoAccessor fieldsClone, boolean makeTransactional)
           
 PIndexedElem createPIndexedElem()
           
abstract  PIndexedElem createPIndexedElem(GenClassAccessor gca)
           
abstract  void deletePersistent(ProxyManager pm)
           
abstract  void detachCopy(ProxyManager pm, java.util.Map map, SpeedoAccessor fieldsClone, java.util.Collection fgHints)
           
 Logger getLogger()
           
 java.lang.Object getMemoryInstance()
           
 void loadFields(ProxyManager pm, long[] fields)
           
abstract  void loadFieldsFromAccessor(SpeedoAccessor sa)
           
abstract  void makePersistent(ProxyManager pm)
           
 void makePersistent(ProxyManager pm, java.util.Iterator it)
           
 void makePersistent(ProxyManager pm, SpeedoProxy sp)
           
 void paAdd(PIndexedElem elem, java.lang.Object conn)
           
 boolean paDeltaSupported()
           
 int paGetNbElem()
           
 java.util.Iterator paIterator()
           
 void paSetNbElem(int nbelem)
           
abstract  void refresh(ProxyManager pm, java.util.Map map, java.util.Collection fgHints)
           
abstract  void retrieve(ProxyManager pm, java.util.Map map, java.util.Collection fgHints)
           
abstract  void setElements(java.lang.Object o)
           
 void setFlushed(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
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, getSpeedoProxy, getTimeStamp, hasBeenFlush, jdoChangeStatus, jdoGetStatus, jdoSetStatus, prepareWrite, setDetachedStatus, setSpeedoProxy, 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

loadFieldsFromAccessor

public abstract void loadFieldsFromAccessor(SpeedoAccessor sa)

createPIndexedElem

public abstract PIndexedElem createPIndexedElem(GenClassAccessor gca)

setElements

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

getLogger

public Logger getLogger()

makePersistent

public void makePersistent(ProxyManager pm,
                           SpeedoProxy sp)

makePersistent

public void makePersistent(ProxyManager pm,
                           java.util.Iterator it)

setFlushed

public void setFlushed(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:
setFlushed in interface SpeedoAccessor
Overrides:
setFlushed 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

loadFields

public void loadFields(ProxyManager pm,
                       long[] fields)
Specified by:
loadFields in interface SpeedoAccessor

deletePersistent

public abstract void deletePersistent(ProxyManager pm)
Specified by:
deletePersistent in interface SpeedoAccessor

makePersistent

public abstract void makePersistent(ProxyManager pm)
Specified by:
makePersistent in interface SpeedoAccessor

detachCopy

public abstract void detachCopy(ProxyManager pm,
                                java.util.Map map,
                                SpeedoAccessor fieldsClone,
                                java.util.Collection fgHints)
Specified by:
detachCopy in interface SpeedoAccessor

attachCopy

public abstract void attachCopy(ProxyManager pm,
                                java.util.Map map,
                                SpeedoAccessor fieldsClone,
                                boolean makeTransactional)
Specified by:
attachCopy in interface SpeedoAccessor

refresh

public abstract void refresh(ProxyManager pm,
                             java.util.Map map,
                             java.util.Collection fgHints)
Specified by:
refresh in interface SpeedoAccessor

retrieve

public abstract void retrieve(ProxyManager pm,
                              java.util.Map map,
                              java.util.Collection fgHints)
Specified by:
retrieve in interface SpeedoAccessor

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)