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 class
ManagedObjectSourceContextImpl.ManagedObjectFunctionDependencyImpl
ManagedObjectFunctionDependency
implementation.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
MANAGED_OBJECT_RECYCLE_FUNCTION_NAME
Name 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
-OfficeBuilder
for 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
-ManagedObjectFunctionEnhancer
instances.- Returns:
- Listing of issues in sourcing the
ManagedObjectSource
.
-
getDefaultManagedObjectPoolConfiguration
public ManagedObjectPoolConfiguration getDefaultManagedObjectPoolConfiguration()
Obtains the defaultManagedObjectPoolConfiguration
.- Returns:
- Default
ManagedObjectPoolConfiguration
. May benull
if no defaultManagedObjectPool
.
-
getRecycleFunctionName
public java.lang.String getRecycleFunctionName()
Obtains the name of theManagedFunction
to recycle thisManagedObject
.- Returns:
- Name of the
ManagedFunction
to recycle thisManagedObject
ornull
if no recycling of thisManagedObject
.
-
getManagedObjectFunctionDependencies
public ManagedObjectSourceContextImpl.ManagedObjectFunctionDependencyImpl[] getManagedObjectFunctionDependencies()
Obtains theManagedObjectSourceContextImpl.ManagedObjectFunctionDependencyImpl
instances.- Returns:
ManagedObjectSourceContextImpl.ManagedObjectFunctionDependencyImpl
instances.
-
getStartupFunctions
public ManagedFunctionInvocation[] getStartupFunctions()
Obtains the startupManagedFunctionInvocation
instances.- Returns:
- Startup
ManagedFunctionInvocation
instances.
-
getServiceReadiness
public ManagedObjectServiceReady[] getServiceReadiness()
Obtains theManagedObjectServiceReady
instances.- Returns:
ManagedObjectServiceReady
instances.
-
setDefaultManagedObjectPool
public ManagedObjectPoolBuilder setDefaultManagedObjectPool(ManagedObjectPoolFactory managedObjectPoolFactory)
Description copied from interface:ManagedObjectSourceContext
Specifies the default
ManagedObjectPool
.This may be overridden by
ManagedObjectBuilder
configuration, however allows for a defaultManagedObjectPool
should one not be configured.- Specified by:
setDefaultManagedObjectPool
in interfaceManagedObjectSourceContext<F extends java.lang.Enum<F>>
- Parameters:
managedObjectPoolFactory
-ManagedObjectPoolFactory
for 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:ManagedObjectSourceContext
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
.- Specified by:
getRecycleFunction
in interfaceManagedObjectSourceContext<F extends java.lang.Enum<F>>
- Type Parameters:
O
- Dependency key type.f
- Flow key type.- Parameters:
managedFunctionFactory
-ManagedFunctionFactory
to create the recycleManagedFunction
.- Returns:
ManagedObjectFunctionBuilder
to 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:ManagedObjectSourceContext
Creates theManagedObjectFunctionBuilder
to build aManagedFunction
.- Specified by:
addManagedFunction
in interfaceManagedObjectSourceContext<F extends java.lang.Enum<F>>
- Type Parameters:
o
- Dependency key type.f
- Flow key type.- Parameters:
functionName
- Name of theManagedFunction
.managedFunctionFactory
-ManagedFunctionFactory
to create theManagedFunction
.- Returns:
- Specific
ManagedObjectFunctionBuilder
.
-
addFunctionDependency
public ManagedObjectFunctionDependency addFunctionDependency(java.lang.String name, java.lang.Class<?> objectType)
Description copied from interface:ManagedObjectSourceContext
Adds aManagedObjectFunctionDependency
.- Specified by:
addFunctionDependency
in 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:ManagedObjectSourceContext
Creates aManagedObjectStartupCompletion
.- Specified by:
createStartupCompletion
in interfaceManagedObjectSourceContext<F extends java.lang.Enum<F>>
- Returns:
- New
ManagedObjectStartupCompletion
that must be completed beforeOfficeFloor
servicing.
-
addStartupFunction
public void addStartupFunction(java.lang.String functionName, java.lang.Object parameter)
Description copied from interface:ManagedObjectSourceContext
Adds a
ManagedFunction
to invoke on start up of theOffice
.The
ManagedFunction
must be registered by thisManagedObjectSource
.- Specified by:
addStartupFunction
in interfaceManagedObjectSourceContext<F extends java.lang.Enum<F>>
- 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.
-
getFlow
public ManagedObjectSourceFlow getFlow(F key)
Description copied from interface:ManagedObjectSourceContext
Obtains theManagedObjectSourceFlow
.- Specified by:
getFlow
in interfaceManagedObjectSourceContext<F extends java.lang.Enum<F>>
- Parameters:
key
- Key identifyingFlow
being invoked by theManagedObjectSource
.- Returns:
ManagedObjectSourceFlow
for the key.
-
getFlow
public ManagedObjectSourceFlow getFlow(int flowIndex)
Description copied from interface:ManagedObjectSourceContext
Obtains theManagedObjectSourceFlow
.- Specified by:
getFlow
in interfaceManagedObjectSourceContext<F extends java.lang.Enum<F>>
- Parameters:
flowIndex
- Index identifying theFlow
.- Returns:
ManagedObjectSourceFlow
for the index.
-
-