public class InvocationResult extends Object
Modifier and Type | Field and Description |
---|---|
static int |
STATE_INVOKE_NOT_SUPPORTED
the resover performing the invocation knows that it cannot attempt to make the invocation
|
static int |
STATE_INVOKED_FAILED
The invocation was attempted but failed
|
static int |
STATE_INVOKED_SUCESSFUL
the invocation was successful
|
Constructor and Description |
---|
InvocationResult(int state)
Will construct an InvocationResult with a given state.
|
InvocationResult(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
STATE_INVOKED_SUCESSFUL |
Object |
getResult()
The result of this invocation
|
int |
getState()
Returns the state of this invocation.
|
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
STATE_INVOKED_SUCESSFUL |
void |
setErrorNoMatchingMethods(Object component,
Class[] args,
EntryPointResolver resolver) |
void |
setErrorNoMatchingMethodsCalled(Object component,
String methods,
EntryPointResolver resolver) |
void |
setErrorTooManyMatchingMethods(Object component,
Class[] argTypes,
EntryPointResolver resolver) |
void |
setErrorTooManyMatchingMethods(Object component,
Class[] argTypes,
String methods,
EntryPointResolver resolver) |
public static final int STATE_INVOKE_NOT_SUPPORTED
public static final int STATE_INVOKED_SUCESSFUL
public static final int STATE_INVOKED_FAILED
public InvocationResult(int state)
STATE_INVOKE_NOT_SUPPORTED
if the resover performing the invocation knows that it cannot
attempt to make the invocation
STATE_INVOKED_FAILED
If an invocation attempt is made but fails
STATE_INVOKED_SUCESSFUL
If the invocation was successfulstate
- the state of the resultpublic InvocationResult(Object result, Method method)
STATE_INVOKED_SUCESSFUL
since only in this state will a result be set.result
- the result of a successful invocationpublic String getMethodCalled()
STATE_INVOKED_SUCESSFUL
public Object getResult()
STATE_INVOKE_NOT_SUPPORTED
or STATE_INVOKED_FAILED
.public int getState()
STATE_INVOKE_NOT_SUPPORTED
if the resover performing the invocation knows that it cannot
attempt to make the invocation
STATE_INVOKED_FAILED
If an invocation attempt is made but fails
STATE_INVOKED_SUCESSFUL
If the invocation was successfulpublic void setErrorMessage(String message)
STATE_INVOKED_SUCESSFUL
message
- public boolean hasError()
public String getErrorMessage()
public void setErrorTooManyMatchingMethods(Object component, Class[] argTypes, String methods, EntryPointResolver resolver)
public void setErrorTooManyMatchingMethods(Object component, Class[] argTypes, EntryPointResolver resolver)
public void setErrorNoMatchingMethods(Object component, Class[] args, EntryPointResolver resolver)
public void setErrorNoMatchingMethodsCalled(Object component, String methods, EntryPointResolver resolver)
Copyright © 2003–2013 MuleSource, Inc.. All rights reserved.