Commit 4f606cab authored by 吴晟's avatar 吴晟
Browse files

重命名部分类名,规范化接口参数。#36

parent 03e006bf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ public class ClassConstructorInterceptor {
		try {
			EnhancedClassInstanceContext context = new EnhancedClassInstanceContext();
			accessor.setValue(context);
			ConstructorContext interceptorContext = new ConstructorContext(
			ConstructorInvokeContext interceptorContext = new ConstructorInvokeContext(obj,
					allArguments);
			interceptor.onConstruct(context, interceptorContext);
		} catch (Throwable t) {
+1 −1
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ public class ClassMethodInterceptor {
			@SuperCall Callable<?> zuper,
			@FieldValue(EnhanceClazz4Interceptor.contextAttrName) EnhancedClassInstanceContext instanceContext)
			throws Exception {
		InterceptorContext interceptorContext = new InterceptorContext(obj,
		MethodInvokeContext interceptorContext = new MethodInvokeContext(obj,
				method.getName(), allArguments);
		try {
			interceptor.beforeMethod(instanceContext, interceptorContext);
+25 −0
Original line number Diff line number Diff line
package com.ai.cloud.skywalking.plugin.interceptor;

public class ConstructorContext {
public class ConstructorInvokeContext {
	/**
	 * 代理对象实例
	 */
	private Object objInst;
	/**
	 * 构造函数参数
	 */
	private Object[] allArguments;
	
	ConstructorContext(Object[] allArguments) {
	ConstructorInvokeContext(Object objInst, Object[] allArguments) {
		this.objInst = objInst;
		this.allArguments = allArguments;
	}
	
	public Object inst(){
		return objInst;
	}

	public Object[] allArguments(){
		return this.allArguments;
	}
+3 −3
Original line number Diff line number Diff line
package com.ai.cloud.skywalking.plugin.interceptor;

public interface IAroundInterceptor {
	public void onConstruct(EnhancedClassInstanceContext context, ConstructorContext interceptorContext);
	public void onConstruct(EnhancedClassInstanceContext context, ConstructorInvokeContext interceptorContext);
	
	public void beforeMethod(EnhancedClassInstanceContext context, InterceptorContext interceptorContext);
	public void beforeMethod(EnhancedClassInstanceContext context, MethodInvokeContext interceptorContext);
	
	public Object afterMethod(EnhancedClassInstanceContext context, InterceptorContext interceptorContext, Object ret);
	public Object afterMethod(EnhancedClassInstanceContext context, MethodInvokeContext interceptorContext, Object ret);
	
	
}
+17 −3
Original line number Diff line number Diff line
package com.ai.cloud.skywalking.plugin.interceptor;


public class InterceptorContext {
/**
 * 方法执行拦截上下文
 * 
 * @author wusheng
 *
 */
public class MethodInvokeContext {
	/**
	 * 代理类实例
	 */
	private Object objInst;
	/**
	 * 方法名称
	 */
	private String methodName;
	/**
	 * 方法参数
	 */
	private Object[] allArguments;
	
	InterceptorContext(Object objInst, String methodName, Object[] allArguments) {
	MethodInvokeContext(Object objInst, String methodName, Object[] allArguments) {
		this.objInst = objInst;
		this.methodName = methodName;
		this.allArguments = allArguments;
Loading