Class AbstractAsyncManagedObjectSource<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>
- java.lang.Object
-
- net.officefloor.frame.api.managedobject.source.impl.AbstractAsyncManagedObjectSource<O,F>
-
- All Implemented Interfaces:
ManagedObjectSource<O,F>
- Direct Known Subclasses:
AbstractManagedObjectSource,TestManagedObject.TestManagedObjectSource
public abstract class AbstractAsyncManagedObjectSource<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>> extends java.lang.Object implements ManagedObjectSource<O,F>
AbstractManagedObjectSourceallowing to asynchronously source theManagedObject.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceAbstractAsyncManagedObjectSource.DependencyLabeller<K extends java.lang.Enum<K>>ProvideAbstractAsyncManagedObjectSource.Labellerfunctionality along with qualifying type of dependency.static interfaceAbstractAsyncManagedObjectSource.ExecutionLabellerProvides the ability to label the requiredExecutionStrategy.static interfaceAbstractAsyncManagedObjectSource.Labeller<K extends java.lang.Enum<K>>Provides the ability to label the required dependency orFlow.static interfaceAbstractAsyncManagedObjectSource.MetaDataContext<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>Context for theManagedObjectSource.init(ManagedObjectSourceContext).static interfaceAbstractAsyncManagedObjectSource.SpecificationContextContext for thegetSpecification().
-
Constructor Summary
Constructors Constructor Description AbstractAsyncManagedObjectSource()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ManagedObjectSourceSpecificationgetSpecification()Obtains the specification for this.ManagedObjectSourceMetaData<O,F>init(ManagedObjectSourceContext<F> context)Initialises theManagedObjectSource.protected abstract voidloadMetaData(AbstractAsyncManagedObjectSource.MetaDataContext<O,F> context)Overridden to load meta-data.protected abstract voidloadSpecification(AbstractAsyncManagedObjectSource.SpecificationContext context)Overridden to load specifications.voidstart(ManagedObjectExecuteContext<F> context)Called once afterManagedObjectSource.init(ManagedObjectSourceContext)to indicate thisManagedObjectSourceshould start execution.voidstop()Called to notify that theOfficeFlooris being closed.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.officefloor.frame.api.managedobject.source.ManagedObjectSource
sourceManagedObject
-
-
-
-
Method Detail
-
getSpecification
public ManagedObjectSourceSpecification getSpecification()
Description copied from interface:ManagedObjectSourceObtains the specification for this.
This will be called before any other methods, therefore this method must be able to return the specification immediately after a default constructor instantiation.
- Specified by:
getSpecificationin interfaceManagedObjectSource<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>- Returns:
- Specification of this.
-
loadSpecification
protected abstract void loadSpecification(AbstractAsyncManagedObjectSource.SpecificationContext context)
Overridden to load specifications.- Parameters:
context- Specifications.
-
init
public ManagedObjectSourceMetaData<O,F> init(ManagedObjectSourceContext<F> context) throws java.lang.Exception
Description copied from interface:ManagedObjectSourceInitialises theManagedObjectSource.- Specified by:
initin interfaceManagedObjectSource<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>- Parameters:
context-ManagedObjectSourceContextto use in initialising.- Returns:
- Meta-data to describe this.
- Throws:
java.lang.Exception- Should theManagedObjectSourcefail to configure itself from the input properties.
-
loadMetaData
protected abstract void loadMetaData(AbstractAsyncManagedObjectSource.MetaDataContext<O,F> context) throws java.lang.Exception
Overridden to load meta-data.- Parameters:
context- Meta-data.- Throws:
java.lang.Exception- If fails to load the meta-data.
-
start
public void start(ManagedObjectExecuteContext<F> context) throws java.lang.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<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>- Parameters:
context-ManagedObjectExecuteContextto use in starting thisManagedObjectSource.- Throws:
java.lang.Exception- Should theManagedObjectSourcefail to start execution.
-
stop
public void stop()
Description copied from interface:ManagedObjectSourceCalled to notify that the
OfficeFlooris being closed.On return from this method, no further
ProcessStateinstances may be invoked.
-
-