Class SourceResult
java.lang.Object
org.mule.runtime.extension.api.runtime.source.SourceResult
A class that represents the result of processing a message from a
Source through a flow, this reports whether the
result of the processing was successful or terminated with errors. The purpose of this class is to be used as input of the
OnTerminate callback of a Source so that this callback can operate according to the result.- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionOptional<org.mule.runtime.api.message.Error>Optional<org.mule.runtime.api.message.Error>static SourceResultinvocationError(org.mule.runtime.api.message.Error invocationError, SourceCallbackContext sourceCallbackContext) booleanIndicates whether an error has occurred or not processing a message from aSourcethrough the owned flowstatic SourceResultresponseError(org.mule.runtime.api.message.Error responseError, SourceCallbackContext sourceCallbackContext) static SourceResultsuccess(SourceCallbackContext sourceCallbackContext)
-
Method Details
-
success
-
responseError
public static SourceResult responseError(org.mule.runtime.api.message.Error responseError, SourceCallbackContext sourceCallbackContext) -
invocationError
public static SourceResult invocationError(org.mule.runtime.api.message.Error invocationError, SourceCallbackContext sourceCallbackContext) -
isSuccess
public boolean isSuccess()Indicates whether an error has occurred or not processing a message from aSourcethrough the owned flow- Returns:
- boolean indicating the result of the message processing.
-
getInvocationError
Indicates whether an error occurred before callingOnSuccessorOnError. This could be either due to errors when generating required error parameters, or due to an exception thrown inside an error handler message processor.- Returns:
- boolean indicating if the error happened before invoking the other callbacks
-
getResponseError
Indicates whether an error occurred or not executing one of the source callbacks (OnSuccessorOnError).- Returns:
- boolean indicating if the error happened calling the source callbacks.
-
getSourceCallbackContext
- Returns:
- the
SourceCallbackContextof the message that is being processing.
-