Skip to content

Instantly share code, notes, and snippets.

View felixbarny's full-sized avatar

Felix Barnsteiner felixbarny

View GitHub Profile
@felixbarny
felixbarny / ByteBuddyProfiler
Created April 2, 2015 14:03
ByteBuddyProfiler
package org.stagemonitor.instrument;
import java.lang.instrument.Instrumentation;
import java.lang.reflect.Method;
import java.util.concurrent.Callable;
import net.bytebuddy.agent.builder.AgentBuilder;
import net.bytebuddy.dynamic.DynamicType;
import net.bytebuddy.instrumentation.MethodDelegation;
import net.bytebuddy.instrumentation.method.bytecode.bind.annotation.Origin;
@felixbarny
felixbarny / gist:7026369
Created October 17, 2013 14:54
AspectJ disable join point
pointcut interceptionLocation(): executionOfSomethingInteresting() &&
if(InterceptorFramework.anythingSwitchedOnAnywhere);
Object around(): interceptionLocation() {
if (!InterceptorFramework.anythingToDoHere(thisJoinPointStaticPart)) {
return proceed();
}
// do stuff
}