Class AwsLambdaCustomRuntime
java.lang.Object
io.micronaut.starter.feature.awslambdacustomruntime.AwsLambdaCustomRuntime
- All Implemented Interfaces:
io.micronaut.core.naming.Described
,io.micronaut.core.naming.Named
,io.micronaut.core.order.Ordered
,Feature
,OpenRewriteFeature
,ApplicationFeature
,AwsCloudFeature
,CloudFeature
,FunctionFeature
@Requires(property="micronaut.starter.feature.aws.lambda.custom.runtime.enabled",
value="true",
defaultValue="true")
@Singleton
public class AwsLambdaCustomRuntime
extends Object
implements FunctionFeature, ApplicationFeature, AwsCloudFeature, OpenRewriteFeature
Feature that adds support for deploying Micronaut Functions using a custom AWS Lambda runtime.
Ensures necessary AWS Lambda and HTTP client features are included.
-
Field Summary
FieldsFields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ConstructorsConstructorDescriptionAwsLambdaCustomRuntime
(jakarta.inject.Provider<AwsLambda> awsLambda, HttpClientJdk httpClientJdk) -
Method Summary
Modifier and TypeMethodDescriptionvoid
apply
(GeneratorContext generatorContext) Applies the AWS Lambda Custom Runtime feature to the generator context by adding required dependencies, templates, and configuration settings.@NonNull String
@NonNull String
getName()
The name of the feature.getRecipes
(GeneratorContext generatorContext) getTitle()
boolean
Some features should not be visible to the user because they are a common parent of other selectable features, or they should always be applied, or any other reason.@Nullable String
mainClassName
(GeneratorContext generatorContext) Returns the fully qualified main class name to use for AWS Lambda custom runtime, based on the application type and features.void
processSelectedFeatures
(FeatureContext featureContext) Processes selected features and ensures required AWS Lambda and HTTP client features are present.boolean
shouldGenerateMainClassForRuntime
(GeneratorContext generatorContext) Determines if the FunctionLambdaRuntime main class should be generated.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.starter.feature.aws.AwsCloudFeature
getCloud
Methods inherited from interface io.micronaut.core.naming.Described
getDescription
Methods inherited from interface io.micronaut.projectgen.core.feature.Feature
getOrder, isCommunity, isPreview
Methods inherited from interface io.micronaut.starter.feature.function.FunctionFeature
supports
Methods inherited from interface io.micronaut.projectgen.core.openrewrite.OpenRewriteFeature
getFrameworkDocumentation, getThirdPartyDocumentation, processRecipes
-
Field Details
-
DEPENDENCY_AWS_FUNCTION_AWS_CUSTOM_RUNTIME
-
MAIN_CLASS_NAME
- See Also:
-
FEATURE_NAME_AWS_LAMBDA_CUSTOM_RUNTIME
- See Also:
-
-
Constructor Details
-
AwsLambdaCustomRuntime
public AwsLambdaCustomRuntime(jakarta.inject.Provider<AwsLambda> awsLambda, HttpClientJdk httpClientJdk)
-
-
Method Details
-
processSelectedFeatures
Processes selected features and ensures required AWS Lambda and HTTP client features are present.- Specified by:
processSelectedFeatures
in interfaceFeature
- Parameters:
featureContext
- The feature context to modify.
-
getName
Description copied from interface:Feature
The name of the feature. It must be unique. -
isVisible
public boolean isVisible()Description copied from interface:Feature
Some features should not be visible to the user because they are a common parent of other selectable features, or they should always be applied, or any other reason.- Specified by:
isVisible
in interfaceApplicationFeature
- Specified by:
isVisible
in interfaceFeature
- Returns:
- True if the feature should be able to be selected by the user
-
getTitle
-
getDescription
- Specified by:
getDescription
in interfaceio.micronaut.core.naming.Described
- Specified by:
getDescription
in interfaceFeature
-
apply
Applies the AWS Lambda Custom Runtime feature to the generator context by adding required dependencies, templates, and configuration settings.- Specified by:
apply
in interfaceApplicationFeature
- Specified by:
apply
in interfaceFeature
- Specified by:
apply
in interfaceOpenRewriteFeature
- Parameters:
generatorContext
- The context of the generator to apply this feature to.
-
shouldGenerateMainClassForRuntime
Determines if the FunctionLambdaRuntime main class should be generated.- Parameters:
generatorContext
- The generator context.- Returns:
true
if the main class should be generated,false
otherwise.
-
mainClassName
Returns the fully qualified main class name to use for AWS Lambda custom runtime, based on the application type and features.- Specified by:
mainClassName
in interfaceApplicationFeature
- Parameters:
generatorContext
- The generator context.- Returns:
- The main class name to use.
- Throws:
io.micronaut.context.exceptions.ConfigurationException
- if AWS Lambda feature is missing.
-
getCategory
- Specified by:
getCategory
in interfaceFeature
- Specified by:
getCategory
in interfaceFunctionFeature
- Returns:
- The Category to which the feature belongs to.
-
getRecipes
- Specified by:
getRecipes
in interfaceOpenRewriteFeature
-