public interface SourceCallbackContext
Source to
a particular state| Modifier and Type | Method and Description |
|---|---|
void |
addVariable(String variableName,
Object value)
Adds a variable
|
TransactionHandle |
bindConnection(Object connection)
Associates the given
connection to this context. |
<T> T |
getConnection()
Returns the connection that was bound through
bindConnection(Object). |
<T,A> SourceCallback<T,A> |
getSourceCallback() |
TransactionHandle |
getTransactionHandle()
A handle to the current on-going transaction.
|
<T> Optional<T> |
getVariable(String variableName)
Returns the value associated to a variable of name
variableName |
boolean |
hasVariable(String variableName)
Returns whether a variable of name
variableName has a value associated to it
through the addVariable(String, Object) method |
TransactionHandle bindConnection(Object connection) throws org.mule.runtime.api.connection.ConnectionException, org.mule.runtime.api.tx.TransactionException
connection to this context. As a result of this binding,
the runtime will automatically take care of releasing the connection once the source has
finished processing the response and will also take care of resolving the associated transaction (if any).
If the connection is a TransactionalConnection and the source was configured to be transactional,
then this method will start such transaction.connection - the connection to be boundTransactionHandle produced as a result of the bindingorg.mule.runtime.api.connection.ConnectionException - if the connection is not valid or cannot be usedorg.mule.runtime.api.tx.TransactionException - if a transaction was needed but couldn't be started.<T> T getConnection()
throws IllegalStateException
bindConnection(Object).
If that method was not called, then it will throw IllegalStateExceptionT - the generic type of the connectionIllegalStateException - if no connection boundTransactionHandle getTransactionHandle()
bindConnection(Object) to had been invoked on this instance
first. However if it has, then the result of this method will be the exact same instance that
bindConnection(Object) returned.TransactionHandleboolean hasVariable(String variableName)
variableName has a value associated to it
through the addVariable(String, Object) methodvariableName - the name of a variable associated to a particular SourceCallbacktrue if the parameter is present.<T> Optional<T> getVariable(String variableName)
variableNameT - the returned value's generic typevariableName - the name of a variable of a SourceCallbackOptional of the variable's value.void addVariable(String variableName, Object value)
variableName - the name of the variablevalue - the variable's value<T,A> SourceCallback<T,A> getSourceCallback()
T - the generic type of the output values of the generated resultsA - the generic type of the attributes of the generated resultsSourceCallback that generated this contextCopyright © 2017 MuleSoft, Inc.. All rights reserved.