Open ZShUn opened 2 days ago
What configuration options do I need to add to the proxy ThreadPoolExecutor?
new AgentBuilder.Default() .ignore( nameStartsWith("net.bytebuddy.") .or(nameStartsWith("org.slf4j.")) .or(nameStartsWith("org.groovy.")) .or(nameContains("javassist")) .or(nameContains(".asm.")) .or(nameContains(".reflectasm.")) .or(nameStartsWith("sun.reflect")) .or(ElementMatchers.isSynthetic())) .type(new CustomClassMatcher<>(classMatcherConfig, TypeDescription.ForLoadedType.of(Runnable.class))) .transform(transformer) .with(listener) .with(AgentBuilder.RedefinitionStrategy.RETRANSFORMATION) .installOn(inst); @RuntimeType public static Object intercept(@This Object obj, @AllArguments Object[] allArguments, @SuperCall Callable<?> callable, @Origin Method method) throws Exception { Object result = null; try { result = callable.call(); } catch (Throwable e) { e.printStackTrace(); } return result; }
You would need to configure a different InjectionStrategy in your AgentBuilder. Typically one that uses Unsafe.
InjectionStrategy
AgentBuilder
Unsafe
What configuration options do I need to add to the proxy ThreadPoolExecutor?