java.lang.Object
net.officefloor.frame.api.managedobject.source.impl.AbstractAsyncManagedObjectSource<O,F>
- All Implemented Interfaces:
ManagedObjectSource<O,F>
- Direct Known Subclasses:
AbstractManagedObjectSource,SpringBeanManagedObjectSource,TestManagedObject.TestManagedObjectSource
public abstract class AbstractAsyncManagedObjectSource<O extends Enum<O>,F extends Enum<F>>
extends Object
implements ManagedObjectSource<O,F>
Abstract
ManagedObjectSource allowing to asynchronously source the
ManagedObject.- Author:
- Daniel Sagenschneider
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceProvideAbstractAsyncManagedObjectSource.Labellerfunctionality along with qualifying type of dependency.static interfaceProvides the ability to label the requiredExecutionStrategy.static interfaceAbstractAsyncManagedObjectSource.Labeller<K extends Enum<K>>Provides the ability to label the required dependency orFlow.static interfaceContext for theManagedObjectSource.init(ManagedObjectSourceContext).static interfaceContext for thegetSpecification(). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionObtains the specification for this.init(ManagedObjectSourceContext<F> context) Initialises theManagedObjectSource.protected abstract voidOverridden to load meta-data.protected abstract voidOverridden 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, waitMethods inherited from interface net.officefloor.frame.api.managedobject.source.ManagedObjectSource
sourceManagedObject
-
Constructor Details
-
AbstractAsyncManagedObjectSource
public AbstractAsyncManagedObjectSource()
-
-
Method Details
-
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 Enum<O>,F extends 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 Exception Description copied from interface:ManagedObjectSourceInitialises theManagedObjectSource.- Specified by:
initin interfaceManagedObjectSource<O extends Enum<O>,F extends Enum<F>> - Parameters:
context-ManagedObjectSourceContextto use in initialising.- Returns:
- Meta-data to describe this.
- Throws:
Exception- Should theManagedObjectSourcefail to configure itself from the input properties.
-
loadMetaData
protected abstract void loadMetaData(AbstractAsyncManagedObjectSource.MetaDataContext<O, F> context) throws ExceptionOverridden to load meta-data.- Parameters:
context- Meta-data.- Throws:
Exception- If fails to load the meta-data.
-
start
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 Enum<O>,F extends Enum<F>> - Parameters:
context-ManagedObjectExecuteContextto use in starting thisManagedObjectSource.- Throws:
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.
-