Package org.springframework.aot

# Class AotDetector

java.lang.Object
org.springframework.aot.AotDetector

public abstract class AotDetector extends Object
Utility for determining if AOT-processed optimizations must be used rather than the regular runtime. Strictly for internal use within the framework.

Since:
  6.0
Author:
  Stephane Nicoll, Sebastien Deleuze

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`AOT_ENABLED`
System property that indicates the application should run with AOT generated artifacts.

## Constructor Summary

Constructors
Constructor
Description
`AotDetector()`

## Method Summary

Modifier and Type
Method
Description
`static boolean`
`useGeneratedArtifacts()`
Determine whether AOT optimizations must be considered at runtime.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### AOT_ENABLED

public static final String AOT_ENABLED
System property that indicates the application should run with AOT generated artifacts. If such optimizations are not available, it is recommended to throw an exception rather than fall back to the regular runtime behavior.

See Also:
  - Constant Field Values

## Constructor Details

### AotDetector

public AotDetector()

## Method Details

### useGeneratedArtifacts

public static boolean useGeneratedArtifacts()
Determine whether AOT optimizations must be considered at runtime. This is mandatory in a native image but can be triggered on the JVM using the "spring.aot.enabled" Spring property.

Returns:
  whether AOT optimizations must be considered