Package org.exoplatform.services.rpc
Class SingleMethodCallCommand
java.lang.Object
org.exoplatform.services.rpc.SingleMethodCallCommand
- All Implemented Interfaces:
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
ConstructorsConstructorDescriptionSingleMethodCallCommand(Object component, String methodName, Class<?>... parameterTypes) -
Method Summary
Modifier and TypeMethodDescriptionexecute(Serializable[] args) This method will execute the command on the local machine.getId()Gives the id of the command
-
Constructor Details
-
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
denies access to the declared method#checkMemberAccess s.checkMemberAccess(this, Member.DECLARED) - the caller's class loader is not the same as or an
ancestor of the class loader for the current class and
invocation of
denies access to the package of this classs.checkPackageAccess()
- invocation of
ClassNotFoundException- If the last parameter type is an array and we cannot find the type of the array
-
-
Method Details
-
execute
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
Gives the id of the command- Specified by:
getIdin interfaceRemoteCommand- Returns:
- the unique ID of the command
-