Class ManagedObjectSourceContextImpl<F extends Enum<F>>
java.lang.Object
net.officefloor.frame.impl.construct.source.SourcePropertiesImpl
net.officefloor.frame.impl.construct.source.SourceContextImpl
net.officefloor.frame.impl.construct.managedobjectsource.ManagedObjectSourceContextImpl<F>
- All Implemented Interfaces:
ManagedObjectSourceContext<F>,ServiceContext,SourceContext,SourceProperties
public class ManagedObjectSourceContextImpl<F extends Enum<F>>
extends SourceContextImpl
implements ManagedObjectSourceContext<F>
Implementation of the
ManagedObjectSourceContext.- Author:
- Daniel Sagenschneider
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionManagedObjectSourceContextImpl(String managedObjectSourceName, boolean isLoadingType, String managedObjectName, ManagingOfficeConfiguration<F> managingOfficeConfiguration, String[] additionalProfiles, SourceProperties properties, SourceContext sourceContext, ManagingOfficeBuilder<F> managingOfficeBuilder, OfficeBuilder officeBuilder, Object startupNotify) Initiate. -
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.String[]flagInitOver(ManagedObjectFunctionEnhancer[] enhancers) Indicates that theManagedObjectSource.init(ManagedObjectSourceContext)method has completed.Obtains the defaultManagedObjectPoolConfiguration.getFlow(int flowIndex) Obtains theManagedObjectSourceFlow.Obtains theManagedObjectSourceFlow.Obtains theManagedObjectSourceContextImpl.ManagedObjectFunctionDependencyImplinstances.<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.Obtains the name of theManagedFunctionto recycle thisManagedObject.Obtains theManagedObjectServiceReadyinstances.Obtains the startupManagedFunctionInvocationinstances.setDefaultManagedObjectPool(ManagedObjectPoolFactory managedObjectPoolFactory) Specifies the defaultManagedObjectPool.Methods inherited from class net.officefloor.frame.impl.construct.source.SourceContextImpl
getClassLoader, getClock, getLogger, getName, getOptionalResource, getProfiles, getResource, isLoadingType, loadClass, loadOptionalClass, loadOptionalService, loadOptionalServices, loadService, loadService, loadServicesMethods inherited from class net.officefloor.frame.impl.construct.source.SourcePropertiesImpl
addProperty, getProperties, getProperty, getProperty, getPropertyNamesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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
-
Field Details
-
MANAGED_OBJECT_RECYCLE_FUNCTION_NAME
Name of the recycle theManagedFunction.- See Also:
-
-
Constructor Details
-
ManagedObjectSourceContextImpl
public ManagedObjectSourceContextImpl(String managedObjectSourceName, boolean isLoadingType, String managedObjectName, ManagingOfficeConfiguration<F> managingOfficeConfiguration, String[] additionalProfiles, SourceProperties properties, SourceContext sourceContext, ManagingOfficeBuilder<F> managingOfficeBuilder, OfficeBuilder officeBuilder, Object startupNotify) Initiate.- Parameters:
managedObjectSourceName- Name of theManagedObjectSource.isLoadingType- Indicates if loading type.managedObjectName- Name of theManagedObject.managingOfficeConfiguration-ManagingOfficeConfiguration.additionalProfiles- Additional profiles.properties- Properties.sourceContext- DelegateSourceContext.managingOfficeBuilder-ManagingOfficeBuilder.officeBuilder-OfficeBuilderfor the office using theManagedObjectSource.startupNotify- Object to notify on start up completion.
-
-
Method Details
-
flagInitOver
Indicates that theManagedObjectSource.init(ManagedObjectSourceContext)method has completed.- Parameters:
enhancers-ManagedObjectFunctionEnhancerinstances.- Returns:
- Listing of issues in sourcing the
ManagedObjectSource.
-
getDefaultManagedObjectPoolConfiguration
Obtains the defaultManagedObjectPoolConfiguration.- Returns:
- Default
ManagedObjectPoolConfiguration. May benullif no defaultManagedObjectPool.
-
getRecycleFunctionName
Obtains the name of theManagedFunctionto recycle thisManagedObject.- Returns:
- Name of the
ManagedFunctionto recycle thisManagedObjectornullif no recycling of thisManagedObject.
-
getManagedObjectFunctionDependencies
public ManagedObjectSourceContextImpl.ManagedObjectFunctionDependencyImpl[] getManagedObjectFunctionDependencies()Obtains theManagedObjectSourceContextImpl.ManagedObjectFunctionDependencyImplinstances.- Returns:
ManagedObjectSourceContextImpl.ManagedObjectFunctionDependencyImplinstances.
-
getStartupFunctions
Obtains the startupManagedFunctionInvocationinstances.- Returns:
- Startup
ManagedFunctionInvocationinstances.
-
getServiceReadiness
Obtains theManagedObjectServiceReadyinstances.- Returns:
ManagedObjectServiceReadyinstances.
-
setDefaultManagedObjectPool
public ManagedObjectPoolBuilder setDefaultManagedObjectPool(ManagedObjectPoolFactory managedObjectPoolFactory) Description copied from interface:ManagedObjectSourceContextSpecifies the default
ManagedObjectPool.This may be overridden by
ManagedObjectBuilderconfiguration, however allows for a defaultManagedObjectPoolshould one not be configured.- Specified by:
setDefaultManagedObjectPoolin interfaceManagedObjectSourceContext<F extends Enum<F>>- Parameters:
managedObjectPoolFactory-ManagedObjectPoolFactoryfor the defaultManagedObjectPool.- Returns:
ManagedObjectPoolBuilder.
-
getRecycleFunction
public <O extends Enum<O>,f extends Enum<f>> ManagedObjectFunctionBuilder<O,f> getRecycleFunction(ManagedFunctionFactory<O, f> managedFunctionFactory) Description copied from interface:ManagedObjectSourceContextInvoking 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.- Specified by:
getRecycleFunctionin interfaceManagedObjectSourceContext<F extends Enum<F>>- Type Parameters:
O- Dependency key type.f- Flow key type.- Parameters:
managedFunctionFactory-ManagedFunctionFactoryto create the recycleManagedFunction.- Returns:
ManagedObjectFunctionBuilderto recycle thisManagedObject.
-
addManagedFunction
public <o extends Enum<o>,f extends Enum<f>> ManagedObjectFunctionBuilder<o,f> addManagedFunction(String functionName, ManagedFunctionFactory<o, f> managedFunctionFactory) Description copied from interface:ManagedObjectSourceContextCreates theManagedObjectFunctionBuilderto build aManagedFunction.- Specified by:
addManagedFunctionin interfaceManagedObjectSourceContext<F extends Enum<F>>- Type Parameters:
o- Dependency key type.f- Flow key type.- Parameters:
functionName- Name of theManagedFunction.managedFunctionFactory-ManagedFunctionFactoryto create theManagedFunction.- Returns:
- Specific
ManagedObjectFunctionBuilder.
-
addFunctionDependency
Description copied from interface:ManagedObjectSourceContextAdds aManagedObjectFunctionDependency.- Specified by:
addFunctionDependencyin interfaceManagedObjectSourceContext<F extends Enum<F>>- Parameters:
name- Name of theManagedObjectFunctionDependency.objectType- Object type.- Returns:
ManagedObjectFunctionDependency.
-
createStartupCompletion
Description copied from interface:ManagedObjectSourceContextCreates aManagedObjectStartupCompletion.- Specified by:
createStartupCompletionin interfaceManagedObjectSourceContext<F extends Enum<F>>- Returns:
- New
ManagedObjectStartupCompletionthat must be completed beforeOfficeFloorservicing.
-
addStartupFunction
Description copied from interface:ManagedObjectSourceContextAdds a
ManagedFunctionto invoke on start up of theOffice.The
ManagedFunctionmust be registered by thisManagedObjectSource.- Specified by:
addStartupFunctionin interfaceManagedObjectSourceContext<F extends Enum<F>>- Parameters:
functionName- Name ofManagedFunctionregistered by thisManagedObjectSource.parameter- Parameter for theManagedFunction. Typically the parameter will contain any createdManagedObjectStartupCompletionto enable indicating when startup is complete.
-
getFlow
Description copied from interface:ManagedObjectSourceContextObtains theManagedObjectSourceFlow.- Specified by:
getFlowin interfaceManagedObjectSourceContext<F extends Enum<F>>- Parameters:
key- Key identifyingFlowbeing invoked by theManagedObjectSource.- Returns:
ManagedObjectSourceFlowfor the key.
-
getFlow
Description copied from interface:ManagedObjectSourceContextObtains theManagedObjectSourceFlow.- Specified by:
getFlowin interfaceManagedObjectSourceContext<F extends Enum<F>>- Parameters:
flowIndex- Index identifying theFlow.- Returns:
ManagedObjectSourceFlowfor the index.
-