Package org.hotswap.agent.command
Class ReflectionCommand
- java.lang.Object
-
- org.hotswap.agent.command.MergeableCommand
-
- org.hotswap.agent.command.ReflectionCommand
-
- All Implemented Interfaces:
Command
public class ReflectionCommand extends MergeableCommand
Command to run in a target classloader. The command is always invoked via reflection.- Author:
- Jiri Bubnik
-
-
Constructor Summary
Constructors Constructor Description ReflectionCommand(Object target, String methodName, Object... params)Define a command on target object.ReflectionCommand(Object plugin, String className, String methodName)Predefine a command.ReflectionCommand(Object plugin, String className, String methodName, ClassLoader targetClassLoader, Object... params)Define a command.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ObjectdoExecuteReflectionCommand(ClassLoader targetClassLoader, String className, Object target, String method, List<Object> params)booleanequals(Object o)voidexecuteCommand()Execute the command.StringgetClassName()CommandExecutionListenergetCommandExecutionListener()StringgetMethodName()List<Object>getParams()ClassLoadergetTargetClassLoader()inthashCode()voidsetCommandExecutionListener(CommandExecutionListener commandExecutionListener)voidsetTargetClassLoader(ClassLoader targetClassLoader)StringtoString()-
Methods inherited from class org.hotswap.agent.command.MergeableCommand
getMergedCommands, merge, popMergedCommands
-
-
-
-
Constructor Detail
-
ReflectionCommand
public ReflectionCommand(Object plugin, String className, String methodName, ClassLoader targetClassLoader, Object... params)
Define a command.
-
ReflectionCommand
public ReflectionCommand(Object plugin, String className, String methodName)
Predefine a command. The params and/or target classloader will be set by setter.
-
-
Method Detail
-
getClassName
public String getClassName()
-
getMethodName
public String getMethodName()
-
getTargetClassLoader
public ClassLoader getTargetClassLoader()
-
setTargetClassLoader
public void setTargetClassLoader(ClassLoader targetClassLoader)
-
getCommandExecutionListener
public CommandExecutionListener getCommandExecutionListener()
-
setCommandExecutionListener
public void setCommandExecutionListener(CommandExecutionListener commandExecutionListener)
-
executeCommand
public void executeCommand()
Execute the command.
-
doExecuteReflectionCommand
protected Object doExecuteReflectionCommand(ClassLoader targetClassLoader, String className, Object target, String method, List<Object> params) throws ClassNotFoundException, IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException
-
-