public class InvocationResult extends Object
EntryPointResolver| Modifier and Type | Class and Description |
|---|---|
static class |
InvocationResult.State |
| Constructor and Description |
|---|
InvocationResult(EntryPointResolver resolver,
InvocationResult.State state)
Will construct an InvocationResult with a given state.
|
InvocationResult(EntryPointResolver resolver,
Object result,
Method method)
Creates a result with the result payload set.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getErrorMessage()
Returns the error message set on this result or null if none has been set
|
String |
getMethodCalled()
Returns the name of the method invoked, this property is only set if the state of the invocation is
InvocationResult.State.SUCCESSFUL |
Object |
getResult()
The result of this invocation
|
InvocationResult.State |
getState() |
boolean |
hasError()
Returns true if an error message has been set on this result, false otherwise
|
void |
setErrorMessage(String message)
An optional error message can be set if the invocation state is not
InvocationResult.State.SUCCESSFUL |
void |
setErrorNoMatchingMethods(Object component,
Class<?>[] args) |
void |
setErrorNoMatchingMethodsCalled(Object component,
String methods) |
void |
setErrorTooManyMatchingMethods(Object component,
Class<?>[] argTypes,
String methods) |
public InvocationResult(EntryPointResolver resolver, InvocationResult.State state)
InvocationResult.State.NOT_SUPPORTED if the resolver performing the invocation knows
that it cannot attempt to make the invocation InvocationResult.State.FAILED If an
invocation attempt is made but fails InvocationResult.State.SUCCESSFUL If the
invocation was successful
Typically, this constructor is used when the state is
InvocationResult.State.NOT_SUPPORTED or
InvocationResult.State.FAILEDresolver - the resolver being used to make the invocationstate - the state of the resultpublic InvocationResult(EntryPointResolver resolver, Object result, Method method)
InvocationResult.State.SUCCESSFUL since only in this state will a result be set.resolver - the resolver being used to make the invocationresult - the result of a successful invocationmethod - the method invoke by this invocationpublic String getMethodCalled()
InvocationResult.State.SUCCESSFULpublic Object getResult()
InvocationResult.State.NOT_SUPPORTED or
InvocationResult.State.FAILED.public InvocationResult.State getState()
InvocationResult.State.NOT_SUPPORTED if the resolver performing the
invocation knows that it cannot attempt to make the invocation
InvocationResult.State.FAILED If an invocation attempt is made but fails
InvocationResult.State.SUCCESSFUL If the invocation was successfulpublic void setErrorMessage(String message)
InvocationResult.State.SUCCESSFULmessage - the error messagepublic boolean hasError()
public String getErrorMessage()
public void setErrorTooManyMatchingMethods(Object component, Class<?>[] argTypes, String methods)
Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.