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
ManagedObjectBuilder
configuration, however allows for a defaultManagedObjectPool
should one not be configured.- Parameters:
poolFactory
-ManagedObjectPoolFactory
for the defaultManagedObjectPool
.- Returns:
ManagedObjectPoolBuilder
.
-
getFlow
ManagedObjectSourceFlow getFlow(F key)
Obtains theManagedObjectSourceFlow
.- Parameters:
key
- Key identifyingFlow
being invoked by theManagedObjectSource
.- Returns:
ManagedObjectSourceFlow
for the key.
-
getFlow
ManagedObjectSourceFlow getFlow(int flowIndex)
Obtains theManagedObjectSourceFlow
.- Parameters:
flowIndex
- Index identifying theFlow
.- Returns:
ManagedObjectSourceFlow
for 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 theManagedObject
to be returned to aManagedObjectPool
.The initial
ManagedFunction
will be used as the recycle starting point for thisManagedObject
.- Type Parameters:
O
- Dependency key type.f
- Flow key type.- Parameters:
managedFunctionFactory
-ManagedFunctionFactory
to create the recycleManagedFunction
.- Returns:
ManagedObjectFunctionBuilder
to 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 theManagedObjectFunctionBuilder
to build aManagedFunction
.- Type Parameters:
O
- Dependency key type.f
- Flow key type.- Parameters:
functionName
- Name of theManagedFunction
.managedFunctionFactory
-ManagedFunctionFactory
to 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
ManagedObjectStartupCompletion
that must be completed beforeOfficeFloor
servicing.
-
addStartupFunction
void addStartupFunction(java.lang.String functionName, java.lang.Object parameter)
Adds a
ManagedFunction
to invoke on start up of theOffice
.The
ManagedFunction
must be registered by thisManagedObjectSource
.- Parameters:
functionName
- Name ofManagedFunction
registered by thisManagedObjectSource
.parameter
- Parameter for theManagedFunction
. Typically the parameter will contain any createdManagedObjectStartupCompletion
to enable indicating when startup is complete.
-
-