Package adams.flow.core
Class ObjectRetriever
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.core.ObjectRetriever
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,SizeOfHandler,FlowContextHandler,Serializable
public class ObjectRetriever extends AbstractOptionHandler implements FlowContextHandler
For retrieving objects from storage or source actors.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classObjectRetriever.RetrievalTypeThe enumeration for the retrieval type.
-
Field Summary
Fields Modifier and Type Field Description protected Actorm_FlowContextthe flow context.protected CallableActorHelperm_Helperfor locating callable actors.protected CallableActorReferencem_ObjectActorthe object actor.protected StorageNamem_ObjectStoragethe object storage.protected BaseClassnamem_ObjectTypethe superclass or interface to restrict to.protected ObjectRetriever.RetrievalTypem_RetrievalTypethe retrieval type.-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description ObjectRetriever()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddefineOptions()Adds options to the internal list of options.ActorgetFlowContext()Returns the flow context, if any.ObjectgetObject(MessageCollection errors)Retrieves the object.CallableActorReferencegetObjectActor()Returns the callable actor to retrieve the object from.StorageNamegetObjectStorage()Returns the storage item name to get the object from.BaseClassnamegetObjectType()Returns the interface or superclass to restrict the objects to.ObjectRetriever.RetrievalTypegetRetrievalType()Returns the retrieval type.StringglobalInfo()Returns a string describing the object.protected voidinitialize()Initializes the members.StringobjectActorTipText()Returns the tip text for this property.StringobjectStorageTipText()Returns the tip text for this property.StringobjectTypeTipText()Returns the tip text for this property.StringretrievalTypeTipText()Returns the tip text for this property.protected ObjectretrieveAutomatically(MessageCollection errors)Retrieves the object automatically from file/callable actor/storage.protected ObjectretrieveFromCallableActor(MessageCollection errors)Retrieves the object from the callable actor.protected ObjectretrieveFromStorage(MessageCollection errors)Retrieves the object from the storage item.voidsetFlowContext(Actor value)Sets the flow context.voidsetObjectActor(CallableActorReference value)Sets the callable actor to retrieve the object from.voidsetObjectStorage(StorageName value)Sets the storage item name to get the object from.voidsetObjectType(BaseClassname value)Sets the interface or superclass to restrict the objects to.voidsetRetrievalType(ObjectRetriever.RetrievalType value)Sets the retrieval type.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_FlowContext
protected Actor m_FlowContext
the flow context.
-
m_RetrievalType
protected ObjectRetriever.RetrievalType m_RetrievalType
the retrieval type.
-
m_ObjectActor
protected CallableActorReference m_ObjectActor
the object actor.
-
m_ObjectStorage
protected StorageName m_ObjectStorage
the object storage.
-
m_ObjectType
protected BaseClassname m_ObjectType
the superclass or interface to restrict to.
-
m_Helper
protected CallableActorHelper m_Helper
for locating callable actors.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractOptionHandler
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initializein classAbstractOptionHandler
-
setFlowContext
public void setFlowContext(Actor value)
Sets the flow context.- Specified by:
setFlowContextin interfaceFlowContextHandler- Parameters:
value- the actor
-
getFlowContext
public Actor getFlowContext()
Returns the flow context, if any.- Specified by:
getFlowContextin interfaceFlowContextHandler- Returns:
- the actor, null if none available
-
setRetrievalType
public void setRetrievalType(ObjectRetriever.RetrievalType value)
Sets the retrieval type. In case ofObjectRetriever.RetrievalType.AUTO, first file, then callable actor, then storage.- Parameters:
value- the type
-
getRetrievalType
public ObjectRetriever.RetrievalType getRetrievalType()
Returns the retrieval type. In case ofObjectRetriever.RetrievalType.AUTO, first file, then callable actor, then storage.- Returns:
- the type
-
retrievalTypeTipText
public String retrievalTypeTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setObjectActor
public void setObjectActor(CallableActorReference value)
Sets the callable actor to retrieve the object from.- Parameters:
value- the actor reference
-
getObjectActor
public CallableActorReference getObjectActor()
Returns the callable actor to retrieve the object from.- Returns:
- the actor reference
-
objectActorTipText
public String objectActorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setObjectStorage
public void setObjectStorage(StorageName value)
Sets the storage item name to get the object from.- Parameters:
value- the storage name
-
getObjectStorage
public StorageName getObjectStorage()
Returns the storage item name to get the object from.- Returns:
- the storage name
-
objectStorageTipText
public String objectStorageTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setObjectType
public void setObjectType(BaseClassname value)
Sets the interface or superclass to restrict the objects to.- Parameters:
value- the class
-
getObjectType
public BaseClassname getObjectType()
Returns the interface or superclass to restrict the objects to.- Returns:
- the class
-
objectTypeTipText
public String objectTypeTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
retrieveFromCallableActor
protected Object retrieveFromCallableActor(MessageCollection errors)
Retrieves the object from the callable actor.- Parameters:
errors- for collecting errors- Returns:
- the object, null if failed to retrieve
-
retrieveFromStorage
protected Object retrieveFromStorage(MessageCollection errors)
Retrieves the object from the storage item.- Parameters:
errors- for collecting errors- Returns:
- the object, null if failed to load
-
retrieveAutomatically
protected Object retrieveAutomatically(MessageCollection errors)
Retrieves the object automatically from file/callable actor/storage.- Parameters:
errors- for collecting errors- Returns:
- the object, null if failed
-
getObject
public Object getObject(MessageCollection errors)
Retrieves the object.- Parameters:
errors- for collecting errors- Returns:
- the object, null if failed to load
-
-