Package net.officefloor.cache.constant
Class ConstantCacheManagedObjectSource<K,V>
java.lang.Object
net.officefloor.frame.api.managedobject.source.impl.AbstractAsyncManagedObjectSource<O,F>
net.officefloor.frame.api.managedobject.source.impl.AbstractManagedObjectSource<None,ConstantCacheManagedObjectSource.Flows>
net.officefloor.cache.constant.ConstantCacheManagedObjectSource<K,V>
- All Implemented Interfaces:
ManagedObject,ManagedObjectSource<None,ConstantCacheManagedObjectSource.Flows>
public class ConstantCacheManagedObjectSource<K,V>
extends AbstractManagedObjectSource<None,ConstantCacheManagedObjectSource.Flows>
implements ManagedObject
Cache ManagedObjectSource that loads a constant data set.- Author:
- Daniel Sagenschneider
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class net.officefloor.frame.api.managedobject.source.impl.AbstractAsyncManagedObjectSource
AbstractAsyncManagedObjectSource.DependencyLabeller<K extends Enum<K>>, AbstractAsyncManagedObjectSource.ExecutionLabeller, AbstractAsyncManagedObjectSource.Labeller<K extends Enum<K>>, AbstractAsyncManagedObjectSource.MetaDataContext<O extends Enum<O>,F extends Enum<F>>, AbstractAsyncManagedObjectSource.SpecificationContext -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringQualifier for theConstantCacheDataRetrieverdependency.static final StringPropertyname for the poll interval in milliseconds. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCache()Obtains theCache.protected ManagedObjectSynchronously obtains theManagedObject.Obtains the object being managed.protected voidloadMetaData(AbstractAsyncManagedObjectSource.MetaDataContext<None, ConstantCacheManagedObjectSource.Flows> context) Overridden to load meta-data.protected void====================== ManagedObjectSource ==========================voidCalled once afterManagedObjectSource.init(ManagedObjectSourceContext)to indicate thisManagedObjectSourceshould start execution.Methods inherited from class net.officefloor.frame.api.managedobject.source.impl.AbstractManagedObjectSource
sourceManagedObjectMethods inherited from class net.officefloor.frame.api.managedobject.source.impl.AbstractAsyncManagedObjectSource
getSpecification, init, stop
-
Field Details
-
POLL_INTERVAL
Propertyname for the poll interval in milliseconds.- See Also:
-
DATA_RETRIEVER_QUALIFIER
Qualifier for theConstantCacheDataRetrieverdependency.- See Also:
-
-
Constructor Details
-
ConstantCacheManagedObjectSource
public ConstantCacheManagedObjectSource()
-
-
Method Details
-
getCache
Obtains theCache.- Returns:
Cache.
-
loadSpecification
====================== ManagedObjectSource ==========================- Specified by:
loadSpecificationin classAbstractAsyncManagedObjectSource<None,ConstantCacheManagedObjectSource.Flows> - Parameters:
context- Specifications.
-
loadMetaData
protected void loadMetaData(AbstractAsyncManagedObjectSource.MetaDataContext<None, ConstantCacheManagedObjectSource.Flows> context) throws ExceptionDescription copied from class:AbstractAsyncManagedObjectSourceOverridden to load meta-data.- Specified by:
loadMetaDatain classAbstractAsyncManagedObjectSource<None,ConstantCacheManagedObjectSource.Flows> - Parameters:
context- Meta-data.- Throws:
Exception- If fails to load the meta-data.
-
start
public void start(ManagedObjectExecuteContext<ConstantCacheManagedObjectSource.Flows> context) throws Exception Description copied from interface:ManagedObjectSourceCalled once after
ManagedObjectSource.init(ManagedObjectSourceContext)to indicate thisManagedObjectSourceshould start execution.On invocation of this method,
ProcessStateinstances may be invoked via theManagedObjectExecuteContext.- Specified by:
startin interfaceManagedObjectSource<K,V> - Overrides:
startin classAbstractAsyncManagedObjectSource<None,ConstantCacheManagedObjectSource.Flows> - Parameters:
context-ManagedObjectExecuteContextto use in starting thisManagedObjectSource.- Throws:
Exception- Should theManagedObjectSourcefail to start execution.
-
getManagedObject
Description copied from class:AbstractManagedObjectSourceSynchronously obtains theManagedObject.- Specified by:
getManagedObjectin classAbstractManagedObjectSource<None,ConstantCacheManagedObjectSource.Flows> - Returns:
ManagedObject.- Throws:
Throwable- If fails to obtain theManagedObject.
-
getObject
Description copied from interface:ManagedObjectObtains the object being managed.- Specified by:
getObjectin interfaceManagedObject- Returns:
- Object being managed.
- Throws:
Throwable- Indicating failed to obtain the object for use.
-