本文整理匯總了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();
}
示例2: TargetHandle
import org.aspectj.lang.ProceedingJoinPoint; //導入方法依賴的package包/類
TargetHandle(ProceedingJoinPoint origin) {
if (origin != null) {
this.origin = origin;
this.target = origin.getThis();
}
}
示例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();
}
}