Package org.springframework.context.aot
Class ContextAotProcessor
java.lang.Object
org.springframework.context.aot.AbstractAotProcessor<org.springframework.javapoet.ClassName>
org.springframework.context.aot.ContextAotProcessor
public abstract class ContextAotProcessor
extends AbstractAotProcessor<org.springframework.javapoet.ClassName>
Filesystem-based ahead-of-time (AOT) processing base implementation.
 
Concrete implementations are typically used to kick off optimization of an application in a build tool.
- Since:
- 6.0
- Author:
- Stephane Nicoll, Andy Wilkinson, Phillip Webb, Sam Brannen
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from class org.springframework.context.aot.AbstractAotProcessorAbstractAotProcessor.Settings
- 
Field SummaryFields inherited from class org.springframework.context.aot.AbstractAotProcessorAOT_PROCESSING
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedContextAotProcessor(Class<?> applicationClass, AbstractAotProcessor.Settings settings) Create a new processor for the specified application entry point and common settings.
- 
Method SummaryModifier and TypeMethodDescriptionprotected ClassNameGeneratorCallback to customize theClassNameGenerator.protected org.springframework.javapoet.ClassNameInvoke the processing by clearing output directories first, followed byperformAotProcessing(GenericApplicationContext).protected Class<?>Get the application entry point (typically a class with amain()method).getDefaultNativeImageArguments(String applicationClassName) Return the native image arguments to use.protected org.springframework.javapoet.ClassNameperformAotProcessing(GenericApplicationContext applicationContext) Perform ahead-of-time processing of the specified context.protected abstract GenericApplicationContextprepareApplicationContext(Class<?> applicationClass) Prepare theGenericApplicationContextfor the specified application entry point to be used against anApplicationContextAotGenerator.Methods inherited from class org.springframework.context.aot.AbstractAotProcessorcreateFileSystemGeneratedFiles, deleteExistingOutput, getSettings, process, writeHints
- 
Constructor Details- 
ContextAotProcessorCreate a new processor for the specified application entry point and common settings.- Parameters:
- applicationClass- the application entry point (class with a- main()method)
- settings- the settings to apply
 
 
- 
- 
Method Details- 
getApplicationClassGet the application entry point (typically a class with amain()method).
- 
doProcessprotected org.springframework.javapoet.ClassName doProcess()Invoke the processing by clearing output directories first, followed byperformAotProcessing(GenericApplicationContext).- Specified by:
- doProcessin class- AbstractAotProcessor<org.springframework.javapoet.ClassName>
- Returns:
- the ClassNameof theApplicationContextInitializerentry point
 
- 
prepareApplicationContextPrepare theGenericApplicationContextfor the specified application entry point to be used against anApplicationContextAotGenerator.- Returns:
- a non-refreshed GenericApplicationContext
 
- 
performAotProcessingprotected org.springframework.javapoet.ClassName performAotProcessing(GenericApplicationContext applicationContext) Perform ahead-of-time processing of the specified context.Code, resources, and generated classes are stored in the configured output directories. In addition, run-time hints are registered for the application and its entry point. - Parameters:
- applicationContext- the context to process
 
- 
createClassNameGeneratorCallback to customize theClassNameGenerator.By default, a standard ClassNameGeneratorusing the configured application entry point as the default target is used.- Returns:
- the class name generator
 
- 
getDefaultNativeImageArgumentsReturn the native image arguments to use.By default, the main class to use, as well as standard application flags are added. If the returned list is empty, no native-image.propertiesis contributed.- Parameters:
- applicationClassName- the fully qualified class name of the application entry point
- Returns:
- the native image options to contribute
 
 
-