public class RemoteInvocation
extends java.lang.Object
implements java.io.Serializable
This is an SPI class, typically not used directly by applications. Can be subclassed for additional invocation parameters.
RemoteInvocationResult
,
RemoteInvocationFactory
,
RemoteInvocationExecutor
,
RmiProxyFactoryBean
,
RmiServiceExporter
,
HttpInvokerProxyFactoryBean
,
HttpInvokerServiceExporter
,
Serialized FormModifier and Type | Field and Description |
---|---|
private java.lang.Object[] |
arguments |
private java.util.Map<java.lang.String,java.io.Serializable> |
attributes |
private java.lang.String |
methodName |
private java.lang.Class[] |
parameterTypes |
private static long |
serialVersionUID
use serialVersionUID from Spring 1.1 for interoperability
|
Constructor and Description |
---|
RemoteInvocation()
Create a new RemoteInvocation for use as JavaBean.
|
RemoteInvocation(MethodInvocation methodInvocation)
Create a new RemoteInvocation for the given AOP method invocation.
|
RemoteInvocation(java.lang.String methodName,
java.lang.Class[] parameterTypes,
java.lang.Object[] arguments)
Create a new RemoteInvocation for the given parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(java.lang.String key,
java.io.Serializable value)
Add an additional invocation attribute.
|
java.lang.Object[] |
getArguments()
Return the arguments for the target method call.
|
java.io.Serializable |
getAttribute(java.lang.String key)
Retrieve the attribute for the given key, if any.
|
java.util.Map<java.lang.String,java.io.Serializable> |
getAttributes()
Return the attributes Map.
|
java.lang.String |
getMethodName()
Return the name of the target method.
|
java.lang.Class[] |
getParameterTypes()
Return the parameter types of the target method.
|
java.lang.Object |
invoke(java.lang.Object targetObject)
Perform this invocation on the given target object.
|
void |
setArguments(java.lang.Object[] arguments)
Set the arguments for the target method call.
|
void |
setAttributes(java.util.Map<java.lang.String,java.io.Serializable> attributes)
Set the attributes Map.
|
void |
setMethodName(java.lang.String methodName)
Set the name of the target method.
|
void |
setParameterTypes(java.lang.Class[] parameterTypes)
Set the parameter types of the target method.
|
java.lang.String |
toString() |
private static final long serialVersionUID
private java.lang.String methodName
private java.lang.Class[] parameterTypes
private java.lang.Object[] arguments
private java.util.Map<java.lang.String,java.io.Serializable> attributes
public RemoteInvocation()
public RemoteInvocation(java.lang.String methodName, java.lang.Class[] parameterTypes, java.lang.Object[] arguments)
methodName
- the name of the method to invokeparameterTypes
- the parameter types of the methodarguments
- the arguments for the invocationpublic RemoteInvocation(MethodInvocation methodInvocation)
methodInvocation
- the AOP invocation to convertpublic void setMethodName(java.lang.String methodName)
public java.lang.String getMethodName()
public void setParameterTypes(java.lang.Class[] parameterTypes)
public java.lang.Class[] getParameterTypes()
public void setArguments(java.lang.Object[] arguments)
public java.lang.Object[] getArguments()
public void addAttribute(java.lang.String key, java.io.Serializable value) throws java.lang.IllegalStateException
Attribute keys have to be unique, and no overriding of existing attributes is allowed.
The implementation avoids to unnecessarily create the attributes Map, to minimize serialization size.
key
- the attribute keyvalue
- the attribute valuejava.lang.IllegalStateException
- if the key is already boundpublic java.io.Serializable getAttribute(java.lang.String key)
The implementation avoids to unnecessarily create the attributes Map, to minimize serialization size.
key
- the attribute keynull
if not definedpublic void setAttributes(java.util.Map<java.lang.String,java.io.Serializable> attributes)
addAttribute(java.lang.String, java.io.Serializable)
and getAttribute(java.lang.String)
.attributes
- the attributes MapaddAttribute(java.lang.String, java.io.Serializable)
,
getAttribute(java.lang.String)
public java.util.Map<java.lang.String,java.io.Serializable> getAttributes()
addAttribute(java.lang.String, java.io.Serializable)
and getAttribute(java.lang.String)
.null
if none createdaddAttribute(java.lang.String, java.io.Serializable)
,
getAttribute(java.lang.String)
public java.lang.Object invoke(java.lang.Object targetObject) throws java.lang.NoSuchMethodException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
targetObject
- the target object to apply the invocation tojava.lang.NoSuchMethodException
- if the method name could not be resolvedjava.lang.IllegalAccessException
- if the method could not be accessedjava.lang.reflect.InvocationTargetException
- if the method invocation resulted in an exceptionMethod.invoke(java.lang.Object, java.lang.Object...)
public java.lang.String toString()
toString
in class java.lang.Object