|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.java.btrace.runtime.BTraceRuntime
public final class BTraceRuntime
Helper class used by BTrace built-in functions and also acts runtime "manager" for a specific BTrace client and sends Commands to the CommandListener passed.
| Field Summary | |
|---|---|
static BTraceRuntime |
NULL
|
static long |
TIMESTAMP
|
| Constructor Summary | |
|---|---|
BTraceRuntime(net.java.btrace.api.server.ShutdownHandler shutdown,
String runtimeName,
String[] args,
net.java.btrace.api.wireio.Channel commChannel,
Instrumentation inst,
net.java.btrace.api.extensions.ExtensionsRepository extRepository)
Creates a newly configured BTrace runtime instance Intended to be used only from within the BTrace. |
|
| Method Summary | ||
|---|---|---|
String |
$(int n)
|
|
String[] |
$$()
|
|
int |
$length()
|
|
static boolean |
classNameExists(String name)
|
|
void |
commit(int id)
|
|
static boolean |
compare(Object obj1,
Object obj2)
Indicates whether two given objects are "equal to" one another. |
|
Class |
defineClass(byte[] code)
|
|
Class |
defineClass(byte[] code,
boolean mustBeBootstrap)
|
|
void |
discard(int id)
|
|
static boolean |
enter()
|
|
static boolean |
enter(BTraceRuntime current)
Enter method is called by every probed method just before the probe actions start. |
|
static void |
exit(int exitCode)
|
|
static BTraceRuntime |
forClass(Class cl)
One instance of BTraceRuntime is created per-client. |
|
static String |
getClassName()
|
|
static BTraceRuntime |
getCurrent()
Get the current thread BTraceRuntime instance if there is one. |
|
static List<GarbageCollectorMXBean> |
getGarbageCollectionMBeans()
|
|
static com.sun.management.HotSpotDiagnosticMXBean |
getHotSpotMBean()
|
|
static MemoryMXBean |
getMemoryMBean()
|
|
static List<MemoryPoolMXBean> |
getMemoryPoolMXBeans()
|
|
static double |
getPerfDouble(String name)
Return the value of double perf. |
|
static float |
getPerfFloat(String name)
Return the value of float perf. |
|
static int |
getPerfInt(String name)
Return the value of integer perf. |
|
static long |
getPerfLong(String name)
Return the value of long perf. |
|
static net.java.btrace.api.core.PerfReader |
getPerfReader()
|
|
static String |
getPerfString(String name)
Return the value of String perf. |
|
static RuntimeMXBean |
getRuntimeMBean()
|
|
static String |
getValidTraceClassName(String origClassName)
|
|
void |
handleEvent(String event)
|
|
static void |
handleException(Throwable th)
Handles exception from BTrace probe actions. |
|
static int |
hash(Object obj)
Returns a hash code value for the object. |
|
static int |
identityHashCode(Object obj)
Returns the same hash code for the given object as would be returned by the default method hashCode(), whether or not the given object's class overrides hashCode(). |
|
static String |
identityStr(Object obj)
Returns identity string of the form class-name@identity-hash |
|
static void |
init(net.java.btrace.api.core.PerfReader perfRead,
RunnableGenerator runGen)
|
|
static void |
leave()
Leave method is called by every probed method just before the probe actions end (and actual probed method continues). |
|
static void |
newPerfCounter(String name,
String desc,
Object value)
Utility to create a new jvmstat perf counter. |
|
static ThreadLocal |
newThreadLocal(Object initValue)
Utility to create a new ThreadLocal object. |
|
static void |
putPerfDouble(double value,
String name)
write the value of double perf. |
|
static void |
putPerfFloat(float value,
String name)
Write the value of float perf. |
|
static void |
putPerfInt(int value,
String name)
Write the value of integer perf. |
|
static void |
putPerfLong(long value,
String name)
Write the value of float perf. |
|
static void |
putPerfString(String value,
String name)
Write the value of float perf. |
|
static String |
resolveFileName(String name)
|
|
static void |
retransform(String runtimeName,
Class<?> clazz)
|
|
static
|
send(Class<? extends T> cmdClass,
net.java.btrace.api.wireio.AbstractCommand.Initializer<T> init)
|
|
void |
shutdown()
|
|
void |
speculate(int id)
|
|
int |
speculation()
|
|
static void |
start()
start method is called by every BTrace (preprocesed) class just at the end of it's class initializer. |
|
static RuntimeException |
translate(Exception exp)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final BTraceRuntime NULL
public static volatile long TIMESTAMP
| Constructor Detail |
|---|
public BTraceRuntime(net.java.btrace.api.server.ShutdownHandler shutdown,
String runtimeName,
String[] args,
net.java.btrace.api.wireio.Channel commChannel,
Instrumentation inst,
net.java.btrace.api.extensions.ExtensionsRepository extRepository)
shutdown - The associated RuntimeShutdownHandler instanceruntimeName - A runtime name - it is taken from the BTrace script usedargs - Arguments passed to the BTrace agentinst - Instrumentation instanceextRepository - ExtensionsRepository instance wrapping access to BTrace extensions
IllegalArgumentException - if called from outside of the BTrace core| Method Detail |
|---|
public static String getClassName()
public static boolean classNameExists(String name)
public static void init(net.java.btrace.api.core.PerfReader perfRead,
RunnableGenerator runGen)
public Class defineClass(byte[] code)
public Class defineClass(byte[] code,
boolean mustBeBootstrap)
public static boolean enter(BTraceRuntime current)
public static boolean enter()
public static void leave()
public static void start()
public void handleEvent(String event)
public static BTraceRuntime forClass(Class cl)
public static ThreadLocal newThreadLocal(Object initValue)
initValue - Initial value.
This value must be either a boxed primitive or Cloneable.
In case a Cloneable value is provided the value is never used directly
- instead, a new clone of the value is created per thread.
public static void newPerfCounter(String name,
String desc,
Object value)
public static int getPerfInt(String name)
public static void putPerfInt(int value,
String name)
public static float getPerfFloat(String name)
public static void putPerfFloat(float value,
String name)
public static long getPerfLong(String name)
public static void putPerfLong(long value,
String name)
public static double getPerfDouble(String name)
public static void putPerfDouble(double value,
String name)
public static String getPerfString(String name)
public static void putPerfString(String value,
String name)
public static void handleException(Throwable th)
public static void exit(int exitCode)
public int $length()
public String[] $$()
public String $(int n)
public static BTraceRuntime getCurrent()
public static String getValidTraceClassName(String origClassName)
public static String identityStr(Object obj)
obj - object for which identity string is returned
public static int identityHashCode(Object obj)
obj - object for which the hashCode is to be calculated
public static int hash(Object obj)
java.util.Hashtable. For bootstrap classes, returns the
result of calling Object.hashCode() override. For non-bootstrap classes,
the identity hash code is returned.
obj - the Object whose hash code is returned.
public static boolean compare(Object obj1,
Object obj2)
obj1 - first object to compare equalityobj2 - second object to compare equality
true if the given objects are equal;
false otherwise.public static RuntimeMXBean getRuntimeMBean()
public static List<MemoryPoolMXBean> getMemoryPoolMXBeans()
public static com.sun.management.HotSpotDiagnosticMXBean getHotSpotMBean()
public static List<GarbageCollectorMXBean> getGarbageCollectionMBeans()
public static net.java.btrace.api.core.PerfReader getPerfReader()
public static <T extends net.java.btrace.api.wireio.AbstractCommand> net.java.btrace.api.wireio.Response<T> send(Class<? extends T> cmdClass,
net.java.btrace.api.wireio.AbstractCommand.Initializer<T> init)
public int speculation()
public void speculate(int id)
public void discard(int id)
public void commit(int id)
public void shutdown()
public static void retransform(String runtimeName,
Class<?> clazz)
public static RuntimeException translate(Exception exp)
public static String resolveFileName(String name)
public static MemoryMXBean getMemoryMBean()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||