public final class AfterExecutionEvent
extends java.lang.Object
FunctionExecutor.execute(Object)
and StreamFunctionExecutor.execute(java.io.InputStream, java.io.OutputStream)
methods to allow
performing actions before the Lambda function run is finished and the JVM is hibernated.
This event must be processed synchronously to guarantee it has been processed before the Lambda funciton is hibernated.
Modifier and Type | Method and Description |
---|---|
static AfterExecutionEvent |
failure(com.amazonaws.services.lambda.runtime.Context context,
java.lang.Throwable exception)
Creates a new
AfterExecutionEvent with an exception been thrown. |
com.amazonaws.services.lambda.runtime.Context |
getContext() |
java.lang.Throwable |
getException() |
java.lang.Object |
getOutput() |
boolean |
isSuccess() |
static AfterExecutionEvent |
success(com.amazonaws.services.lambda.runtime.Context context,
java.lang.Object output)
Creates a new
AfterExecutionEvent with an optional result of the execution. |
public static AfterExecutionEvent success(@Nullable com.amazonaws.services.lambda.runtime.Context context, @Nullable java.lang.Object output)
AfterExecutionEvent
with an optional result of the execution.context
- AWS Lambda contextoutput
- an optional result of the exectuionAfterExecutionEvent
with an optional result of the executionpublic static AfterExecutionEvent failure(@Nullable com.amazonaws.services.lambda.runtime.Context context, java.lang.Throwable exception)
AfterExecutionEvent
with an exception been thrown.context
- AWS Lambda contextexception
- the exception which has been thrown during the executionAfterExecutionEvent
with an exception been thrown.public boolean isSuccess()
true
if there were no exception thrown@Nullable public java.lang.Object getOutput()
@Nullable public java.lang.Throwable getException()
@Nullable public com.amazonaws.services.lambda.runtime.Context getContext()