Interface ManagedObjectSourceContext<F extends Enum<F>>
- All Superinterfaces:
SourceContext,SourceProperties
- All Known Implementing Classes:
ManagedObjectSourceContextImpl
Context for a
ManagedObjectSource.- Author:
- Daniel Sagenschneider
-
Method Summary
Modifier and TypeMethodDescriptionaddFunctionDependency(String name, Class<?> objectType) Adds aManagedObjectFunctionDependency.<O extends Enum<O>,f extends Enum<f>>
ManagedObjectFunctionBuilder<O,f> addManagedFunction(String functionName, ManagedFunctionFactory<O, f> managedFunctionFactory) Creates theManagedObjectFunctionBuilderto build aManagedFunction.voidaddStartupFunction(String functionName, Object parameter) Adds aManagedFunctionto invoke on start up of theOffice.Creates aManagedObjectStartupCompletion.getFlow(int flowIndex) Obtains theManagedObjectSourceFlow.Obtains theManagedObjectSourceFlow.<O extends Enum<O>,f extends Enum<f>>
ManagedObjectFunctionBuilder<O,f> getRecycleFunction(ManagedFunctionFactory<O, f> managedFunctionFactory) Invoking this method during theManagedObjectSource.init(ManagedObjectSourceContext)will create recycle functionality for theManagedObjectto be returned to aManagedObjectPool.setDefaultManagedObjectPool(ManagedObjectPoolFactory poolFactory) Specifies the defaultManagedObjectPool.Methods inherited from interface net.officefloor.frame.api.source.SourceContext
getClassLoader, getClock, getLogger, getName, getOptionalResource, getProfiles, getResource, isLoadingType, loadClass, loadOptionalClass, loadOptionalService, loadOptionalServices, loadService, loadService, loadServicesMethods inherited from interface net.officefloor.frame.api.source.SourceProperties
getProperties, getProperty, getProperty, getPropertyNames
-
Method Details
-
setDefaultManagedObjectPool
Specifies the default
ManagedObjectPool.This may be overridden by
ManagedObjectBuilderconfiguration, however allows for a defaultManagedObjectPoolshould one not be configured.- Parameters:
poolFactory-ManagedObjectPoolFactoryfor the defaultManagedObjectPool.- Returns:
ManagedObjectPoolBuilder.
-
getFlow
Obtains theManagedObjectSourceFlow.- Parameters:
key- Key identifyingFlowbeing invoked by theManagedObjectSource.- Returns:
ManagedObjectSourceFlowfor the key.
-
getFlow
Obtains theManagedObjectSourceFlow.- Parameters:
flowIndex- Index identifying theFlow.- Returns:
ManagedObjectSourceFlowfor the index.
-
getRecycleFunction
<O extends Enum<O>,f extends Enum<f>> ManagedObjectFunctionBuilder<O,f> getRecycleFunction(ManagedFunctionFactory<O, f> managedFunctionFactory) Invoking this method during the
ManagedObjectSource.init(ManagedObjectSourceContext)will create recycle functionality for theManagedObjectto be returned to aManagedObjectPool.The initial
ManagedFunctionwill be used as the recycle starting point for thisManagedObject.- Type Parameters:
O- Dependency key type.f- Flow key type.- Parameters:
managedFunctionFactory-ManagedFunctionFactoryto create the recycleManagedFunction.- Returns:
ManagedObjectFunctionBuilderto recycle thisManagedObject.
-
addManagedFunction
<O extends Enum<O>,f extends Enum<f>> ManagedObjectFunctionBuilder<O,f> addManagedFunction(String functionName, ManagedFunctionFactory<O, f> managedFunctionFactory) Creates theManagedObjectFunctionBuilderto build aManagedFunction.- Type Parameters:
O- Dependency key type.f- Flow key type.- Parameters:
functionName- Name of theManagedFunction.managedFunctionFactory-ManagedFunctionFactoryto create theManagedFunction.- Returns:
- Specific
ManagedObjectFunctionBuilder.
-
addFunctionDependency
Adds aManagedObjectFunctionDependency.- Parameters:
name- Name of theManagedObjectFunctionDependency.objectType- Object type.- Returns:
ManagedObjectFunctionDependency.
-
createStartupCompletion
ManagedObjectStartupCompletion createStartupCompletion()Creates aManagedObjectStartupCompletion.- Returns:
- New
ManagedObjectStartupCompletionthat must be completed beforeOfficeFloorservicing.
-
addStartupFunction
Adds a
ManagedFunctionto invoke on start up of theOffice.The
ManagedFunctionmust be registered by thisManagedObjectSource.- Parameters:
functionName- Name ofManagedFunctionregistered by thisManagedObjectSource.parameter- Parameter for theManagedFunction. Typically the parameter will contain any createdManagedObjectStartupCompletionto enable indicating when startup is complete.
-