public class ObjectFactoryClassRepository extends Object
FactoryBean from an
ObjectFactory. This is done because we need dependency injection and instrospection done over the ObjectFactory
without the user knowing about it.
The created FactoryBean is the one that receives the injection of fields declared by
the ObjectFactory. It also provides information about the instance type that is creating since it's used to know the
order in which beans must be initialised based on the dependencies between them.
The repository has a cache of the created classes based on the configuration of the ComponentBuildingDefinition and the
component configuration.
| Constructor and Description |
|---|
ObjectFactoryClassRepository() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Removes all registered callbacks create for each created
FactoryBean class. |
Class<ObjectFactory> |
getObjectFactoryClass(ComponentBuildingDefinition componentBuildingDefinition,
Class objectFactoryType,
Class createdObjectType,
Supplier<Boolean> isLazyInitFunction,
Consumer<Object> instancePostCreationFunction)
|
public Class<ObjectFactory> getObjectFactoryClass(ComponentBuildingDefinition componentBuildingDefinition, Class objectFactoryType, Class createdObjectType, Supplier<Boolean> isLazyInitFunction, Consumer<Object> instancePostCreationFunction)
Class for the ObjectFactory defined by the objectFactoryType parameter. Once acquired the
Class instance should not be reused for another ComponentBuildingDefinition.componentBuildingDefinition - the definition on how to build the componentobjectFactoryType - the ObjectFactory of the componentcreatedObjectType - the type of object created by the ObjectFactoryisLazyInitFunction - function that defines if the object created by the component can be created lazilyinstancePostCreationFunction - function to do custom processing of the created instance by the ObjectFactory.
When there's no need for post processing this value must be Optional.empty()FactoryBean class to be used by spring for the provided configuration.public void destroy()
FactoryBean class. This is a must since it prevents a memory
leak in CGLIBCopyright © 2003–2017 MuleSoft, Inc.. All rights reserved.