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 TypeMethodDescriptionvoidapply(GeneratorContext generatorContext) Applies the AWS Lambda Custom Runtime feature to the generator context by adding required dependencies, templates, and configuration settings.@NonNull String@NonNull StringgetName()The name of the feature.getRecipes(GeneratorContext generatorContext) getTitle()booleanSome 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 StringmainClassName(GeneratorContext generatorContext) Returns the fully qualified main class name to use for AWS Lambda custom runtime, based on the application type and features.voidprocessSelectedFeatures(FeatureContext featureContext) Processes selected features and ensures required AWS Lambda and HTTP client features are present.booleanshouldGenerateMainClassForRuntime(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, waitMethods inherited from interface io.micronaut.starter.feature.aws.AwsCloudFeature
getCloudMethods inherited from interface io.micronaut.core.naming.Described
getDescriptionMethods inherited from interface io.micronaut.projectgen.core.feature.Feature
getOrder, isCommunity, isPreviewMethods inherited from interface io.micronaut.starter.feature.function.FunctionFeature
supportsMethods 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:
processSelectedFeaturesin interfaceFeature- Parameters:
featureContext- The feature context to modify.
-
getName
Description copied from interface:FeatureThe name of the feature. It must be unique. -
isVisible
public boolean isVisible()Description copied from interface:FeatureSome 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:
isVisiblein interfaceApplicationFeature- Specified by:
isVisiblein interfaceFeature- Returns:
- True if the feature should be able to be selected by the user
-
getTitle
-
getDescription
- Specified by:
getDescriptionin interfaceio.micronaut.core.naming.Described- Specified by:
getDescriptionin interfaceFeature
-
apply
Applies the AWS Lambda Custom Runtime feature to the generator context by adding required dependencies, templates, and configuration settings.- Specified by:
applyin interfaceApplicationFeature- Specified by:
applyin interfaceFeature- Specified by:
applyin 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:
trueif the main class should be generated,falseotherwise.
-
mainClassName
Returns the fully qualified main class name to use for AWS Lambda custom runtime, based on the application type and features.- Specified by:
mainClassNamein 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:
getCategoryin interfaceFeature- Specified by:
getCategoryin interfaceFunctionFeature- Returns:
- The Category to which the feature belongs to.
-
getRecipes
- Specified by:
getRecipesin interfaceOpenRewriteFeature
-