本文整理汇总了Java中net.bytebuddy.asm.Advice.OnMethodExit方法的典型用法代码示例。如果您正苦于以下问题:Java Advice.OnMethodExit方法的具体用法?Java Advice.OnMethodExit怎么用?Java Advice.OnMethodExit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.bytebuddy.asm.Advice
的用法示例。
在下文中一共展示了Advice.OnMethodExit方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onMethodExit
import net.bytebuddy.asm.Advice; //导入方法依赖的package包/类
@Advice.OnMethodExit
public static void onMethodExit(@Advice.This PageFragment pageFragment, @Advice.Origin Method method) {
try {
EventProducerImpl impl = THREAD_LOCAL.get();
if (impl != null) {
impl.onMethodExit();
}
} finally {
THREAD_LOCAL.remove();
}
}
示例2: monitorStop
import net.bytebuddy.asm.Advice; //导入方法依赖的package包/类
@Advice.OnMethodExit(onThrowable = Throwable.class, inline = false)
public static void monitorStop(@Advice.Thrown Throwable exception) {
final RequestMonitor requestMonitor = Stagemonitor.getPlugin(TracingPlugin.class).getRequestMonitor();
if (exception != null && exception instanceof Exception) {
requestMonitor.recordException((Exception) exception);
}
requestMonitor.monitorStop();
}
示例3: setHandlerChain
import net.bytebuddy.asm.Advice; //导入方法依赖的package包/类
@Advice.OnMethodExit
private static void setHandlerChain(@Advice.Return Object portOrDispatch) {
if (portOrDispatch instanceof BindingProvider) {
final Binding binding = ((BindingProvider) portOrDispatch).getBinding();
final List<Handler> handlerChain = binding.getHandlerChain();
if (handlerChain != null) {
binding.setHandlerChain(handlerChain);
} else {
binding.setHandlerChain(new ArrayList<Handler>());
}
}
}
示例4: addReflectiveMonitorMethodCall
import net.bytebuddy.asm.Advice; //导入方法依赖的package包/类
@Advice.OnMethodExit
private static void addReflectiveMonitorMethodCall(@Advice.This Object dataSource, @Advice.Return(readOnly = false) Connection connection, @Advice.Enter long startTime) {
try {
Object[] connectionMonitor = (Object[]) ((ThreadLocal) Dispatcher.getValues().get("org.stagemonitor.jdbc.ConnectionMonitor")).get();
if (connectionMonitor != null) {
final Method connectionMonitorMethod = (Method) connectionMonitor[1];
final long duration = System.nanoTime() - startTime;
// In JBoss, this method is executed in the context of the module class loader which loads the DataSource
// The connectionMonitor is not accessible from this class loader. That's why we have to use reflection.
connection = (Connection) connectionMonitorMethod.invoke(connectionMonitor[0], connection, dataSource, duration);
}
} catch (Exception e) {
e.printStackTrace();
}
}
示例5: exit
import net.bytebuddy.asm.Advice; //导入方法依赖的package包/类
@Advice.OnMethodExit(onThrowable = Throwable.class)
static void exit(@Advice.Origin final Executable executable,
@Advice.Enter final long startTime) {
final long duration = System.nanoTime() - startTime;
MetricsCollector.report(executable.toGenericString(), duration);
}
示例6: exit
import net.bytebuddy.asm.Advice; //导入方法依赖的package包/类
@Advice.OnMethodExit
private static void exit(@Advice.Return Bar value) {
value.append(FOO);
}
开发者ID:raphw,项目名称:byte-buddy,代码行数:5,代码来源:AgentBuilderDefaultApplicationRedefinitionReiterationTest.java
示例7: exit
import net.bytebuddy.asm.Advice; //导入方法依赖的package包/类
@Advice.OnMethodExit
private static void exit(@Advice.Return(readOnly = false) String value) {
value += BAR;
}
示例8: afterGetHandler
import net.bytebuddy.asm.Advice; //导入方法依赖的package包/类
@Advice.OnMethodExit
public static void afterGetHandler(@Advice.Return Object handler) {
SpringMvcRequestNameDeterminerTransformer.setRequestNameByHandler(handler);
}
示例9: onInterceptingHttpAccessorCreated
import net.bytebuddy.asm.Advice; //导入方法依赖的package包/类
@Advice.OnMethodExit(inline = false)
public static void onInterceptingHttpAccessorCreated(@Advice.This InterceptingHttpAccessor httpAccessor) {
final TracingPlugin tracingPlugin = Stagemonitor.getPlugin(TracingPlugin.class);
httpAccessor.getInterceptors().add(new SpringRestTemplateContextPropagatingInterceptor(tracingPlugin));
}
开发者ID:stagemonitor,项目名称:stagemonitor,代码行数:6,代码来源:SpringRestTemplateContextPropagatingTransformer.java
示例10: addInitializer
import net.bytebuddy.asm.Advice; //导入方法依赖的package包/类
@Advice.OnMethodExit(inline = false)
public static void addInitializer(@Advice.Argument(0) Object bean) {
if (bean instanceof ConfigurableEmbeddedServletContainer) {
((ConfigurableEmbeddedServletContainer) bean).addInitializers(new StagemonitorServletContextInitializer());
}
}
示例11: onAfterEvaluate
import net.bytebuddy.asm.Advice; //导入方法依赖的package包/类
@Advice.OnMethodExit(inline = false, onThrowable = Throwable.class)
public static void onAfterEvaluate() {
final CallStackElement currentFreemarkerCall = Profiler.getMethodCallParent();
Profiler.stop();
removeCurrentNodeIfItHasNoChildren(currentFreemarkerCall);
}
示例12: exit
import net.bytebuddy.asm.Advice; //导入方法依赖的package包/类
@Advice.OnMethodExit(onThrowable = Throwable.class)
public static void exit() {
Profiler.stop();
}
示例13: gauges
import net.bytebuddy.asm.Advice; //导入方法依赖的package包/类
@Advice.OnMethodExit
public static void gauges(@Advice.This Object thiz) {
monitorGauges(thiz);
}
示例14: meterException
import net.bytebuddy.asm.Advice; //导入方法依赖的package包/类
@Advice.OnMethodExit(onThrowable = Exception.class, inline = false)
public static void meterException(@ExceptionMeteredSignature String signature, @MeterExceptionsFor Class<? extends Exception> cause, @Advice.Thrown Throwable e) {
if (e != null && cause.isInstance(e)) {
Stagemonitor.getMetric2Registry().meter(getMetricName(signature)).mark();
}
}
示例15: stopTimer
import net.bytebuddy.asm.Advice; //导入方法依赖的package包/类
@Advice.OnMethodExit(onThrowable = Throwable.class)
public static void stopTimer(@Advice.Enter Timer.Context timer) {
timer.stop();
}