Class ManagedObjectSourceContextImpl<F extends java.lang.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 java.lang.Enum<F>> extends SourceContextImpl implements ManagedObjectSourceContext<F>
Implementation of theManagedObjectSourceContext.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classManagedObjectSourceContextImpl.ManagedObjectFunctionDependencyImplManagedObjectFunctionDependencyimplementation.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringMANAGED_OBJECT_RECYCLE_FUNCTION_NAMEName of the recycle theManagedFunction.
-
Constructor Summary
Constructors Constructor Description ManagedObjectSourceContextImpl(java.lang.String managedObjectSourceName, boolean isLoadingType, java.lang.String managedObjectName, ManagingOfficeConfiguration<F> managingOfficeConfiguration, java.lang.String[] additionalProfiles, SourceProperties properties, SourceContext sourceContext, ManagingOfficeBuilder<F> managingOfficeBuilder, OfficeBuilder officeBuilder, java.lang.Object startupNotify)Initiate.
-
Method Summary
-
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, loadServices
-
Methods inherited from class net.officefloor.frame.impl.construct.source.SourcePropertiesImpl
addProperty, getProperties, getProperty, getProperty, getPropertyNames
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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
-
-
-
-
Field Detail
-
MANAGED_OBJECT_RECYCLE_FUNCTION_NAME
public static final java.lang.String MANAGED_OBJECT_RECYCLE_FUNCTION_NAME
Name of the recycle theManagedFunction.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ManagedObjectSourceContextImpl
public ManagedObjectSourceContextImpl(java.lang.String managedObjectSourceName, boolean isLoadingType, java.lang.String managedObjectName, ManagingOfficeConfiguration<F> managingOfficeConfiguration, java.lang.String[] additionalProfiles, SourceProperties properties, SourceContext sourceContext, ManagingOfficeBuilder<F> managingOfficeBuilder, OfficeBuilder officeBuilder, java.lang.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 Detail
-
flagInitOver
public java.lang.String[] flagInitOver(ManagedObjectFunctionEnhancer[] enhancers)
Indicates that theManagedObjectSource.init(ManagedObjectSourceContext)method has completed.- Parameters:
enhancers-ManagedObjectFunctionEnhancerinstances.- Returns:
- Listing of issues in sourcing the
ManagedObjectSource.
-
getDefaultManagedObjectPoolConfiguration
public ManagedObjectPoolConfiguration getDefaultManagedObjectPoolConfiguration()
Obtains the defaultManagedObjectPoolConfiguration.- Returns:
- Default
ManagedObjectPoolConfiguration. May benullif no defaultManagedObjectPool.
-
getRecycleFunctionName
public java.lang.String 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
public ManagedFunctionInvocation[] getStartupFunctions()
Obtains the startupManagedFunctionInvocationinstances.- Returns:
- Startup
ManagedFunctionInvocationinstances.
-
getServiceReadiness
public ManagedObjectServiceReady[] 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 java.lang.Enum<F>>- Parameters:
managedObjectPoolFactory-ManagedObjectPoolFactoryfor the defaultManagedObjectPool.- Returns:
ManagedObjectPoolBuilder.
-
getRecycleFunction
public <O extends java.lang.Enum<O>,f extends java.lang.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 java.lang.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 java.lang.Enum<o>,f extends java.lang.Enum<f>> ManagedObjectFunctionBuilder<o,f> addManagedFunction(java.lang.String functionName, ManagedFunctionFactory<o,f> managedFunctionFactory)
Description copied from interface:ManagedObjectSourceContextCreates theManagedObjectFunctionBuilderto build aManagedFunction.- Specified by:
addManagedFunctionin interfaceManagedObjectSourceContext<F extends java.lang.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
public ManagedObjectFunctionDependency addFunctionDependency(java.lang.String name, java.lang.Class<?> objectType)
Description copied from interface:ManagedObjectSourceContextAdds aManagedObjectFunctionDependency.- Specified by:
addFunctionDependencyin interfaceManagedObjectSourceContext<F extends java.lang.Enum<F>>- Parameters:
name- Name of theManagedObjectFunctionDependency.objectType- Object type.- Returns:
ManagedObjectFunctionDependency.
-
createStartupCompletion
public ManagedObjectStartupCompletion createStartupCompletion()
Description copied from interface:ManagedObjectSourceContextCreates aManagedObjectStartupCompletion.- Specified by:
createStartupCompletionin interfaceManagedObjectSourceContext<F extends java.lang.Enum<F>>- Returns:
- New
ManagedObjectStartupCompletionthat must be completed beforeOfficeFloorservicing.
-
addStartupFunction
public void addStartupFunction(java.lang.String functionName, java.lang.Object parameter)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 java.lang.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
public ManagedObjectSourceFlow getFlow(F key)
Description copied from interface:ManagedObjectSourceContextObtains theManagedObjectSourceFlow.- Specified by:
getFlowin interfaceManagedObjectSourceContext<F extends java.lang.Enum<F>>- Parameters:
key- Key identifyingFlowbeing invoked by theManagedObjectSource.- Returns:
ManagedObjectSourceFlowfor the key.
-
getFlow
public ManagedObjectSourceFlow getFlow(int flowIndex)
Description copied from interface:ManagedObjectSourceContextObtains theManagedObjectSourceFlow.- Specified by:
getFlowin interfaceManagedObjectSourceContext<F extends java.lang.Enum<F>>- Parameters:
flowIndex- Index identifying theFlow.- Returns:
ManagedObjectSourceFlowfor the index.
-
-