/** * Get the current thread BTraceRuntime instance * if there is one. */ public static BTraceRuntime getCurrent() { BTraceRuntime current = (BTraceRuntime) map.get(); assert current != null : "BTraceRuntime is null!"; return current; }
/** * Write the value of integer perf. counter of given name. */ public static void putPerfInt(int value, String name) { long l = (long) value; putPerfLong(l, name); }
public static synchronized BTraceRuntimeBridge getInstance() { if (instance == null) { instance = new BTraceRuntimeBridge(); } return instance; }
/** * start method is called by every BTrace (preprocesed) class * just at the end of it's class initializer. */ public static void start() { BTraceRuntime current = getCurrent(); if (current != null) { current.startImpl(); } }
public BTraceMBeanImpl(Class clazz, ExtensionsRepository repository) { this.clazz = clazz; this.attributes = getJMXAttributes(clazz); this.beanName = getBeanName(clazz); this.repository = repository; }
@Override public String[] $$() { return BTraceRuntime.getCurrent().$$(); }
public static void exit(int exitCode) { BTraceRuntime rt = getCurrent(); Throwable th =rt. currentException.get(); if (!(th instanceof ExitException)) { rt.currentException.set(null); } throw new ExitException(exitCode); }
/** * Enter method is called by every probed method just * before the probe actions start. */ public static boolean enter(BTraceRuntime current) { if (current.disabled) { return false; } return map.enter(current); }
/** * Leave method is called by every probed method just * before the probe actions end (and actual probed * method continues). */ public static void leave() { map.exit(); }
Class loadClass(String className, byte[] buf) throws ClassNotFoundException { return defineClass(className, buf, 0, buf.length); } }
@Override public void throwException(Exception e) { BTraceRuntime.handleException(e); }
@Override public MemoryMXBean getMemoryMBean() { return BTraceRuntime.getMemoryMBean(); }
@Override public List<MemoryPoolMXBean> getMemoryPoolMXBeans() { return BTraceRuntime.getMemoryPoolMXBeans(); }
@Override public boolean compare(Object obj1, Object obj2) { return BTraceRuntime.compare(obj1, obj2); }
@Override public String className() { return BTraceRuntime.getClassName(); }
@Override public String getFilePath(String fileName) { return BTraceRuntime.resolveFileName(fileName); }
/** * start method is called by every BTrace (preprocesed) class * just at the end of it's class initializer. */ public static void start() { BTraceRuntime current = getCurrent(); if (current != null) { current.startImpl(); } }
/** * Get the current thread BTraceRuntime instance * if there is one. */ public static BTraceRuntime getCurrent() { BTraceRuntime current = (BTraceRuntime) map.get(); assert current != null : "BTraceRuntime is null!"; return current; }
/** * Write the value of integer perf. counter of given name. */ public static void putPerfInt(int value, String name) { long l = (long) value; putPerfLong(l, name); }
Class loadClass(String className, byte[] buf) throws ClassNotFoundException { return defineClass(className, buf, 0, buf.length); } }