|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.speedo.genclass.GenClass
This class is a basic implementation of the SpeedoGenClassProxy interface. It uses a delegate PBinding.
Field Summary | |
protected long |
age
|
protected java.lang.Object |
encodedPName
|
protected int |
fix
|
protected int |
gcid
Id of the field that references this gen class instance |
protected boolean |
jdoIsActive
This fields indicates if the proxy is active (attached to at least a Proxy Manager) |
protected java.lang.String |
linkedField
The linked field associated to this gen class |
protected java.util.List |
listeners
List of SpeedoGenClassListener |
Logger |
logger
The logger used to trace this generic class |
protected java.lang.String |
mapperName
is the name of the mapper inside which the generic class is persistent |
protected PBindingCtrl |
pbinding
is the PBinding which permits to store/load the data into/from the support |
protected java.lang.Object |
pnameHints
Is the PName which |
protected java.lang.String |
projectName
is the name of the project name inside which the generic class is used. |
protected PType |
ptype
is the type of the generic class |
Constructor Summary | |
GenClass()
|
Method Summary | |
void |
bind(PName name)
|
void |
copyAccessor(SpeedoAccessor src,
SpeedoAccessor dest)
Copies persistent fields from an accessor to another. |
abstract SpeedoAccessor |
createAccessor()
|
boolean |
elementIsReference()
|
boolean |
exist(java.lang.Object o)
|
PName |
export(java.lang.Object o)
|
PName |
export(java.lang.Object o,
java.lang.Object o1)
|
void |
fireSpeedoElementAdded(java.lang.Object elem)
Notifies the listeners of this gen class that an element has been added to this gen class. |
void |
fireSpeedoElementRemoved(java.lang.Object elem)
Notifies the listeners of this gen class that an element has been removed to this gen class. |
void |
fixCe()
|
long |
getCeAge()
|
int |
getCeFixCount()
|
java.lang.Object |
getCeIdentifier()
|
java.lang.Object |
getCeObject()
|
java.lang.Object |
getDataIdentifier(java.lang.Object o)
|
java.util.Collection |
getDataIdentifiers(java.util.Collection os)
|
java.lang.Object |
getEncodedPName()
|
Logger |
getLogger()
|
LoggerFactory |
getLoggerFactory()
|
PClassMapping |
getPClassMapping()
|
PName |
getPName()
|
abstract SpeedoAccessor |
getReferenceAccessor()
|
SpeedoAccessor |
getSpeedoAccessor()
It retrieves the SpeedoAccessor instance used in the current context. |
java.util.Collection |
getSpeedoAccessors()
|
SpeedoHome |
getSpeedoHome()
|
byte |
getStatus()
|
void |
init(PClassMapping mapping)
|
void |
init(PType _ptype,
java.lang.String _linkedField,
java.lang.Object _pnameHints,
Logger _logger)
Initializes a Genclass instance |
void |
jdoCopyFields(java.lang.Object pc,
int[] fieldNumbers)
|
void |
jdoCopyKeyFieldsFromObjectId(PersistenceCapable.ObjectIdFieldConsumer objectIdFieldConsumer,
java.lang.Object o)
|
void |
jdoCopyKeyFieldsToObjectId(java.lang.Object o)
|
void |
jdoCopyKeyFieldsToObjectId(PersistenceCapable.ObjectIdFieldSupplier objectIdFieldSupplier,
java.lang.Object o)
|
java.lang.String |
jdoGetGenClassId()
|
java.lang.String |
jdoGetJdoFileName()
|
java.lang.Object |
jdoGetObjectId()
|
PBinding |
jdoGetPBinding()
|
PersistenceManager |
jdoGetPersistenceManager()
|
java.lang.Object |
jdoGetPNameHints()
Retrieves the hints needed to build the PName of the persistent object during the export action. |
PType |
jdoGetPType()
|
java.lang.Object |
jdoGetTransactionalObjectId()
|
boolean |
jdoIsActive()
Tests whether the Proxy infrastructure has already been set. |
void |
jdoIsActive(boolean newvalue)
Sets the new value of the proxy flags |
boolean |
jdoIsDeleted()
|
boolean |
jdoIsDetached()
|
boolean |
jdoIsDirty()
|
boolean |
jdoIsNew()
|
boolean |
jdoIsPersistent()
|
boolean |
jdoIsTransactional()
|
void |
jdoMakeDirty(java.lang.String fieldName)
|
PersistenceCapable |
jdoNewInstance(StateManager sm)
|
PersistenceCapable |
jdoNewInstance(StateManager sm,
java.lang.Object oid)
|
java.lang.Object |
jdoNewObjectIdInstance()
|
java.lang.Object |
jdoNewObjectIdInstance(java.lang.String s)
|
void |
jdoProvideField(int fieldNumber)
|
void |
jdoProvideFields(int[] fieldNumbers)
|
void |
jdoReplaceField(int fieldNumber)
|
void |
jdoReplaceFields(int[] fieldNumbers)
|
void |
jdoReplaceFlags()
|
void |
jdoReplaceObjectId(java.lang.Object arg0)
|
void |
jdoReplaceStateManager(StateManager sm)
|
void |
jdoSetLinkedField(java.lang.String lf)
Assignes the linked field name for this generic class. |
void |
jdoSetPBinding(PBinding pb)
assignes the PBinding to use to load/store the generic class Call this method with null value means that the generic is no more persistent. |
void |
jdoSetPNameHints(java.lang.Object hints)
Assignes the hints needed to build the PName of the persistent object during the export action. |
void |
jdoSetPType(PType _ptype)
Assignes the PType of the generic class. |
void |
read(java.lang.Object o,
PAccessor accessor)
|
void |
read(java.lang.Object o,
PAccessor pAccessor,
java.lang.Object o1)
|
void |
removeSpeedoAccessor(SpeedoAccessor sa)
|
void |
setCeAge(long l)
|
void |
setElements(java.lang.Object o)
Assignes the new value of the generic class (Collection, Map or Array or ...). |
void |
setEncodedPName(java.lang.Object _encodedPName)
Set the encoded PName of the detach copy to allow serialization. |
void |
setLogger(Logger _logger)
|
void |
setLoggerFactory(LoggerFactory loggerfactory)
|
void |
setPName(PName pName)
|
abstract void |
setReferenceAccessor(SpeedoAccessor refAcc)
Assignes the reference accessor to the SpeedoProxy The Reference accessor is used for non persistent instance, as cache value and for pessimistic policy. |
void |
setStatus(byte b)
|
void |
speedoAdd(java.lang.Object elem,
int gcFieldNumber)
Adds an element in the gen class field whose number is given. |
boolean |
speedoAdd(java.lang.Object elemToAdd,
java.lang.Object hints)
Askes the adding of an element into a generic class. |
void |
speedoAddGenClassListener(SpeedoGenClassListener l)
Adds a listener to this gen class instance. |
boolean |
speedoRemove(java.lang.Object elemToRemove,
java.lang.Object hints)
Askes the removing of an element from a generic class. |
void |
speedoSetGcId(int _gcid)
Sets the id of this gen class instance (id of the field that references this instance). |
void |
unbind()
|
void |
unexport(java.lang.Object o)
|
void |
unfixCe()
|
void |
write(java.lang.Object o,
PAccessor accessor)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.objectweb.speedo.genclass.api.SpeedoGenClassProxy |
clear, createGenClass |
Field Detail |
protected boolean jdoIsActive
protected PBindingCtrl pbinding
public Logger logger
protected java.lang.String mapperName
protected java.lang.String projectName
protected PType ptype
protected java.lang.String linkedField
protected java.lang.Object pnameHints
protected int gcid
protected java.util.List listeners
protected long age
protected int fix
protected java.lang.Object encodedPName
Constructor Detail |
public GenClass()
Method Detail |
public void init(PType _ptype, java.lang.String _linkedField, java.lang.Object _pnameHints, Logger _logger)
SpeedoGenClassProxy
init
in interface SpeedoGenClassProxy
_ptype
- is the PType of the genclass_linkedField
- is the name of the field referencing the genclass_pnameHints
- is a helper using for the identifier allocation (export)
persistent_logger
- is the logger instance for logging.public void jdoSetPNameHints(java.lang.Object hints)
SpeedoGenClassProxy
jdoSetPNameHints
in interface SpeedoGenClassProxy
public boolean elementIsReference()
public void speedoSetGcId(int _gcid)
SpeedoGenClassProxy
speedoSetGcId
in interface SpeedoGenClassProxy
_gcid
- the new id of this gen class instance.public void speedoAddGenClassListener(SpeedoGenClassListener l)
SpeedoGenClassProxy
speedoAddGenClassListener
in interface SpeedoGenClassProxy
l
- a gen class listener.public void speedoAdd(java.lang.Object elem, int gcFieldNumber)
SpeedoProxy
speedoAdd
in interface SpeedoProxy
public boolean speedoAdd(java.lang.Object elemToAdd, java.lang.Object hints)
SpeedoGenClassCoherence
speedoAdd
in interface SpeedoGenClassCoherence
elemToAdd
- is the element to addpublic boolean speedoRemove(java.lang.Object elemToRemove, java.lang.Object hints)
SpeedoGenClassCoherence
speedoRemove
in interface SpeedoGenClassCoherence
elemToRemove
- is the element to removepublic void fireSpeedoElementAdded(java.lang.Object elem)
SpeedoGenClassProxy
fireSpeedoElementAdded
in interface SpeedoGenClassProxy
elem
- the element that has been added.public void fireSpeedoElementRemoved(java.lang.Object elem)
SpeedoGenClassProxy
fireSpeedoElementRemoved
in interface SpeedoGenClassProxy
elem
- the element that has been removed.public java.lang.Object getDataIdentifier(java.lang.Object o)
public java.util.Collection getDataIdentifiers(java.util.Collection os)
public abstract SpeedoAccessor createAccessor()
createAccessor
in interface SpeedoProxy
public abstract SpeedoAccessor getReferenceAccessor()
getReferenceAccessor
in interface SpeedoProxy
public abstract void setReferenceAccessor(SpeedoAccessor refAcc)
SpeedoProxy
setReferenceAccessor
in interface SpeedoProxy
refAcc
- the new reference accessorpublic void bind(PName name) throws PException
PException
public boolean exist(java.lang.Object o) throws PException
PException
public PName export(java.lang.Object o) throws PException
PException
public PName export(java.lang.Object o, java.lang.Object o1) throws PException
PException
public PClassMapping getPClassMapping()
public PName getPName()
public byte getStatus()
public void setPName(PName pName)
public void setStatus(byte b)
public void init(PClassMapping mapping) throws PException
PException
public void read(java.lang.Object o, PAccessor accessor) throws PException
PException
public void read(java.lang.Object o, PAccessor pAccessor, java.lang.Object o1) throws PException
PException
public void unbind() throws PException
PException
public void unexport(java.lang.Object o) throws PException
PException
public void write(java.lang.Object o, PAccessor accessor) throws PException
PException
public PersistenceManager jdoGetPersistenceManager()
public void jdoReplaceFlags()
public PersistenceCapable jdoNewInstance(StateManager sm)
public PersistenceCapable jdoNewInstance(StateManager sm, java.lang.Object oid)
public java.lang.Object jdoNewObjectIdInstance()
public java.lang.Object jdoGetObjectId()
public java.lang.Object jdoGetTransactionalObjectId()
public void jdoReplaceField(int fieldNumber)
public void jdoReplaceFields(int[] fieldNumbers)
public void jdoProvideField(int fieldNumber)
public void jdoProvideFields(int[] fieldNumbers)
public void jdoCopyFields(java.lang.Object pc, int[] fieldNumbers)
public void jdoMakeDirty(java.lang.String fieldName)
public boolean jdoIsDirty()
public boolean jdoIsDetached()
public void jdoReplaceObjectId(java.lang.Object arg0)
public boolean jdoIsTransactional()
public boolean jdoIsPersistent()
public boolean jdoIsNew()
public boolean jdoIsDeleted()
public void jdoReplaceStateManager(StateManager sm)
public java.lang.Object jdoNewObjectIdInstance(java.lang.String s)
public void jdoCopyKeyFieldsToObjectId(java.lang.Object o)
public void jdoCopyKeyFieldsToObjectId(PersistenceCapable.ObjectIdFieldSupplier objectIdFieldSupplier, java.lang.Object o)
public void jdoCopyKeyFieldsFromObjectId(PersistenceCapable.ObjectIdFieldConsumer objectIdFieldConsumer, java.lang.Object o)
public void jdoSetPType(PType _ptype)
jdoSetPType
in interface SpeedoGenClassProxy
_ptype
- of the generic classpublic PType jdoGetPType()
jdoGetPType
in interface SpeedoGenClassProxy
public void jdoSetPBinding(PBinding pb)
jdoSetPBinding
in interface SpeedoGenClassProxy
pb
- is the PBinding.public PBinding jdoGetPBinding()
jdoGetPBinding
in interface SpeedoGenClassProxy
public java.lang.String jdoGetGenClassId()
jdoGetGenClassId
in interface SpeedoGenClassProxy
public void jdoSetLinkedField(java.lang.String lf)
jdoSetLinkedField
in interface SpeedoGenClassProxy
lf
- is tring which represents the fully path of the persistent
field of the class with wich the generic class is persistent.
If the linked fiekf is the 'f1' provided by the class 'com.foo.Bar'
then the expected string is 'com.foo.Bar/f1'public void setElements(java.lang.Object o)
setElements
in interface SpeedoGenClassProxy
public void copyAccessor(SpeedoAccessor src, SpeedoAccessor dest)
SpeedoProxy
copyAccessor
in interface SpeedoProxy
src
- is the accessor containing peristent fields to copydest
- is the accessor where persistent fields have to be copiedpublic java.lang.Object jdoGetPNameHints()
SpeedoProxy
jdoGetPNameHints
in interface SpeedoProxy
public boolean jdoIsActive()
SpeedoProxy
jdoIsActive
in interface SpeedoProxy
public void jdoIsActive(boolean newvalue)
SpeedoProxy
jdoIsActive
in interface SpeedoProxy
newvalue
- the new value of the proxy flagSpeedoProxy.jdoIsActive()
public SpeedoAccessor getSpeedoAccessor()
SpeedoProxy
getSpeedoAccessor
in interface SpeedoProxy
public java.util.Collection getSpeedoAccessors()
public void removeSpeedoAccessor(SpeedoAccessor sa)
public java.lang.String jdoGetJdoFileName()
jdoGetJdoFileName
in interface SpeedoProxy
public void setEncodedPName(java.lang.Object _encodedPName)
SpeedoProxy
setEncodedPName
in interface SpeedoProxy
_encodedPName
- : the encoded PName of the persistent objectpublic java.lang.Object getEncodedPName()
getEncodedPName
in interface SpeedoProxy
public SpeedoHome getSpeedoHome()
getSpeedoHome
in interface SpeedoProxy
public java.lang.Object getCeObject()
public java.lang.Object getCeIdentifier()
public void fixCe()
public void unfixCe() throws UnFixProtocolException
UnFixProtocolException
public int getCeFixCount()
public long getCeAge()
public void setCeAge(long l)
public void setLogger(Logger _logger)
public void setLoggerFactory(LoggerFactory loggerfactory)
public Logger getLogger()
public LoggerFactory getLoggerFactory()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |