Class org.as2lib.aop.advice.SimpleAdviceFactory

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

Implemented Interfaces

AdviceFactory

Description

SimpleAdviceFactory creates advices dynamically based on an advice class.

Method Index

new SimpleAdviceFactory()

getAdvice(), getAdviceByPointcutAndCall(), getAdviceByStringAndCall()

Inherited from BasicClass

toString()

Constructor Detail

SimpleAdviceFactory

public function SimpleAdviceFactory(adviceClass:Function)

Constructs a new SimpleAdviceFactory instance.

The adviceClass is suspected to have a constructor that takes two arguments. The first argument is either a pointcut pattern or a Pointcut instance and the second argument is a callback of instance Call.

Parameters

Throws

IllegalArgumentExceptionif argument adviceClass is null or undefined
IllegalArgumentExceptionif the passed-in adviceClass is not an implementation of the Advice interface

Method Detail

getAdvice

public function getAdvice():Advice

getAdviceByStringAndCall

public function getAdviceByStringAndCall(pointcut:String, callback:Call):Advice

Returns an advice configured for the given pointcut string and callback.

Parameters

pointcutthe string representation of a pointcut used by the returned advice
callbackthe callback that is executed if you invoke the execute method on the returned advice

Return

an advice that is configured with the given pointcut and callback

Specified By

getAdviceByStringAndCall() in org.as2lib.aop.advice.AdviceFactory

getAdviceByPointcutAndCall

public function getAdviceByPointcutAndCall(pointcut:Pointcut, callback:Call):Advice

Returns an advice configured for the given pointcut and callback.

Parameters

pointcutthe pointcut used by the returned advice
callbackthe callback that is executed if you invoke the execute method on the returned advice

Return

an advice that is configured with the given pointcut and callback

Specified By

getAdviceByPointcutAndCall() in org.as2lib.aop.advice.AdviceFactory