Package io.micronaut.azure.function
Class AzureFunction
java.lang.Object
io.micronaut.azure.function.AzureFunction
- All Implemented Interfaces:
io.micronaut.context.ApplicationContextProvider
,Closeable
,AutoCloseable
- Direct Known Subclasses:
AzureHttpFunction
public abstract class AzureFunction
extends Object
implements io.micronaut.context.ApplicationContextProvider, Closeable
A base Azure function class that sets up the Azure environment and preferred configuration.
- Since:
- 1.0.0
- Author:
- graemerocher
-
Field Summary
Modifier and TypeFieldDescriptionprotected static io.micronaut.context.ApplicationContext
protected static final org.slf4j.Logger
-
Constructor Summary
ModifierConstructorDescriptionprotected
Default constructor.protected
AzureFunction
(io.micronaut.context.ApplicationContextBuilder applicationContextBuilder) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
static @NonNull io.micronaut.context.ApplicationContextBuilder
Provides a builder for the ApplicationContext used for the application.io.micronaut.context.ApplicationContext
protected void
Registers an applicationContextShutdownHook.void
startApplicationContext
(io.micronaut.context.ApplicationContextBuilder applicationContextBuilder) Initializes the application context.
-
Field Details
-
LOG
protected static final org.slf4j.Logger LOG -
applicationContext
protected static io.micronaut.context.ApplicationContext applicationContext
-
-
Constructor Details
-
AzureFunction
protected AzureFunction()Default constructor. -
AzureFunction
protected AzureFunction(io.micronaut.context.ApplicationContextBuilder applicationContextBuilder) - Parameters:
applicationContextBuilder
- ApplicationContext Builder;
-
-
Method Details
-
defaultApplicationContextBuilder
@NonNull public static @NonNull io.micronaut.context.ApplicationContextBuilder defaultApplicationContextBuilder()Provides a builder for the ApplicationContext used for the application. This can be overridden to enable customization of the ApplicationContext if needed.- Returns:
- the builder
-
getApplicationContext
public io.micronaut.context.ApplicationContext getApplicationContext()- Specified by:
getApplicationContext
in interfaceio.micronaut.context.ApplicationContextProvider
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
startApplicationContext
public void startApplicationContext(io.micronaut.context.ApplicationContextBuilder applicationContextBuilder) Initializes the application context. The context manages bean definitions and resolves dependencies.- Parameters:
applicationContextBuilder
- the builder used to construct the application context
-
registerApplicationContextShutDownHook
protected void registerApplicationContextShutDownHook()Registers an applicationContextShutdownHook.
-