use of com.sun.btrace.annotations.OnMethod in project Gargoyle by callakrsos.
the class SosRequestCapture method beforeDoRequest_entry.
@OnMethod(clazz = DS_CLASS, method = "doRequest", location = @Location(Kind.ENTRY))
public static void beforeDoRequest_entry(@Self Object obj) {
println("beforeDoRequest");
println(obj);
println("Print Fields");
BTraceUtils.printFields(obj);
BTraceUtils.printFields(obj, true);
println("Field");
Class<?> classOf = BTraceUtils.classOf(obj);
// BTraceUtils.print(classOf);
Class<?> superclass = BTraceUtils.getSuperclass(classOf);
println("AbstractMain ::: #####");
BTraceUtils.println(superclass);
Class<?> superclass2 = BTraceUtils.getSuperclass(superclass);
println("#####");
println("AbstractScreen ::: #####");
BTraceUtils.println(superclass2);
println("#####1");
Field field = BTraceUtils.field(superclass2, "abstractSVO");
println("#####2");
Object object = BTraceUtils.get(field, obj);
println("#####3");
println("AbstractSVO ::: #####");
BTraceUtils.print(object);
BTraceUtils.printFields(object);
String xml = BTraceUtils.toXML(object);
BTraceUtils.println(xml);
}
use of com.sun.btrace.annotations.OnMethod in project btrace by btraceio.
the class VerifierVisitor method checkSampling.
private boolean checkSampling(MethodTree node) {
TreePath mPath = verifier.getTreeUtils().getPath(verifier.getCompilationUnit(), node);
ExecutableElement ee = (ExecutableElement) verifier.getTreeUtils().getElement(mPath);
Sampled s = ee.getAnnotation(Sampled.class);
OnMethod om = ee.getAnnotation(OnMethod.class);
if (s != null && om != null) {
Kind k = om.location().value();
switch(k) {
case ENTRY:
case RETURN:
case ERROR:
case CALL:
{
return true;
}
default:
{
// noop
}
}
reportError("sampler.invalid.location", node);
return false;
}
return true;
}
use of com.sun.btrace.annotations.OnMethod in project btrace by btraceio.
the class ServicesTest method testSingletonService.
@OnMethod(clazz = "resources.OnMethodTest", method = "args$static")
public static void testSingletonService(String a, long b, String[] c, int[] d) {
DummySimpleService ds = Service.simple("getInstance", DummySimpleService.class);
ds.doit("hello", 10);
}
use of com.sun.btrace.annotations.OnMethod in project btrace by btraceio.
the class ServicesTest method testRuntimeService.
@OnMethod(clazz = "resources.OnMethodTest", method = "args")
public static void testRuntimeService(String a, long b, String[] c, int[] d) {
DummyRuntimService ds = Service.runtime(DummyRuntimService.class);
ds.doit(10, "hello");
}
use of com.sun.btrace.annotations.OnMethod in project btrace by btraceio.
the class ServicesTest method testSimpleService.
@OnMethod(clazz = "resources.OnMethodTest", method = "noargs")
public static void testSimpleService() {
DummySimpleService ds = Service.simple(DummySimpleService.class);
ds.doit("hello", 10);
}
Aggregations