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


Java JoinPoint.getTarget方法代码示例

本文整理汇总了Java中org.aspectj.lang.JoinPoint.getTarget方法的典型用法代码示例。如果您正苦于以下问题:Java JoinPoint.getTarget方法的具体用法?Java JoinPoint.getTarget怎么用?Java JoinPoint.getTarget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.aspectj.lang.JoinPoint的用法示例。


在下文中一共展示了JoinPoint.getTarget方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loggingAdvice

import org.aspectj.lang.JoinPoint; //导入方法依赖的package包/类
@After("allAppMethodswithin()")
// Try allAppMethodswithin
public void loggingAdvice(JoinPoint jp) {
	
	System.out.println("JoinPoint  -> " + jp.toString());
	
	System.out.println("Target  -> " + jp.getTarget());
	
	if (jp.getTarget() instanceof StatementService) {
		System.out
				.println("logging code inserted after StatementService method execution");
	} else if (jp.getTarget() instanceof PaymentService) {
		System.out
				.println("logging code inserted after PaymentService method execution");
	}

}
 
开发者ID:Illusionist80,项目名称:SpringTutorial,代码行数:18,代码来源:LoggingAdvice.java

示例2: onWebViewLoadUrl

import org.aspectj.lang.JoinPoint; //导入方法依赖的package包/类
@Before("call(* android.webkit.WebView+.loadUrl(..))")
public void onWebViewLoadUrl(JoinPoint joinPoint) {
    if (!Configuration.httpMonitorEnable || !Configuration.webviewEnable) {
        return;
    }
    try {
        if (joinPoint.getTarget() instanceof WebView) {
            WebView web = (WebView) joinPoint.getTarget();
            synchronized (webviews) {
                for (int i = webviews.size() - 1; i >= 0; i--) {
                    WebView item = webviews.get(i).get();
                    if (item == null) {
                        webviews.remove(i);
                    } else if (item.equals(web)) {
                        return;
                    }
                }
                webviews.add(new WeakReference<>(web));
            }

            web.setWebViewClient(ProbeWebClient.instance);
        }
    } catch (Throwable e) {
        e.printStackTrace();
    }
}
 
开发者ID:pre-dem,项目名称:pre-dem-android,代码行数:27,代码来源:WebViewProbe.java

示例3: updateTestCase

import org.aspectj.lang.JoinPoint; //导入方法依赖的package包/类
private void updateTestCase(final JoinPoint joinPoint) {
    final MethodSignature signature = (MethodSignature) joinPoint.getSignature();
    final Object[] args = joinPoint.getArgs();
    final Object target = joinPoint.getTarget();
    final Allure1Annotations annotations = new Allure1Annotations(target, signature, args);
    getLifecycle().getCurrentTestCase().ifPresent(uuid -> {
        getLifecycle().updateTestCase(uuid, annotations::updateTitle);
        getLifecycle().updateTestCase(uuid, annotations::updateDescription);
        getLifecycle().updateTestCase(uuid, annotations::updateParameters);
        getLifecycle().updateTestCase(uuid, annotations::updateLabels);
        getLifecycle().updateTestCase(uuid, annotations::updateLinks);
    });
}
 
开发者ID:allure-framework,项目名称:allure-java,代码行数:14,代码来源:Allure1TestCaseAspects.java

示例4: getLog

import org.aspectj.lang.JoinPoint; //导入方法依赖的package包/类
protected Logger getLog(final JoinPoint joinPoint) {
    final Object target = joinPoint.getTarget();

    if (target != null) {
        return LoggerFactory.getLogger(target.getClass());
    }

    return LoggerFactory.getLogger(getClass());
}
 
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:10,代码来源:LogAspect.java

示例5: checkStart

import org.aspectj.lang.JoinPoint; //导入方法依赖的package包/类
/**
 * 判断玩家准备是否要开始游戏
 *
 * @param point 切点
 */
@After(value = "execution(* telemarketer.skittlealley.model.game.drawguess.DrawGuessContext.addPlayer(..))",
        argNames = "point")
public void checkStart(JoinPoint point) {
    DrawGuessContext ctx = (DrawGuessContext) point.getTarget();
    service.checkStart(ctx);
}
 
开发者ID:csdbianhua,项目名称:telemarket-skittle-alley,代码行数:12,代码来源:DrawGuessAspect.java

示例6: checkStop

import org.aspectj.lang.JoinPoint; //导入方法依赖的package包/类
/**
 * 判断玩家退出是否终止游戏
 *
 * @param point 切点
 * @param info  退出玩家信息
 */
@AfterReturning(value = "execution(* telemarketer.skittlealley.model.game.drawguess.DrawGuessContext.removePlayer(..)) ",
        returning = "info", argNames = "point,info")
public void checkStop(JoinPoint point, DrawPlayerInfo info) {
    DrawGuessContext ctx = (DrawGuessContext) point.getTarget();
    if (info == null) { // 并不在准备玩家中
        // 如果需要所有未准备玩家退出时开始游戏 可进行checkStart
        return;
    }
    service.checkStop(ctx);
}
 
开发者ID:csdbianhua,项目名称:telemarket-skittle-alley,代码行数:17,代码来源:DrawGuessAspect.java

示例7: checkPause

import org.aspectj.lang.JoinPoint; //导入方法依赖的package包/类
/**
 * 判断玩家答对是否要停止这轮游戏
 *
 * @param point  切点
 * @param number 答对人数
 */
@AfterReturning(value = "execution(* telemarketer.skittlealley.model.game.drawguess.DrawGuessContext.incrRightNumber(..)) ",
        returning = "number", argNames = "point,number")
public void checkPause(JoinPoint point, Integer number) {
    DrawGuessContext ctx = (DrawGuessContext) point.getTarget();
    service.checkPause(ctx, number);
}
 
开发者ID:csdbianhua,项目名称:telemarket-skittle-alley,代码行数:13,代码来源:DrawGuessAspect.java

示例8: onViewCreatedProcess

import org.aspectj.lang.JoinPoint; //导入方法依赖的package包/类
@After("onViewCreated()")
public void onViewCreatedProcess(JoinPoint joinPoint) throws Throwable {
  Object puppet = joinPoint.getTarget();
  //Only inject the class that marked by Puppet annotation.
  Object[] args = joinPoint.getArgs();

  Method onCreate = getRiggerMethod("onViewCreated", Object.class, View.class, Bundle.class);
  onCreate.invoke(getRiggerInstance(), puppet, args[0], args[1]);
}
 
开发者ID:JustKiddingBaby,项目名称:FragmentRigger,代码行数:10,代码来源:FragmentInjection.java

示例9: lkConstructor

import org.aspectj.lang.JoinPoint; //导入方法依赖的package包/类
@After("execution(net.lemonsoft.lemonkit.ui.view.LK*.new(..))")
public void lkConstructor(JoinPoint joinPoint) throws Throwable {
    if (!(joinPoint.getTarget() instanceof LKUIView))
        return;
    Object[] args = joinPoint.getArgs();
    LKUIExtensionModel model = new LKUIExtensionModel();
    if (args.length >= 2)
        model = LKUIAttrsParser.parse((View) joinPoint.getTarget(), (AttributeSet) args[1]);
    lkPool.put(getLKKey(joinPoint), model);
    applyLKComplete(model, (LKUIView) joinPoint.getTarget());
}
 
开发者ID:LemonAppCN,项目名称:LemonKit4Android,代码行数:12,代码来源:LKUIViewAspect.java


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