Interface ManagedObjectSourceContext<F extends java.lang.Enum<F>>
-
- All Superinterfaces:
SourceContext,SourceProperties
- All Known Implementing Classes:
ManagedObjectSourceContextImpl
public interface ManagedObjectSourceContext<F extends java.lang.Enum<F>> extends SourceContext
Context for aManagedObjectSource.- Author:
- Daniel Sagenschneider
-
-
Method Summary
-
Methods inherited from interface net.officefloor.frame.api.source.SourceContext
getClassLoader, getClock, getLogger, getName, getOptionalResource, getProfiles, getResource, isLoadingType, loadClass, loadOptionalClass, loadOptionalService, loadOptionalServices, loadService, loadService, loadServices
-
Methods inherited from interface net.officefloor.frame.api.source.SourceProperties
getProperties, getProperty, getProperty, getPropertyNames
-
-
-
-
Method Detail
-
setDefaultManagedObjectPool
ManagedObjectPoolBuilder setDefaultManagedObjectPool(ManagedObjectPoolFactory poolFactory)
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
ManagedObjectSourceFlow getFlow(F key)
Obtains theManagedObjectSourceFlow.- Parameters:
key- Key identifyingFlowbeing invoked by theManagedObjectSource.- Returns:
ManagedObjectSourceFlowfor the key.
-
getFlow
ManagedObjectSourceFlow getFlow(int flowIndex)
Obtains theManagedObjectSourceFlow.- Parameters:
flowIndex- Index identifying theFlow.- Returns:
ManagedObjectSourceFlowfor the index.
-
getRecycleFunction
<O extends java.lang.Enum<O>,f extends java.lang.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 java.lang.Enum<O>,f extends java.lang.Enum<f>> ManagedObjectFunctionBuilder<O,f> addManagedFunction(java.lang.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
ManagedObjectFunctionDependency addFunctionDependency(java.lang.String name, java.lang.Class<?> objectType)
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
void addStartupFunction(java.lang.String functionName, java.lang.Object parameter)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.
-
-