站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Spring Framework 1.2.9 API 文档英文版

RemoteInvocation (Spring Framework) - Spring Framework 1.2.9 API 文档英文版


org.springframework.remoting.support
Class RemoteInvocation

java.lang.Object
  extended by org.springframework.remoting.support.RemoteInvocation
All Implemented Interfaces:
Serializable

public class RemoteInvocation
extends Object
implements Serializable

Encapsulates a remote invocation, providing core method invocation properties in a serializable fashion. Used for RMI and HTTP-based serialization invokers.

This is an SPI class, typically not used directly by applications. Can be subclassed for additional invocation parameters.

Since:
25.02.2004
Author:
Juergen Hoeller
See Also:
RemoteInvocationFactory, RemoteInvocationExecutor, Serialized Form

Constructor Summary
RemoteInvocation()
          Create a new RemoteInvocation for use as JavaBean.
RemoteInvocation(MethodInvocation methodInvocation)
          Create a new RemoteInvocation for the given AOP method invocation.
RemoteInvocation(String methodName, Class[] parameterTypes, Object[] arguments)
          Create a new RemoteInvocation for the given parameters.
 
Method Summary
 void addAttribute(String key, Serializable value)
          Add an additional invocation attribute.
 Object[] getArguments()
           
 Serializable getAttribute(String key)
          Retrieve the attribute for the given key, if any.
 Map getAttributes()
          Return the attributes Map.
 String getMethodName()
           
 Class[] getParameterTypes()
           
 Object invoke(Object targetObject)
          Perform this invocation on the given target object.
 void setArguments(Object[] arguments)
           
 void setAttributes(Map attributes)
          Set the attributes Map.
 void setMethodName(String methodName)
           
 void setParameterTypes(Class[] parameterTypes)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RemoteInvocation

public RemoteInvocation()
Create a new RemoteInvocation for use as JavaBean.


RemoteInvocation

public RemoteInvocation(String methodName,
                        Class[] parameterTypes,
                        Object[] arguments)
Create a new RemoteInvocation for the given parameters.

Parameters:
methodName - the name of the method to invoke
parameterTypes - the parameter types of the method
arguments - the arguments for the invocation

RemoteInvocation

public RemoteInvocation(MethodInvocation methodInvocation)
Create a new RemoteInvocation for the given AOP method invocation.

Parameters:
methodInvocation - the AOP invocation to convert
Method Detail

setMethodName

public void setMethodName(String methodName)

getMethodName

public String getMethodName()

setParameterTypes

public void setParameterTypes(Class[] parameterTypes)

getParameterTypes

public Class[] getParameterTypes()

setArguments

public void setArguments(Object[] arguments)

getArguments

public Object[] getArguments()

addAttribute

public void addAttribute(String key,
                         Serializable value)
Add an additional invocation attribute. Useful to add additional invocation context without having to subclass RemoteInvocation.

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.

Parameters:
key - the attribute key
value - the attribute value

getAttribute

public Serializable getAttribute(String key)
Retrieve the attribute for the given key, if any.

The implementation avoids to unnecessarily create the attributes Map, to minimize serialization size.

Parameters:
key - the attribute key
Returns:
the attribute value, or null if not defined

setAttributes

public void setAttributes(Map attributes)
Set the attributes Map. Only here for special needs: Preferably, use addAttribute and getAttribute.

Parameters:
attributes - the attributes Map
See Also:
addAttribute(java.lang.String, java.io.Serializable), getAttribute(java.lang.String)

getAttributes

public Map getAttributes()
Return the attributes Map. Mainly here for debugging purposes: Preferably, use addAttribute and getAttribute.

Returns:
the attributes Map, or null if none created
See Also:
addAttribute(java.lang.String, java.io.Serializable), getAttribute(java.lang.String)

invoke

public Object invoke(Object targetObject)
              throws NoSuchMethodException,
                     IllegalAccessException,
                     InvocationTargetException
Perform this invocation on the given target object. Typically called when a RemoteInvocation is received on the server.

Parameters:
targetObject - the target object to apply the invocation to
Returns:
the invocation result
Throws:
NoSuchMethodException - if the method name could not be resolved
IllegalAccessException - if the method could not be accessed
InvocationTargetException - if the method invocation resulted in an exception
See Also:
Method.invoke(java.lang.Object, java.lang.Object...)

toString

public String toString()
Overrides:
toString in class Object


Copyright (c) 2002-2007 The Spring Framework Project.