当前位置: 首页>>代码示例>>Java>>正文


Java Advice.OnMethodExit方法代码示例

本文整理汇总了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();

    }
}
 
开发者ID:testIT-WebTester,项目名称:webtester2-core,代码行数:13,代码来源:EventProducerAdvice.java

示例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();
}
 
开发者ID:stagemonitor,项目名称:stagemonitor,代码行数:9,代码来源:AbstractTracingTransformer.java

示例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>());
		}
	}
}
 
开发者ID:stagemonitor,项目名称:stagemonitor,代码行数:13,代码来源:SoapClientTransformer.java

示例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();
	}
}
 
开发者ID:stagemonitor,项目名称:stagemonitor,代码行数:16,代码来源:ReflectiveConnectionMonitoringTransformer.java

示例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);
}
 
开发者ID:ivanyu,项目名称:java-agents-demo,代码行数:7,代码来源:MetricsCollectionByteBuddyAgent.java

示例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;
}
 
开发者ID:raphw,项目名称:byte-buddy,代码行数:5,代码来源:AgentBuilderDefaultApplicationTest.java

示例8: afterGetHandler

import net.bytebuddy.asm.Advice; //导入方法依赖的package包/类
@Advice.OnMethodExit
public static void afterGetHandler(@Advice.Return Object handler) {
	SpringMvcRequestNameDeterminerTransformer.setRequestNameByHandler(handler);
}
 
开发者ID:stagemonitor,项目名称:stagemonitor,代码行数:5,代码来源:SpringMvcRequestNameDeterminerTransformer.java

示例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());
	}
}
 
开发者ID:stagemonitor,项目名称:stagemonitor,代码行数:7,代码来源:SpringBootWebPluginInitializer.java

示例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);
}
 
开发者ID:stagemonitor,项目名称:stagemonitor,代码行数:7,代码来源:FreemarkerProfilingTransformer.java

示例12: exit

import net.bytebuddy.asm.Advice; //导入方法依赖的package包/类
@Advice.OnMethodExit(onThrowable = Throwable.class)
public static void exit() {
	Profiler.stop();
}
 
开发者ID:stagemonitor,项目名称:stagemonitor,代码行数:5,代码来源:ProfilingTransformer.java

示例13: gauges

import net.bytebuddy.asm.Advice; //导入方法依赖的package包/类
@Advice.OnMethodExit
public static void gauges(@Advice.This Object thiz) {
	monitorGauges(thiz);
}
 
开发者ID:stagemonitor,项目名称:stagemonitor,代码行数:5,代码来源:GaugeTransformer.java

示例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();
	}
}
 
开发者ID:stagemonitor,项目名称:stagemonitor,代码行数:7,代码来源:ExceptionMeteredTransformer.java

示例15: stopTimer

import net.bytebuddy.asm.Advice; //导入方法依赖的package包/类
@Advice.OnMethodExit(onThrowable = Throwable.class)
public static void stopTimer(@Advice.Enter Timer.Context timer) {
	timer.stop();
}
 
开发者ID:stagemonitor,项目名称:stagemonitor,代码行数:5,代码来源:TimedTransformer.java


注:本文中的net.bytebuddy.asm.Advice.OnMethodExit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。