|
PenProfile 2.x | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.cldchi.jvm.MethodTrap
public final class MethodTrap
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.
| Field Summary | |
|---|---|
static int |
ACTION_BREAKPOINT
Causes native breakpoint to happen |
static int |
ACTION_CALLBACK
Invoke callback function |
static int |
ACTION_EXIT
Causes JVM to stop |
static int |
ACTION_STOP_ISOLATE
Causes current isolate to stop |
| Constructor Summary | |
|---|---|
MethodTrap()
|
|
| Method Summary | |
|---|---|
static void |
releaseTrap(int trapHandle)
Release Java method that was previously trapped by setTrap() call. |
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. |
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. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int ACTION_CALLBACK
public static final int ACTION_EXIT
public static final int ACTION_STOP_ISOLATE
public static final int ACTION_BREAKPOINT
| Constructor Detail |
|---|
public MethodTrap()
| Method Detail |
|---|
public static int setTrap(String methodName,
int callCount,
int action,
int targetTask)
methodName - - fully-qualified name of the method to trap,
looks like package.ClassName.methodNamecallCount - - take an action only when the method is called
callCount timesaction - - the code of the action for JVM to take
on the method invocation, can be
one of ACTION_*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
public static int setJavaTrap(String methodName,
String handlerName)
methodName - - fully-qualified name of the method to trap,
looks like package.ClassName.methodNamehandlerName - - fully-qualified name of the method to be invoked
instead of the trapped method. The handler must
have the same parameter types as the original
method.public static void releaseTrap(int trapHandle)
trapHandle - - the identifier of the trap that was returned
by previous call to setTrap() or setJavaTrap()
|
PenProfile 2.x | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||