Package es.bsc.dataclay.loader
Class ExecutionObjectLoader
- java.lang.Object
-
- es.bsc.dataclay.loader.DataClayObjectLoader
-
- es.bsc.dataclay.loader.ExecutionObjectLoader
-
public class ExecutionObjectLoader extends DataClayObjectLoader
This class is responsable to create DataClayObjects and load them with data coming from different resources. All possible constructions of DataClayObject should be included here. All possible "filling instance" use-cases should be managed here.
-
-
Field Summary
-
Fields inherited from class es.bsc.dataclay.loader.DataClayObjectLoader
DEBUG_ENABLED, logger
-
-
Constructor Summary
Constructors Constructor Description ExecutionObjectLoader(DataServiceRuntime theruntime)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deserializeDataIntoInstance(DataClayObject instance, ObjectWithDataParamOrReturn data, Map<MetaClassID,byte[]> ifaceBitMaps)
Deserialize data into instance.DataClayExecutionObject
getOrNewPersistentInstance(MetaClassID classID, ObjectID objectID, BackendID hint)
Check if instance exists in objects map or create a new PERSISTENT instance if neededDataClayExecutionObject
getOrNewPersistentInstanceFromDB(ObjectID objectID, boolean retry)
Get object from memory or database and WAIT in case we are still waiting for it to be persisted.protected DataClayRuntime
getRuntime()
Get runtimevoid
loadDataClayObjectFromDb(DataClayExecutionObject objectToFill, boolean retry)
Load DataClayObject from DatabaseDataClayExecutionObject
newInstance(MetaClassID classID, ObjectID objectID)
Create a new instance using proper class loader-
Methods inherited from class es.bsc.dataclay.loader.DataClayObjectLoader
getOrNewAndLoadVolatile, newInstanceInternal
-
-
-
-
Constructor Detail
-
ExecutionObjectLoader
public ExecutionObjectLoader(DataServiceRuntime theruntime)
Constructor- Parameters:
theruntime
- Runtime being managed
-
-
Method Detail
-
getRuntime
protected DataClayRuntime getRuntime()
Description copied from class:DataClayObjectLoader
Get runtime- Specified by:
getRuntime
in classDataClayObjectLoader
- Returns:
- The runtime being managed.
-
newInstance
public DataClayExecutionObject newInstance(MetaClassID classID, ObjectID objectID)
Description copied from class:DataClayObjectLoader
Create a new instance using proper class loader- Specified by:
newInstance
in classDataClayObjectLoader
- Parameters:
classID
- ID of classobjectID
- ID of object- Returns:
- Instance
-
getOrNewPersistentInstance
public DataClayExecutionObject getOrNewPersistentInstance(MetaClassID classID, ObjectID objectID, BackendID hint)
Check if instance exists in objects map or create a new PERSISTENT instance if needed- Overrides:
getOrNewPersistentInstance
in classDataClayObjectLoader
- Parameters:
classID
- ID of the class in case it is needed (not need to query) if null, look for class id in metadata.objectID
- ID of objecthint
- Can be null. Hint in case object is a volatile in another DS and we need information.- Returns:
- Instance
-
deserializeDataIntoInstance
public void deserializeDataIntoInstance(DataClayObject instance, ObjectWithDataParamOrReturn data, Map<MetaClassID,byte[]> ifaceBitMaps)
Deserialize data into instance.- Specified by:
deserializeDataIntoInstance
in classDataClayObjectLoader
- Parameters:
instance
- Instance to be filled.data
- DataifaceBitMaps
- Interface bitmaps
-
getOrNewPersistentInstanceFromDB
public DataClayExecutionObject getOrNewPersistentInstanceFromDB(ObjectID objectID, boolean retry)
Get object from memory or database and WAIT in case we are still waiting for it to be persisted.- Parameters:
objectID
- ID of the object to getretry
- Indicates if we should retry and wait.- Returns:
- The the object.
-
loadDataClayObjectFromDb
public void loadDataClayObjectFromDb(DataClayExecutionObject objectToFill, boolean retry)
Load DataClayObject from Database- Parameters:
objectToFill
- DataClayObject instance to fillretry
- Indicates retry loading in case it is not in db.
-
-