Class org.as2lib.aop.advice.AbstractAdvice

org.as2lib.core.BasicClass
   +--org.as2lib.aop.advice.AbstractAdvice

Description

AbstractAdvice implements methods commonly needed by Adivce implementations.

Field Index

AFTER, AFTER_RETURNING, AFTER_THROWING, AROUND, BEFORE

Method Index

captures(), getAspect(), getPointcut(), getProxy()

Inherited from BasicClass

toString()

Field Detail

BEFORE

static public BEFORE:Number
Signifies a before advice.

AROUND

static public AROUND:Number
Signifies an around advice.

AFTER

static public AFTER:Number
Signifies an after advice.

AFTER_RETURNING

static public AFTER_RETURNING:Number
Signifies an after returning advice.

AFTER_THROWING

static public AFTER_THROWING:Number
Signifies an after throwing advice.

Method Detail

getProxy

public function getProxy(joinPoint:JoinPoint):Function

Returns a proxy method that can be used instead of the original method of the joinPoint.

The returned proxy invokes the abstract executeJoinPoint method of this advice passing an update of the given joinPoint with the appropriate logical this and the arguments used for the proxy invocation. Sub-classes are responsible for implementing this method in the correct way.

Parameters

joinPointthe join point that represents the original method

Return

the proxy method

getAspect

public function getAspect(Void):Aspect

Returns the aspect that contains this advice.

Return

the aspect that contains this advice

getPointcut

public function getPointcut(Void):Pointcut

Returns the set pointcut.

Return

the set pointcut

captures

public function captures(joinPoint:JoinPoint):Boolean

Checks whether this advice captures the given joinPoint. This check is done with the help of the set pointcut's captures method.

If there is no pointcut set, true will be returned.

Parameters

joinPointthe join point upon which to make the check

Return

true if the given joinPoint is captured else false