當前位置: 首頁>>代碼示例>>Java>>正文


Java ProceedingJoinPoint.getThis方法代碼示例

本文整理匯總了Java中org.aspectj.lang.ProceedingJoinPoint.getThis方法的典型用法代碼示例。如果您正苦於以下問題:Java ProceedingJoinPoint.getThis方法的具體用法?Java ProceedingJoinPoint.getThis怎麽用?Java ProceedingJoinPoint.getThis使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.aspectj.lang.ProceedingJoinPoint的用法示例。


在下文中一共展示了ProceedingJoinPoint.getThis方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: aroundFollow

import org.aspectj.lang.ProceedingJoinPoint; //導入方法依賴的package包/類
@Around("execution(* org.odindelrio.dddaopentitybehaviour.domain.Follower.follow(..))")
public Object aroundFollow(ProceedingJoinPoint pjp) throws Throwable {

  System.out.println("AROUND Follow Entity follow()");

  // First attempt to inject repository...
  System.out.println("Injecting Repository to entity...");
  ((Follower) pjp.getThis()).followersRepository = followersRepository;

  return pjp.proceed();
}
 
開發者ID:odin-delrio,項目名稱:aop-for-entity-behaviour,代碼行數:12,代碼來源:FollowerAspect.java

示例2: TargetHandle

import org.aspectj.lang.ProceedingJoinPoint; //導入方法依賴的package包/類
TargetHandle(ProceedingJoinPoint origin) {
    if (origin != null) {
        this.origin = origin;
        this.target = origin.getThis();
    }
}
 
開發者ID:TangXiaoLv,項目名稱:Surgeon,代碼行數:7,代碼來源:TargetHandle.java

示例3: intercept

import org.aspectj.lang.ProceedingJoinPoint; //導入方法依賴的package包/類
@Around("execution(@org.alfresco.traitextender.Extend * *(..)) && (@annotation(extendAnnotation))")
public Object intercept(ProceedingJoinPoint pjp, Extend extendAnnotation) throws Throwable
{
    boolean ajPointsEnabled = AJExtender.areAJPointsEnabled();
    try
    {
        AJExtender.enableAJPoints();
        if (ajPointsEnabled)
        {
            Object extensibleObject = pjp.getThis();
            if (!(extensibleObject instanceof Extensible))
            {
                throw new InvalidExtension("Invalid extension point for non extensible class  : "
                            + extensibleObject.getClass());
            }
            Extensible extensible = (Extensible) extensibleObject;

            @SuppressWarnings({ "rawtypes", "unchecked" })
            ExtensionPoint point = new ExtensionPoint(extendAnnotation.extensionAPI(),
                                                      extendAnnotation.traitAPI());
            @SuppressWarnings("unchecked")
            Object extension = Extender.getInstance().getExtension(extensible,
                                                                   point);
            if (extension != null)
            {

                return AJExtender.extendAroundAdvice(pjp,
                                                     extensible,
                                                     extendAnnotation,
                                                     extension);
            }
            else if (logger.isDebugEnabled())
            {
                MethodSignature ms = (MethodSignature) pjp.getSignature();
                Method traitMethod = ms.getMethod();

                AJExtender.oneTimeLiveLog(logger,
                                          new ExtensionRoute(extendAnnotation,
                                                             traitMethod));
            }
        }
        return pjp.proceed();
    }
    finally
    {
        AJExtender.revertAJPoints();
    }
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:49,代碼來源:RouteExtensions.java


注:本文中的org.aspectj.lang.ProceedingJoinPoint.getThis方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。