Top Description Inners Fields Constructors Methods
org.springframework.aop.scope

pack-priv Class ScopedProxyBeanRegistrationAotProcessor

extends Object
implements BeanRegistrationAotProcessor
Class Inheritance
All Implemented Interfaces
org.springframework.beans.factory.aot.BeanRegistrationAotProcessor
Imports
java.util.function.Predicate, javax.lang.model.element.Modifier, org.apache.commons.logging.Log, .LogFactory, org.springframework.aot.generate.GeneratedMethod, .GenerationContext, org.springframework.beans.factory.aot.BeanRegistrationAotContribution, .BeanRegistrationAotProcessor, .BeanRegistrationCode, .BeanRegistrationCodeFragments, .BeanRegistrationCodeFragmentsDecorator, org.springframework.beans.factory.config.BeanDefinition, .ConfigurableBeanFactory, org.springframework.beans.factory.support.InstanceSupplier, .RegisteredBean, .RootBeanDefinition, org.springframework.core.ResolvableType, org.springframework.javapoet.ClassName, .CodeBlock, org.springframework.lang.Nullable

BeanRegistrationAotProcessor for ScopedProxyFactoryBean.
Authors
Stephane Nicoll, Phillip Webb
Since
6.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private static final Log

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private BeanDefinition
private String
public BeanRegistrationAotContribution
processAheadOfTime(RegisteredBean
the registered bean to process
registeredBean
)

Implements org.springframework.beans.factory.aot.BeanRegistrationAotProcessor.processAheadOfTime.

Process the given RegisteredBean instance ahead-of-time and return a contribution or null.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

loggerback to summary
private static final Log logger

Constructor Detail

ScopedProxyBeanRegistrationAotProcessorback to summary
pack-priv ScopedProxyBeanRegistrationAotProcessor()

Method Detail

getTargetBeanDefinitionback to summary
private BeanDefinition getTargetBeanDefinition(ConfigurableBeanFactory beanFactory, String targetBeanName)
Annotations
@Nullable
getTargetBeanNameback to summary
private String getTargetBeanName(BeanDefinition beanDefinition)
Annotations
@Nullable
processAheadOfTimeback to summary
public BeanRegistrationAotContribution processAheadOfTime(RegisteredBean registeredBean)

Implements org.springframework.beans.factory.aot.BeanRegistrationAotProcessor.processAheadOfTime.

Doc from org.springframework.beans.factory.aot.BeanRegistrationAotProcessor.processAheadOfTime.

Process the given RegisteredBean instance ahead-of-time and return a contribution or null.

Processors are free to use any techniques they like to analyze the given instance. Most typically use reflection to find fields or methods to use in the contribution. Contributions typically generate source code or resource files that can be used when the AOT optimized application runs.

If the given instance isn't relevant to the processor, it should return a null contribution.

Parameters
registeredBean:RegisteredBean

the registered bean to process

Returns:BeanRegistrationAotContribution

a BeanRegistrationAotContribution or null

Annotations
@Override
org.springframework.aop.scope back to summary

private Class ScopedProxyBeanRegistrationAotProcessor.ScopedProxyBeanRegistrationCodeFragments

extends BeanRegistrationCodeFragmentsDecorator
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final String
private final RegisteredBean
private final BeanDefinition
private final String

Constructor Summary

AccessConstructor and Description
pack-priv
ScopedProxyBeanRegistrationCodeFragments(BeanRegistrationCodeFragments delegate, RegisteredBean registeredBean, String targetBeanName, BeanDefinition targetBeanDefinition)

Method Summary

Modifier and TypeMethod and Description
public CodeBlock
generateInstanceSupplierCode(GenerationContext
the generation context
generationContext
,
BeanRegistrationCode
the bean registration code
beanRegistrationCode
,
boolean
if direct suppliers may be used rather than always needing an InstanceSupplier
allowDirectSupplierShortcut
)

Overrides org.springframework.beans.factory.aot.BeanRegistrationCodeFragmentsDecorator.generateInstanceSupplierCode.

Implements org.springframework.beans.factory.aot.BeanRegistrationCodeFragments.generateInstanceSupplierCode.

Generate the instance supplier code.

public CodeBlock
generateNewBeanDefinitionCode(GenerationContext
the generation context
generationContext
,
ResolvableType
the bean type
beanType
,
BeanRegistrationCode
the bean registration code
beanRegistrationCode
)

Overrides org.springframework.beans.factory.aot.BeanRegistrationCodeFragmentsDecorator.generateNewBeanDefinitionCode.

Implements org.springframework.beans.factory.aot.BeanRegistrationCodeFragments.generateNewBeanDefinitionCode.

Generate the code that defines the new bean definition instance.

public CodeBlock
generateSetBeanDefinitionPropertiesCode(GenerationContext
the generation context
generationContext
,
BeanRegistrationCode
the bean registration code
beanRegistrationCode
,
RootBeanDefinition beanDefinition, Predicate<String>
any attribute filtering that should be applied
attributeFilter
)

Overrides org.springframework.beans.factory.aot.BeanRegistrationCodeFragmentsDecorator.generateSetBeanDefinitionPropertiesCode.

Implements org.springframework.beans.factory.aot.BeanRegistrationCodeFragments.generateSetBeanDefinitionPropertiesCode.

Generate the code that sets the properties of the bean definition.

public ClassName
Inherited from org.springframework.beans.factory.aot.BeanRegistrationCodeFragmentsDecorator:
generateReturnCodegenerateSetBeanInstanceSupplierCode

Field Detail

REGISTERED_BEAN_PARAMETER_NAMEback to summary
private static final String REGISTERED_BEAN_PARAMETER_NAME
registeredBeanback to summary
private final RegisteredBean registeredBean
targetBeanDefinitionback to summary
private final BeanDefinition targetBeanDefinition
targetBeanNameback to summary
private final String targetBeanName

Constructor Detail

ScopedProxyBeanRegistrationCodeFragmentsback to summary
pack-priv ScopedProxyBeanRegistrationCodeFragments(BeanRegistrationCodeFragments delegate, RegisteredBean registeredBean, String targetBeanName, BeanDefinition targetBeanDefinition)

Method Detail

generateInstanceSupplierCodeback to summary
public CodeBlock generateInstanceSupplierCode(GenerationContext generationContext, BeanRegistrationCode beanRegistrationCode, boolean allowDirectSupplierShortcut)

Overrides org.springframework.beans.factory.aot.BeanRegistrationCodeFragmentsDecorator.generateInstanceSupplierCode.

Implements org.springframework.beans.factory.aot.BeanRegistrationCodeFragments.generateInstanceSupplierCode.

Doc from org.springframework.beans.factory.aot.BeanRegistrationCodeFragments.generateInstanceSupplierCode.

Generate the instance supplier code.

Parameters
generationContext:GenerationContext

the generation context

beanRegistrationCode:BeanRegistrationCode

the bean registration code

allowDirectSupplierShortcut:boolean

if direct suppliers may be used rather than always needing an InstanceSupplier

Returns:CodeBlock

the generated code

Annotations
@Override
generateNewBeanDefinitionCodeback to summary
public CodeBlock generateNewBeanDefinitionCode(GenerationContext generationContext, ResolvableType beanType, BeanRegistrationCode beanRegistrationCode)

Overrides org.springframework.beans.factory.aot.BeanRegistrationCodeFragmentsDecorator.generateNewBeanDefinitionCode.

Implements org.springframework.beans.factory.aot.BeanRegistrationCodeFragments.generateNewBeanDefinitionCode.

Doc from org.springframework.beans.factory.aot.BeanRegistrationCodeFragments.generateNewBeanDefinitionCode.

Generate the code that defines the new bean definition instance.

This should declare a variable named beanDefinition so that further fragments can refer to the variable to further tune the bean definition.

Parameters
generationContext:GenerationContext

the generation context

beanType:ResolvableType

the bean type

beanRegistrationCode:BeanRegistrationCode

the bean registration code

Returns:CodeBlock

the generated code

Annotations
@Override
generateSetBeanDefinitionPropertiesCodeback to summary
public CodeBlock generateSetBeanDefinitionPropertiesCode(GenerationContext generationContext, BeanRegistrationCode beanRegistrationCode, RootBeanDefinition beanDefinition, Predicate<String> attributeFilter)

Overrides org.springframework.beans.factory.aot.BeanRegistrationCodeFragmentsDecorator.generateSetBeanDefinitionPropertiesCode.

Implements org.springframework.beans.factory.aot.BeanRegistrationCodeFragments.generateSetBeanDefinitionPropertiesCode.

Doc from org.springframework.beans.factory.aot.BeanRegistrationCodeFragments.generateSetBeanDefinitionPropertiesCode.

Generate the code that sets the properties of the bean definition.

Parameters
generationContext:GenerationContext

the generation context

beanRegistrationCode:BeanRegistrationCode

the bean registration code

attributeFilter:Predicate<String>

any attribute filtering that should be applied

Returns:CodeBlock

the generated code

Annotations
@Override
getTargetback to summary
public ClassName getTarget(RegisteredBean registeredBean)

Overrides org.springframework.beans.factory.aot.BeanRegistrationCodeFragmentsDecorator.getTarget.

Implements org.springframework.beans.factory.aot.BeanRegistrationCodeFragments.getTarget.

Doc from org.springframework.beans.factory.aot.BeanRegistrationCodeFragments.getTarget.

Return the target for the registration. Used to determine where to write the code. This should take into account visibility issue, such as package access of an element of the bean to register.

Parameters
registeredBean:RegisteredBean

the registered bean

Returns:ClassName

the target ClassName

Annotations
@Override