org.as2lib.core.BasicClass +--org.as2lib.aop.advice.SimpleDynamicAdviceFactory
DynamicAdviceFactory
SimpleDynamicAdviceFactory
manages the creation of advices for different
advice types in a simple manner.
new SimpleDynamicAdviceFactory()
public function bindAdviceFactoryByAdviceFactory(adviceType:Number, adviceFactory:AdviceFactory):Void
Binds the given adviceFactory
to the adviceType
. If a request is
made with the given adviceType
as type, the bound adviceFactory
will be used to create the advice that gets returned.
If there is already an advice factory bound to the given adviceType
the old binding gets overwritten.
If you want to remove a binding pass an adviceFactory
of value
null
or undefined
adviceType | the type to bind the adviceFactory to
|
adviceFactory | the advice factory to bind to the given adviceType
|
IllegalArgumentException | if argument adviceType is null
or undefined
|
public function bindAdviceFactoryByAdviceClass(adviceType:Number, adviceClass:Function):AdviceFactory
Creates a new SimpleAdviceFactory instance for the given
adviceClass
, binds the created advice factory to the given
adviceType
and returns the factory.
If there is already an advice factory bound to the given adviceType
the old binding gets overwritten.
adviceType | the type to bind the adviceFactory to
|
adviceClass | the class of the advice to create instances of if a advice
request for the given adviceType is made
|
an advice factory configured for the given adviceClass
IllegalArgumentException | if argument adviceType is null
or undefined
|
IllegalArgumentException | if argument adviceClass is null
or undefined
|
public function getAdviceByTypeAndStringAndCall(type:Number, pointcut:String, callback:Call):Advice
Returns the advice corresponding to the given type
. The returned advice
uses the passed-in pointcut
and callback
.
The callback
is invoked if the execute
method of the returned
advice is executed.
Commonly supported types are defined as constants in the AbstractAdvice class.
type | the type of the advice to return |
pointcut | the string representation of a pointcut used by the returned advice |
callback | the callback that is executed if you invoke the execute
method on the returned advice
|
the advice corresponding to the type and configured with the given
pointcut
and callback
IllegalArgumentException | if argument type is null or
undefined
|
getAdviceByTypeAndStringAndCall() in org.as2lib.aop.advice.DynamicAdviceFactory
public function getAdviceByTypeAndPointcutAndCall(type:Number, pointcut:Pointcut, callback:Call):Advice
Returns the advice corresponding to the given type
. The returned advice
uses the passed-in pointcut
and callback
.
The callback
is invoked if the execute
method of the returned
advice is executed.
Commonly supported types are defined as constants in the AbstractAdvice class.
type | the type of the advice to return |
pointcut | the pointcut used by the returned advice |
callback | the callback that is executed if you invoke the execute
method on the returned advice
|
the advice corresponding to the type and configured with the given
pointcut
and callback
IllegalArgumentException | if argument type is null or
undefined
|
getAdviceByTypeAndPointcutAndCall() in org.as2lib.aop.advice.DynamicAdviceFactory