Class RemoteMethodInvocationCommand<T>
- java.lang.Object
-
- jadex.bridge.component.impl.remotecommands.AbstractInternalRemoteCommand
-
- jadex.bridge.component.impl.remotecommands.RemoteMethodInvocationCommand<T>
-
- All Implemented Interfaces:
ISecuredRemoteCommand
,IRemoteCommand<T>
public class RemoteMethodInvocationCommand<T> extends AbstractInternalRemoteCommand implements IRemoteCommand<T>, ISecuredRemoteCommand
Invoke a remote method.
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.reflect.Method
SEARCHMETHOD
-
Constructor Summary
Constructors Constructor Description RemoteMethodInvocationCommand()
Create a remote method invocation command.RemoteMethodInvocationCommand(java.lang.Object target, java.lang.reflect.Method method, java.lang.Object[] args, java.util.Map<java.lang.String,java.lang.Object> nonfunc)
Create a remote method invocation command.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description jadex.commons.future.IFuture<T>
execute(IInternalAccess access, ISecurityInfo secinf)
Execute the method.java.lang.Object[]
getArguments()
Get the arguments.jadex.commons.MethodInfo
getMethod()
Get the method.Security
getSecurityLevel(IInternalAccess access)
Method to provide the required security level.java.lang.Object
getTargetId()
Get the target id.java.lang.Exception
isValid(IInternalAccess access)
Checks if the remote command is internally valid.void
setArguments(java.lang.Object[] args)
Set the arguments.void
setMethod(jadex.commons.MethodInfo method)
Set the method.void
setTargetId(java.lang.Object target)
Set the target id.java.lang.String
toString()
Get a string representation.-
Methods inherited from class jadex.bridge.component.impl.remotecommands.AbstractInternalRemoteCommand
getProperties, setProperties
-
-
-
-
Constructor Detail
-
RemoteMethodInvocationCommand
public RemoteMethodInvocationCommand()
Create a remote method invocation command.
-
RemoteMethodInvocationCommand
public RemoteMethodInvocationCommand(java.lang.Object target, java.lang.reflect.Method method, java.lang.Object[] args, java.util.Map<java.lang.String,java.lang.Object> nonfunc)
Create a remote method invocation command.
-
-
Method Detail
-
getTargetId
public java.lang.Object getTargetId()
Get the target id.
-
setTargetId
public void setTargetId(java.lang.Object target)
Set the target id.
-
getMethod
public jadex.commons.MethodInfo getMethod()
Get the method.
-
setMethod
public void setMethod(jadex.commons.MethodInfo method)
Set the method.
-
getArguments
public java.lang.Object[] getArguments()
Get the arguments.
-
setArguments
public void setArguments(java.lang.Object[] args)
Set the arguments.
-
execute
public jadex.commons.future.IFuture<T> execute(IInternalAccess access, ISecurityInfo secinf)
Execute the method.- Specified by:
execute
in interfaceIRemoteCommand<T>
- Parameters:
access
- The agent that is running the command.secinf
- The established security level to e.g. decide if the command is allowed.- Returns:
- A future for return value(s). May also be intermediate, subscription, etc.
-
isValid
public java.lang.Exception isValid(IInternalAccess access)
Checks if the remote command is internally valid.- Specified by:
isValid
in interfaceIRemoteCommand<T>
- Parameters:
access
- The component access.- Returns:
- Exception describing the error if invalid.
-
getSecurityLevel
public Security getSecurityLevel(IInternalAccess access)
Method to provide the required security level. Overridden by subclasses.- Specified by:
getSecurityLevel
in interfaceISecuredRemoteCommand
- Returns:
- The security settings or null to inhibit execution.
-
toString
public java.lang.String toString()
Get a string representation.- Overrides:
toString
in classjava.lang.Object
-
-