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>
AbstractManagedObjectSource
allowing to asynchronously source theManagedObject
.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
AbstractAsyncManagedObjectSource.DependencyLabeller<K extends java.lang.Enum<K>>
ProvideAbstractAsyncManagedObjectSource.Labeller
functionality along with qualifying type of dependency.static interface
AbstractAsyncManagedObjectSource.ExecutionLabeller
Provides the ability to label the requiredExecutionStrategy
.static interface
AbstractAsyncManagedObjectSource.Labeller<K extends java.lang.Enum<K>>
Provides the ability to label the required dependency orFlow
.static interface
AbstractAsyncManagedObjectSource.MetaDataContext<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>
Context for theManagedObjectSource.init(ManagedObjectSourceContext)
.static interface
AbstractAsyncManagedObjectSource.SpecificationContext
Context for thegetSpecification()
.
-
Constructor Summary
Constructors Constructor Description AbstractAsyncManagedObjectSource()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ManagedObjectSourceSpecification
getSpecification()
Obtains the specification for this.ManagedObjectSourceMetaData<O,F>
init(ManagedObjectSourceContext<F> context)
Initialises theManagedObjectSource
.protected abstract void
loadMetaData(AbstractAsyncManagedObjectSource.MetaDataContext<O,F> context)
Overridden to load meta-data.protected abstract void
loadSpecification(AbstractAsyncManagedObjectSource.SpecificationContext context)
Overridden to load specifications.void
start(ManagedObjectExecuteContext<F> context)
Called once afterManagedObjectSource.init(ManagedObjectSourceContext)
to indicate thisManagedObjectSource
should start execution.void
stop()
Called to notify that theOfficeFloor
is 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:ManagedObjectSource
Obtains 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:
getSpecification
in 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:ManagedObjectSource
Initialises theManagedObjectSource
.- Specified by:
init
in interfaceManagedObjectSource<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>
- Parameters:
context
-ManagedObjectSourceContext
to use in initialising.- Returns:
- Meta-data to describe this.
- Throws:
java.lang.Exception
- Should theManagedObjectSource
fail 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:ManagedObjectSource
Called once after
ManagedObjectSource.init(ManagedObjectSourceContext)
to indicate thisManagedObjectSource
should start execution.On invocation of this method,
ProcessState
instances may be invoked via theManagedObjectExecuteContext
.- Specified by:
start
in interfaceManagedObjectSource<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>
- Parameters:
context
-ManagedObjectExecuteContext
to use in starting thisManagedObjectSource
.- Throws:
java.lang.Exception
- Should theManagedObjectSource
fail to start execution.
-
stop
public void stop()
Description copied from interface:ManagedObjectSource
Called to notify that the
OfficeFloor
is being closed.On return from this method, no further
ProcessState
instances may be invoked.
-
-