Package org.exoplatform.services.rpc
Class SingleMethodCallCommand
- java.lang.Object
-
- org.exoplatform.services.rpc.SingleMethodCallCommand
-
- All Implemented Interfaces:
RemoteCommand
public class SingleMethodCallCommand extends Object implements RemoteCommand
This command will allow you to call one specific method with the arguments given by the execute method on a component.- Version:
- $Id$
- Author:
- Nicolas Filotto
-
-
Constructor Summary
Constructors Constructor Description SingleMethodCallCommand(Object component, String methodName, Class<?>... parameterTypes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Serializableexecute(Serializable[] args)This method will execute the command on the local machine.StringgetId()Gives the id of the command
-
-
-
Constructor Detail
-
SingleMethodCallCommand
public SingleMethodCallCommand(Object component, String methodName, Class<?>... parameterTypes) throws SecurityException, NoSuchMethodException, ClassNotFoundException
- Parameters:
component- the component on which we want to execute the methodmethodName- the name of the methodparameterTypes- the parameter array- Throws:
NoSuchMethodException- if a matching method is not found.SecurityException- If a security manager, s, is present and any of the following conditions is met:- invocation of
s.checkMemberAccess(this, Member.DECLARED)denies access to the declared method - the caller's class loader is not the same as or an
ancestor of the class loader for the current class and
invocation of
s.checkPackageAccess()denies access to the package of this class
- invocation of
ClassNotFoundException- If the last parameter type is an array and we cannot find the type of the array
-
-
Method Detail
-
execute
public Serializable execute(Serializable[] args) throws Throwable
This method will execute the command on the local machine.- Specified by:
executein interfaceRemoteCommand- Parameters:
args- The parameters needed to execute the command- Returns:
- arbitrary return value generated by performing this command
- Throws:
Throwable- in the event of problems.
-
getId
public String getId()
Gives the id of the command- Specified by:
getIdin interfaceRemoteCommand- Returns:
- the unique ID of the command
-
-