|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.speedo.genclass.GenClass
public abstract class GenClass
This class is a basic implementation of the SpeedoGenClassPO 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 java.lang.String |
linkedField
The linked field associated to this gen class |
protected java.util.List |
listeners
List of SpeedoGenClassListener |
org.objectweb.util.monolog.api.Logger |
logger
The logger used to trace this generic class Defined as transient. |
protected java.lang.String |
mapperName
is the name of the mapper inside which the generic class is persistent |
protected org.objectweb.jorm.api.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 org.objectweb.jorm.type.api.PType |
ptype
is the type of the generic class |
protected boolean |
speedoIsActive
This fields indicates if the po is active |
Fields inherited from interface org.objectweb.jorm.api.PBinding |
---|
ACTION_BIND, ACTION_EXIST, ACTION_EXPORT, ACTION_READ, ACTION_UNBIND, ACTION_UNEXPORT, ACTION_WRITE, LIFECYCLE_ACTIVEFORIO, LIFECYCLE_DELTOWRITE, LIFECYCLE_ERROR, LIFECYCLE_NEWTOWRITE, LIFECYCLE_NOTBOUND |
Constructor Summary | |
---|---|
GenClass()
|
Method Summary | |
---|---|
void |
bind(org.objectweb.jorm.naming.api.PName name)
|
boolean |
elementIsReference()
|
boolean |
exist(java.lang.Object o)
|
org.objectweb.jorm.naming.api.PName |
export(java.lang.Object o)
|
org.objectweb.jorm.naming.api.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)
|
org.objectweb.util.monolog.api.Logger |
getLogger()
|
org.objectweb.util.monolog.api.LoggerFactory |
getLoggerFactory()
|
org.objectweb.jorm.api.PClassMapping |
getPClassMapping()
|
org.objectweb.jorm.naming.api.PName |
getPName()
|
java.util.Collection |
getSpeedoAccessors()
|
byte |
getStatus()
|
void |
init(org.objectweb.jorm.api.PClassMapping mapping)
|
void |
init(org.objectweb.jorm.type.api.PType _ptype,
java.lang.String _linkedField,
java.lang.Object _pnameHints,
org.objectweb.util.monolog.api.Logger _logger)
Initializes a Genclass instance |
void |
read(java.lang.Object o,
org.objectweb.jorm.api.PAccessor accessor)
|
void |
read(java.lang.Object o,
org.objectweb.jorm.api.PAccessor pAccessor,
java.lang.Object o1)
|
void |
read(java.lang.Object o,
org.objectweb.jorm.api.PAccessor pAccessor,
java.lang.Object o1,
boolean forUpdate)
|
void |
removeSpeedoAccessor(StateItf 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 |
setLogger(org.objectweb.util.monolog.api.Logger _logger)
|
void |
setLoggerFactory(org.objectweb.util.monolog.api.LoggerFactory loggerfactory)
|
void |
setPName(org.objectweb.jorm.naming.api.PName pName)
|
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. |
void |
speedoCopyState(StateItf src,
StateItf dest)
Copies persistent fields from an accessor to another. |
abstract StateItf |
speedoCreateState()
|
java.lang.Object |
speedoGetEncodedPName()
|
java.lang.String |
speedoGetGenClassId()
|
HomeItf |
speedoGetHome()
|
org.objectweb.jorm.api.PBinding |
speedoGetPBinding()
|
java.lang.Object |
speedoGetPNameHints()
Retrieves the hints needed to build the PName of the persistent object during the export action. |
POManagerItf |
speedoGetPOManager()
|
org.objectweb.jorm.type.api.PType |
speedoGetPType()
|
abstract StateItf |
speedoGetReferenceState()
|
StateItf |
speedoGetState()
It retrieves the StateItf instance used in the current context. |
boolean |
speedoIsActive()
Tests whether the po infrastructure has already been set. |
void |
speedoIsActive(boolean newvalue)
Sets the new value of the po flags |
boolean |
speedoIsPersistent()
|
boolean |
speedoRemove(java.lang.Object elemToRemove,
java.lang.Object hints)
Askes the removing of an element from a generic class. |
void |
speedoSetEncodedPName(java.lang.Object _encodedPName)
Set the encoded PName of the detach copy to allow serialization. |
void |
speedoSetGcId(int _gcid)
Sets the id of this gen class instance (id of the field that references this instance). |
void |
speedoSetLinkedField(java.lang.String lf)
Assignes the linked field name for this generic class. |
void |
speedoSetPBinding(org.objectweb.jorm.api.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 |
speedoSetPNameHints(java.lang.Object hints)
Assignes the hints needed to build the PName of the persistent object during the export action. |
void |
speedoSetPType(org.objectweb.jorm.type.api.PType _ptype)
Assignes the PType of the generic class. |
abstract void |
speedoSetReferenceState(StateItf refAcc)
Assignes the reference accessor to the PersistentObjectItf The Reference accessor is used for non persistent instance, as cache value and for pessimistic policy. |
void |
unbind()
|
void |
unexport(java.lang.Object o)
|
void |
unfixCe()
|
void |
write(java.lang.Object o,
org.objectweb.jorm.api.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.SpeedoGenClassPO |
---|
clear, createGenClass |
Field Detail |
---|
protected boolean speedoIsActive
protected org.objectweb.jorm.api.PBindingCtrl pbinding
public transient org.objectweb.util.monolog.api.Logger logger
protected java.lang.String mapperName
protected java.lang.String projectName
protected org.objectweb.jorm.type.api.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(org.objectweb.jorm.type.api.PType _ptype, java.lang.String _linkedField, java.lang.Object _pnameHints, org.objectweb.util.monolog.api.Logger _logger)
SpeedoGenClassPO
init
in interface SpeedoGenClassPO
_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 speedoSetPNameHints(java.lang.Object hints)
SpeedoGenClassPO
speedoSetPNameHints
in interface SpeedoGenClassPO
public boolean elementIsReference()
public void speedoSetGcId(int _gcid)
SpeedoGenClassPO
speedoSetGcId
in interface SpeedoGenClassPO
_gcid
- the new id of this gen class instance.public void speedoAddGenClassListener(SpeedoGenClassListener l)
SpeedoGenClassPO
speedoAddGenClassListener
in interface SpeedoGenClassPO
l
- a gen class listener.public void speedoAdd(java.lang.Object elem, int gcFieldNumber)
PersistentObjectItf
speedoAdd
in interface PersistentObjectItf
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)
SpeedoGenClassPO
fireSpeedoElementAdded
in interface SpeedoGenClassPO
elem
- the element that has been added.public void fireSpeedoElementRemoved(java.lang.Object elem)
SpeedoGenClassPO
fireSpeedoElementRemoved
in interface SpeedoGenClassPO
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 StateItf speedoCreateState()
speedoCreateState
in interface PersistentObjectItf
public abstract StateItf speedoGetReferenceState()
speedoGetReferenceState
in interface PersistentObjectItf
public abstract void speedoSetReferenceState(StateItf refAcc)
PersistentObjectItf
speedoSetReferenceState
in interface PersistentObjectItf
refAcc
- the new reference accessorpublic void bind(org.objectweb.jorm.naming.api.PName name) throws org.objectweb.jorm.api.PException
bind
in interface org.objectweb.jorm.api.PBinding
org.objectweb.jorm.api.PException
public boolean exist(java.lang.Object o) throws org.objectweb.jorm.api.PException
exist
in interface org.objectweb.jorm.api.PBinding
org.objectweb.jorm.api.PException
public org.objectweb.jorm.naming.api.PName export(java.lang.Object o) throws org.objectweb.jorm.api.PException
export
in interface org.objectweb.jorm.api.PBinding
org.objectweb.jorm.api.PException
public org.objectweb.jorm.naming.api.PName export(java.lang.Object o, java.lang.Object o1) throws org.objectweb.jorm.api.PException
export
in interface org.objectweb.jorm.api.PBinding
org.objectweb.jorm.api.PException
public org.objectweb.jorm.api.PClassMapping getPClassMapping()
getPClassMapping
in interface org.objectweb.jorm.api.PBinding
public org.objectweb.jorm.naming.api.PName getPName()
getPName
in interface org.objectweb.jorm.api.PBinding
public byte getStatus()
getStatus
in interface org.objectweb.jorm.api.PBinding
public void setPName(org.objectweb.jorm.naming.api.PName pName)
setPName
in interface org.objectweb.jorm.api.PBindingCtrl
public void setStatus(byte b)
setStatus
in interface org.objectweb.jorm.api.PBindingCtrl
public void init(org.objectweb.jorm.api.PClassMapping mapping) throws org.objectweb.jorm.api.PException
init
in interface org.objectweb.jorm.api.PBinding
org.objectweb.jorm.api.PException
public void read(java.lang.Object o, org.objectweb.jorm.api.PAccessor accessor) throws org.objectweb.jorm.api.PException
read
in interface org.objectweb.jorm.api.PBinding
org.objectweb.jorm.api.PException
public void read(java.lang.Object o, org.objectweb.jorm.api.PAccessor pAccessor, java.lang.Object o1) throws org.objectweb.jorm.api.PException
read
in interface org.objectweb.jorm.api.PBinding
org.objectweb.jorm.api.PException
public void read(java.lang.Object o, org.objectweb.jorm.api.PAccessor pAccessor, java.lang.Object o1, boolean forUpdate) throws org.objectweb.jorm.api.PException
read
in interface org.objectweb.jorm.api.PBinding
org.objectweb.jorm.api.PException
public void unbind() throws org.objectweb.jorm.api.PException
unbind
in interface org.objectweb.jorm.api.PBinding
org.objectweb.jorm.api.PException
public void unexport(java.lang.Object o) throws org.objectweb.jorm.api.PException
unexport
in interface org.objectweb.jorm.api.PBinding
org.objectweb.jorm.api.PException
public void write(java.lang.Object o, org.objectweb.jorm.api.PAccessor accessor) throws org.objectweb.jorm.api.PException
write
in interface org.objectweb.jorm.api.PBinding
org.objectweb.jorm.api.PException
public void speedoSetPType(org.objectweb.jorm.type.api.PType _ptype)
speedoSetPType
in interface SpeedoGenClassPO
_ptype
- of the generic classpublic org.objectweb.jorm.type.api.PType speedoGetPType()
speedoGetPType
in interface SpeedoGenClassPO
public void speedoSetPBinding(org.objectweb.jorm.api.PBinding pb)
speedoSetPBinding
in interface SpeedoGenClassPO
pb
- is the PBinding.public org.objectweb.jorm.api.PBinding speedoGetPBinding()
speedoGetPBinding
in interface SpeedoGenClassPO
public java.lang.String speedoGetGenClassId()
speedoGetGenClassId
in interface SpeedoGenClassPO
public void speedoSetLinkedField(java.lang.String lf)
speedoSetLinkedField
in interface SpeedoGenClassPO
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 SpeedoGenClassPO
public boolean speedoIsPersistent()
speedoIsPersistent
in interface PersistentObjectItf
public void speedoCopyState(StateItf src, StateItf dest)
PersistentObjectItf
speedoCopyState
in interface PersistentObjectItf
src
- is the accessor containing peristent fields to copydest
- is the accessor where persistent fields have to be copiedpublic java.lang.Object speedoGetPNameHints()
PersistentObjectItf
speedoGetPNameHints
in interface PersistentObjectItf
public boolean speedoIsActive()
PersistentObjectItf
speedoIsActive
in interface PersistentObjectItf
public void speedoIsActive(boolean newvalue)
PersistentObjectItf
speedoIsActive
in interface PersistentObjectItf
newvalue
- the new value of the po flagPersistentObjectItf.speedoIsActive()
public StateItf speedoGetState()
PersistentObjectItf
speedoGetState
in interface PersistentObjectItf
public java.util.Collection getSpeedoAccessors()
public void removeSpeedoAccessor(StateItf sa)
public void speedoSetEncodedPName(java.lang.Object _encodedPName)
PersistentObjectItf
speedoSetEncodedPName
in interface PersistentObjectItf
_encodedPName
- : the encoded PName of the persistent objectpublic java.lang.Object speedoGetEncodedPName()
speedoGetEncodedPName
in interface PersistentObjectItf
public HomeItf speedoGetHome()
speedoGetHome
in interface PersistentObjectItf
public POManagerItf speedoGetPOManager()
speedoGetPOManager
in interface PersistentObjectItf
public java.lang.Object getCeObject()
getCeObject
in interface CacheEntry
public java.lang.Object getCeIdentifier()
getCeIdentifier
in interface CacheEntry
public void fixCe()
fixCe
in interface FixableCacheEntry
public void unfixCe() throws UnFixProtocolException
unfixCe
in interface FixableCacheEntry
UnFixProtocolException
public int getCeFixCount()
getCeFixCount
in interface FixableCacheEntry
public long getCeAge()
getCeAge
in interface ReplaceableCacheEntry
public void setCeAge(long l)
setCeAge
in interface ReplaceableCacheEntry
public void setLogger(org.objectweb.util.monolog.api.Logger _logger)
setLogger
in interface org.objectweb.jorm.util.api.Loggable
public void setLoggerFactory(org.objectweb.util.monolog.api.LoggerFactory loggerfactory)
setLoggerFactory
in interface org.objectweb.jorm.util.api.Loggable
public org.objectweb.util.monolog.api.Logger getLogger()
getLogger
in interface org.objectweb.jorm.util.api.Loggable
public org.objectweb.util.monolog.api.LoggerFactory getLoggerFactory()
getLoggerFactory
in interface org.objectweb.jorm.util.api.Loggable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |