Class OciFunction
- java.lang.Object
-
- io.micronaut.oraclecloud.function.OciFunction
-
- All Implemented Interfaces:
java.lang.AutoCloseable
- Direct Known Subclasses:
HttpFunction
public abstract class OciFunction extends java.lang.Object implements java.lang.AutoCloseable
Parent class that can be used for Oracle Cloud functions.- Since:
- 1.0.0
- Author:
- graemerocher
-
-
Constructor Summary
Constructors Constructor Description OciFunction()
Default constructor.OciFunction(io.micronaut.context.ApplicationContext applicationContext)
Construct a function with the given context.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
protected boolean
enableSharedJackson()
io.micronaut.context.ApplicationContext
getApplicationContext()
protected io.micronaut.context.ApplicationContextBuilder
newApplicationContextBuilder(com.fnproject.fn.api.RuntimeContext ctx)
Construct the application context with the given builder.protected void
setup(com.fnproject.fn.api.RuntimeContext ctx)
Setup method that can be overridden by users to add customizations.void
setupContext(com.fnproject.fn.api.RuntimeContext ctx)
Sets of the function and creates the application context.
-
-
-
Constructor Detail
-
OciFunction
public OciFunction()
Default constructor. Uses a self managed application context.
-
OciFunction
public OciFunction(io.micronaut.context.ApplicationContext applicationContext)
Construct a function with the given context.- Parameters:
applicationContext
- The application context
-
-
Method Detail
-
setupContext
public final void setupContext(com.fnproject.fn.api.RuntimeContext ctx)
Sets of the function and creates the application context.- Parameters:
ctx
- The application context.
-
setup
protected void setup(com.fnproject.fn.api.RuntimeContext ctx)
Setup method that can be overridden by users to add customizations.- Parameters:
ctx
- The runtime context
-
enableSharedJackson
protected boolean enableSharedJackson()
- Returns:
- Whether Micronaut's shared Jackson object mapper should be used.
-
getApplicationContext
@NonNull public final io.micronaut.context.ApplicationContext getApplicationContext()
- Returns:
- The application context.
-
newApplicationContextBuilder
@NonNull protected io.micronaut.context.ApplicationContextBuilder newApplicationContextBuilder(com.fnproject.fn.api.RuntimeContext ctx)
Construct the application context with the given builder.- Parameters:
ctx
- The context- Returns:
- The builder
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
-
-