| java.lang.Object com.sun.cldchi.jvm.MethodTrap
MethodTrap | final public class MethodTrap (Code) | | Java API to support run-time method trapping from Java code.
It is used internally by J2ME software stack implementations
and should be placed in a hidden package.
MethodTrap class allows to change execution entry of Java methods.
|
Method Summary | |
native public static void | releaseTrap(int trapHandle) Release Java method that was previously trapped by setTrap() call. | native public static int | setJavaTrap(String methodName, String handlerName) Replace the execution entry of the specified method with
the execution entry of another method with the similar signature.
Parameters: methodName - - fully-qualified name of the method to trap,looks like package.ClassName.methodName Parameters: handlerName - - fully-qualified name of the method to be invokedinstead of the trapped method. | native public static int | setTrap(String methodName, int callCount, int action, int targetTask) Trap specified Java method for JVM to take special action before
the method is invoked. |
ACTION_BREAKPOINT | final public static int ACTION_BREAKPOINT(Code) | | Causes native breakpoint to happen
|
ACTION_CALLBACK | final public static int ACTION_CALLBACK(Code) | | Invoke callback function
|
ACTION_EXIT | final public static int ACTION_EXIT(Code) | | Causes JVM to stop
|
ACTION_STOP_ISOLATE | final public static int ACTION_STOP_ISOLATE(Code) | | Causes current isolate to stop
|
releaseTrap | native public static void releaseTrap(int trapHandle)(Code) | | Release Java method that was previously trapped by setTrap() call.
Parameters: trapHandle - - the identifier of the trap that was returnedby previous call to setTrap() or setJavaTrap() |
setJavaTrap | native public static int setJavaTrap(String methodName, String handlerName)(Code) | | Replace the execution entry of the specified method with
the execution entry of another method with the similar signature.
Parameters: methodName - - fully-qualified name of the method to trap,looks like package.ClassName.methodName Parameters: handlerName - - fully-qualified name of the method to be invokedinstead of the trapped method. The handler musthave the same parameter types as the originalmethod. |
setTrap | native public static int setTrap(String methodName, int callCount, int action, int targetTask)(Code) | | Trap specified Java method for JVM to take special action before
the method is invoked.
Parameters: methodName - - fully-qualified name of the method to trap,looks like package.ClassName.methodName Parameters: callCount - - take an action only when the method is calledcallCount times Parameters: action - - the code of the action for JVM to takeon the method invocation, can beone of ACTION_* Parameters: targetTask - - id of a task that should be stopped on the method call,method with the same from other tasks won't be trapped.0 means any task will match trapHandle - unique identifier of the trap that can be passedto subsequent repeaseTrap() call |
|
|