|
|||||||||||
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 ProxyManagerFactory |
pmf
This is field is null when the proxy is not active |
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 |
protected TransactionalPersistenceManager |
tpm
This field is the Transactional persistence manager. |
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)
|
java.util.Collection |
fgGetFieldsToLoad(java.lang.String fgName)
|
java.util.Collection |
fgGetFieldsToLoad(java.lang.String fgName,
boolean onlyDirectRef)
Same as fgGetFieldsToLoad(String fgName) but if onlyDirectRef is set to true, all the fields of type a.b.c or a#element or a/fg are removed from the returned collection. |
java.util.Collection |
fgGetNestedFetchGroups(java.lang.String fgName)
|
boolean |
fgIsDefined(java.lang.String fgName)
|
boolean |
fgIsPostload(java.lang.String fgName)
|
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 |
getEncodedPName()
|
java.lang.Object |
getJormConfig()
|
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()
|
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 |
jdoAttachCopy(ProxyManager pm,
java.util.Map map,
java.lang.Object clone,
SpeedoAccessor sa,
boolean makeTransactional)
Attach the detached clone to the datastore. |
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)
|
void |
jdoDeletePersistent(ProxyManager pm,
SpeedoAccessor sa)
|
SpeedoProxy |
jdoDetachCopy(ProxyManager pm,
java.util.Map map,
java.lang.Object clone,
java.util.Collection fgHints)
|
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. |
java.lang.String |
jdoGetProjectName()
|
ProxyManagerFactory |
jdoGetProxyManagerFactory()
|
PType |
jdoGetPType()
|
java.lang.Object |
jdoGetTransactionalObjectId()
|
TransactionalPersistenceManager |
jdoGetTransactionalPersistenceManager()
|
byte |
jdoGetVersioningStrategy()
The versioning strategy. |
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 |
jdoIsDetachable()
|
boolean |
jdoIsDirty()
|
boolean |
jdoIsNew()
|
boolean |
jdoIsPersistent()
|
boolean |
jdoIsTransactional()
|
void |
jdoMakeDirty(java.lang.String fieldName)
|
void |
jdoMakePersistent(ProxyManager pm,
java.util.Iterator it)
|
void |
jdoMakePersistent(ProxyManager pm,
SpeedoProxy sp)
Askes to the SpeedoGenClassProxy to make persistent an element of the gen class. |
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)
|
SpeedoAccessor |
jdoReadIntention()
Askes the read access on the genclass. |
void |
jdoRefresh(ProxyManager pm,
java.util.Map map,
java.util.Collection fgHints)
Refresh the fields to be fetched according to the active fetch groups |
void |
jdoReplaceField(int fieldNumber)
|
void |
jdoReplaceFields(int[] fieldNumbers)
|
void |
jdoReplaceFlags()
|
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 |
jdoSetProxyManagerFactory(ProxyManagerFactory pmf)
It assignes a ProxyManagerFactory |
void |
jdoSetPType(PType ptype)
Assignes the PType of the generic class. |
void |
jdoSetTransactionalPersistenceManager(TransactionalPersistenceManager tpm)
It assignes a TransactionalPersistenceManager |
SpeedoAccessor |
jdoWriteIntention()
Askes the write access on the genclass. |
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 |
Methods inherited from interface org.objectweb.speedo.mim.api.SpeedoProxy |
jdoMakePersistent |
Field Detail |
protected boolean jdoIsActive
protected ProxyManagerFactory pmf
protected TransactionalPersistenceManager tpm
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 genclasslinkedField
- is the name of the field referencing the genclasspnameHints
- is a helper using for the identifier allocation (export)
persistentlogger
- is the logger instance for logging.public void jdoSetPNameHints(java.lang.Object hints)
SpeedoGenClassProxy
jdoSetPNameHints
in interface SpeedoGenClassProxy
public boolean elementIsReference()
public void jdoMakePersistent(ProxyManager pm, SpeedoProxy sp)
SpeedoGenClassProxy
jdoMakePersistent
in interface SpeedoGenClassProxy
pm
- is the persistence manager to use for making persistent the
speedo proxy. If this parameter is null a pm will be fetched on the pmf
if needed.sp
- is the speedo proxy to make persistent. null value is not
supported.public void jdoMakePersistent(ProxyManager pm, java.util.Iterator it)
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 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 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 java.lang.String jdoGetProjectName()
jdoGetProjectName
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 byte jdoGetVersioningStrategy()
SpeedoProxy
jdoGetVersioningStrategy
in interface SpeedoProxy
SpeeedoVersion.TIMESTAMP, STATE_COMPARISON, VERSION_NUMBER, NO_VERSION
public SpeedoAccessor getSpeedoAccessor()
SpeedoProxy
getSpeedoAccessor
in interface SpeedoProxy
public java.util.Collection getSpeedoAccessors()
public void removeSpeedoAccessor(SpeedoAccessor sa)
public ProxyManagerFactory jdoGetProxyManagerFactory()
jdoGetProxyManagerFactory
in interface SpeedoProxy
public void jdoSetProxyManagerFactory(ProxyManagerFactory pmf)
SpeedoProxy
jdoSetProxyManagerFactory
in interface SpeedoProxy
pmf
- is the ProxyManagerFactory which represents the data
support inside which the proxy is persistent.public TransactionalPersistenceManager jdoGetTransactionalPersistenceManager()
jdoGetTransactionalPersistenceManager
in interface SpeedoProxy
public void jdoSetTransactionalPersistenceManager(TransactionalPersistenceManager tpm)
SpeedoProxy
jdoSetTransactionalPersistenceManager
in interface SpeedoProxy
tpm
- is the TransactionalPersistenceManager which manage the
concurrency, loading, ... of the proxy.public SpeedoAccessor jdoReadIntention()
SpeedoGenClassProxy
jdoReadIntention
in interface SpeedoGenClassProxy
public SpeedoAccessor jdoWriteIntention()
SpeedoGenClassProxy
jdoWriteIntention
in interface SpeedoGenClassProxy
public java.lang.Object getJormConfig()
public java.lang.String jdoGetJdoFileName()
jdoGetJdoFileName
in interface SpeedoProxy
public void jdoDeletePersistent(ProxyManager pm, SpeedoAccessor sa)
jdoDeletePersistent
in interface SpeedoProxy
public boolean fgIsPostload(java.lang.String fgName)
fgIsPostload
in interface SpeedoProxy
fgName
- The name of the fetchgroup
public java.util.Collection fgGetFieldsToLoad(java.lang.String fgName)
fgGetFieldsToLoad
in interface SpeedoProxy
fgName
- The name of the fetchgroup
public java.util.Collection fgGetFieldsToLoad(java.lang.String fgName, boolean onlyDirectRef)
SpeedoProxy
fgGetFieldsToLoad
in interface SpeedoProxy
fgName
- onlyDirectRef
-
public java.util.Collection fgGetNestedFetchGroups(java.lang.String fgName)
fgGetNestedFetchGroups
in interface SpeedoProxy
fgName
- The name of the fetchgroup
public boolean fgIsDefined(java.lang.String fgName)
fgIsDefined
in interface SpeedoProxy
fgName
- The name of the fetchgroup
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 SpeedoProxy jdoDetachCopy(ProxyManager pm, java.util.Map map, java.lang.Object clone, java.util.Collection fgHints)
jdoDetachCopy
in interface SpeedoProxy
public void jdoAttachCopy(ProxyManager pm, java.util.Map map, java.lang.Object clone, SpeedoAccessor sa, boolean makeTransactional)
SpeedoProxy
jdoAttachCopy
in interface SpeedoProxy
public void jdoRefresh(ProxyManager pm, java.util.Map map, java.util.Collection fgHints)
SpeedoProxy
jdoRefresh
in interface SpeedoProxy
public boolean jdoIsDetachable()
jdoIsDetachable
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 |