|
LEONARDI Application Composer - 8.9.0.40 by W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectleon.data.LyDataSource
leon.data.LyObjectSource
leon.data.LyExtendObjectSource
public class LyExtendObjectSource
An extends object source is associated to a logical class (LyClassInfo) which has derived classes.
Objects sources are associated to data sources to dispatch demands on the underlying physical layer when requests are made for logical objects.
LyObject
,
LyClassInfo
Field Summary | |
---|---|
static java.lang.String |
__VERSION
File version |
Fields inherited from class leon.data.LyObjectSource |
---|
GET_SIZE_CACHE_DELAY |
Constructor Summary | |
---|---|
LyExtendObjectSource(LyDataProvider provider,
LyClassInfo classInfo)
Constructs an extends object source for a given class info. |
|
LyExtendObjectSource(LyDataProvider provider,
LyClassInfo classInfo,
LyObjectSource objectSource)
Constructs an extends object source for a given class info. |
Method Summary | |
---|---|
void |
addListener(LyDataSourceListener listener,
short type)
Registers a listener to receive events of the given type on objects contained within this data source. |
void |
addListener(LyDataSourceListener listener,
java.util.Vector<LyField> fields)
Registers a listener to receive modification events concerning given fields on objects contained within this data source. |
boolean |
checkObject(LyObjectId objectId)
Tests if an object corresponding to a given object id is found in the cache of this data source. |
boolean |
checkObject(java.lang.Object object)
Tests if the given object is found in the cache of this data source. |
LyResponse |
createObject(LyObject object,
LyResponseListener listener,
boolean local,
boolean refresh)
Create a new object in this object source. |
LyResponse |
deleteObject(LyObject object,
LyResponseListener listener,
boolean local,
boolean refresh,
boolean deleteLinkedObjects)
Delete an object of this object source. |
LyResponse |
deleteObjects(java.util.Vector<? extends java.lang.Object> objects,
LyResponseListener listener,
boolean local,
boolean refresh,
boolean deleteLinkedObjects)
Delete a list of objects of this object source. |
void |
finalizeObject(LyObject object)
Finalize method for an object, remove from cache |
void |
free()
Free this object source. |
LyDataSourceListener |
getListener()
To get the instance of LyDataSourceListener of this object source. |
java.lang.Object |
getObject(LyObjectId id)
Gets an object from this object source by the specified identifier. |
java.lang.Object |
getObject(LyObjectId id,
boolean local)
Gets an object from this object source by the specified identifier. |
LyObject |
getObject(LyObjectId id,
boolean godown,
boolean local)
Gets an object from this object source by the specified identifier. |
LyObject |
getObjectFromPeer(java.lang.Object peer)
Finds an object from its object peer (associated physical object). |
LyResponse |
getObjects(java.util.Vector<LyFieldInfo> fieldInfos,
LySort sort,
LyFilter filter,
int n,
boolean local,
LyResponseListener listener)
Retrieve objects on this object source. |
LyObjectSource |
getObjectSource()
To get the objectSource associated with the classInfo when this classInfo is not abstract. |
LyClassInfo |
getRealClassInfo(LyObject object)
Given an object id corresponding to this extend object source, compute the real classinfo (corresponding to the correct sub class. |
int |
getSize(LyFilter filter)
Return the number of objects within this object source matching the given filter. |
int |
getSize(LyFilter filter,
boolean local)
Return the number of objects within this object source matching the given filter. |
void |
listenToSubClasses()
Internal method to listen to sub-classes. |
void |
load()
Loads completely this object source : loads the associated cache according to the cache policy. |
void |
notifyClassLoading(LyClassInfo classInfo)
Method to notify the loading of a class to an object source. |
void |
setCache(LyInfoCache cachePolicy)
Sets the cache for this object source. |
void |
setLoaded(boolean loaded)
Marks the associated cache as loaded or not. |
void |
setLoaded(boolean loaded,
boolean subClassesOnly)
Marks the associated cache as loaded or not. |
LyResponse |
setObject(LyObject object,
LyResponseListener listener,
boolean local,
boolean refresh)
Set an object of this object source. |
LyResponse |
setObjects(java.util.Vector<? extends java.lang.Object> objects,
LyResponseListener listener)
Set a list of objects of this object source. |
void |
unload(boolean notify)
Unloads completely this object source : unloads the associated cache and data source. |
void |
validate()
To validate this objectSource. |
Methods inherited from class leon.data.LyDataSource |
---|
addListener, getApplication, getCache, getDataClass, getDataProvider, getLastModified, getObject, getSize, isReadOnly, isRollBack, isSynchronous, reloadObject, setIgnoreErrorOnLoad, setReadOnly, setRollBack, setSynchronous, unload |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String __VERSION
Constructor Detail |
---|
public LyExtendObjectSource(LyDataProvider provider, LyClassInfo classInfo)
provider
- the data providerclassInfo
- Class info for which an extends object source is constructed.public LyExtendObjectSource(LyDataProvider provider, LyClassInfo classInfo, LyObjectSource objectSource)
provider
- the data providerclassInfo
- Class info for which an extends object source is constructed.objectSource
- the objectsourceMethod Detail |
---|
public void free()
free
in class LyObjectSource
public void listenToSubClasses()
public void notifyClassLoading(LyClassInfo classInfo)
notifyClassLoading
in class LyObjectSource
classInfo
- the classInfopublic LyObjectSource getObjectSource()
public void setCache(LyInfoCache cachePolicy)
setCache
in class LyObjectSource
cachePolicy
- Informations for the cache to associate to this object source.
java.lang.IllegalArgumentException
- If the given cache is null.
java.lang.IllegalStateException
- If the object source is already associated to a cache
that contains objects.public boolean checkObject(java.lang.Object object)
checkObject
in class LyDataSource
object
- Object searched.
public boolean checkObject(LyObjectId objectId)
checkObject
in class LyDataSource
objectId
- Object id for which an object is searched.
public void load()
load
in class LyObjectSource
public void unload(boolean notify)
unload
in class LyObjectSource
notify
- indicates wether the unload action should notify objects deletion. Notifying
deletions makes sense when views are opened and when application is not
exiting.public void addListener(LyDataSourceListener listener, short type)
addListener
in class LyObjectSource
listener
- New listener. To receive these events, the listener have to implement the
LyDataSourceListener interface.type
- Indicates which type of event the listener wants to receive. Types are
defined as constant in LyDataSourceEvent class : TYPE_CREATE, TYPE_SET,
TYPE_DELETE
java.lang.IllegalArgumentException
- If the listener is null or if the given type is unknown.public void addListener(LyDataSourceListener listener, java.util.Vector<LyField> fields)
addListener
in class LyObjectSource
listener
- New listener. To receive these events, the listener have to implement the
LyDataSourceListener interface.fields
- List of fields on which the listener wants to be notified when they are
modified.
java.lang.IllegalArgumentException
- If the listener is null.public LyObject getObject(LyObjectId id, boolean godown, boolean local)
id
- Object identifier of the searched object.godown
- indicates if the object is searched recursivly in inherited classes.local
- indicates if the request is local (from memory) or not.
public java.lang.Object getObject(LyObjectId id)
getObject
in class LyObjectSource
id
- Object identifier of the searched object.
public java.lang.Object getObject(LyObjectId id, boolean local)
getObject
in class LyObjectSource
id
- Object identifier of the searched object.local
- Indicates if the demand is local (gets object from memory) or not.
public int getSize(LyFilter filter)
getSize
in class LyObjectSource
filter
- Filter applied on objects for counting.
public int getSize(LyFilter filter, boolean local)
getSize
in class LyObjectSource
filter
- Filter applied on objects for counting.local
- Indicates if the request must be local or not.
public LyClassInfo getRealClassInfo(LyObject object)
getRealClassInfo
in class LyObjectSource
object
- the LyObject
public LyResponse createObject(LyObject object, LyResponseListener listener, boolean local, boolean refresh)
createObject
in class LyObjectSource
object
- Object to create.listener
- Listener of the response.local
- Indicates if the creation is local or not.refresh
- Indicates if the creation may be notified or not.
java.lang.IllegalStateException
- If the object source is in read only mode.public LyResponse setObject(LyObject object, LyResponseListener listener, boolean local, boolean refresh)
setObject
in class LyObjectSource
object
- Object to modify.listener
- Listener of the response.local
- Indicates if the modification must be local or not.refresh
- Indicates if the modification may be notified or not.
java.lang.IllegalStateException
- If the object source is in read only mode.
java.lang.IllegalArgumentException
- If the given object is invalid.public LyResponse setObjects(java.util.Vector<? extends java.lang.Object> objects, LyResponseListener listener)
setObjects
in class LyObjectSource
object
- List of objects to modify.listener
- Listener of the response.
java.lang.IllegalStateException
- If the object source is in read only mode.
java.lang.IllegalArgumentException
- If one of the given objects is invalid.public LyResponse deleteObject(LyObject object, LyResponseListener listener, boolean local, boolean refresh, boolean deleteLinkedObjects)
object
- Object to delete.listener
- Listener of the response.local
- Indicates if the operation is local or not.refresh
- Indicates if the operation may be notified or not.deleteLinkObjects
- Indicates if linked objects (composition relations,...)
must be deleted or not.
java.lang.IllegalStateException
- If the object source is in read only mode.
java.lang.IllegalArgumentException
- If the given object is invalid.public LyResponse deleteObjects(java.util.Vector<? extends java.lang.Object> objects, LyResponseListener listener, boolean local, boolean refresh, boolean deleteLinkedObjects)
deleteObjects
in class LyObjectSource
objects
- List of objects to delete.listener
- Listener of the response.local
- Indicates if the operation is local or not.refresh
- Indicates if the operation may be notified or not.deleteLinkObjects
- Indicates if linked objects (composition relations, ...)
must be deleted or not.
java.lang.IllegalStateException
- If the object source is in read only mode.
java.lang.IllegalArgumentException
- If one of the given objects is invalid.public LyResponse getObjects(java.util.Vector<LyFieldInfo> fieldInfos, LySort sort, LyFilter filter, int n, boolean local, LyResponseListener listener)
getObjects
in class LyObjectSource
sort
- Gives sort criteria, or null if there is no sort (the order is the one of
the physical layer).filter
- Gives filter criteria, or null if there is no filter (all objects).n
- Indicates the number of objects to retrieve (-1 means no limit).local
- Indicates if the request is local (from memory) or not.listener
- Listener of the response.fieldInfos
- The list of the fieldInfos to load if necessary. If this parameter is null
all the field infos are loaded. If the list is empty, only fields with
mark id or name and fields used by sort and filter are loaded.
public LyObject getObjectFromPeer(java.lang.Object peer)
getObjectFromPeer
in class LyObjectSource
peer
- Physical object.
public void validate()
validate
in class LyObjectSource
public LyDataSourceListener getListener()
getListener
in class LyObjectSource
public void setLoaded(boolean loaded)
loaded
- True to mark the cache loaded, false otherwise.public void setLoaded(boolean loaded, boolean subClassesOnly)
loaded
- True to mark the cache loaded, false otherwise.public void finalizeObject(LyObject object)
finalizeObject
in class LyObjectSource
object
- LyObject being finalized
|
(c) January 2013 - W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |