org.as2lib.core.BasicClass +--org.as2lib.aop.pointcut.DynamicPointcutFactory
PointcutFactory
DynamicPointcutFactory
is a pointcut factory that can be dynamically expanded
with new pointcut types at run-time. You can do so by adding a new pointcut factory.
This pointcut factory is mapped to a pointcut rule that determines whether the given
pointcut factory is used to create the pointcut to return based on a given pointcut
pattern.
This pointcut factory allows for execution, within, set and get access join points
and for composite pointcuts combined with AND or OR logic.
execution(org.as2lib.env.Logger.debug)
set(org.as2lib.MyClass.myProperty)
get(org.as2lib.MyClass.myProperty)
within(org.as2lib.MyClass)
execution(org.as2lib.env.Logger.debug) || set(org.as2lib.MyClass.myProperty)
Negation is also supported for every kind of pointcut:
execution(org.as2lib..*.*) && !within(org.as2lib.MyAspect)
You may of course enhance the list of supported pointcuts by binding new ones with the bindPointcutFactory method.
public function getPointcut(pattern:String):Pointcut
Returns a pointcut based on the passed-in pattern
representation.
The pointcut to return is determined by the rules of the added pointcut
factories. The pointcut factory whose rule applies first to the given
pattern
is used to get the pointcut to return. This means that order
matters.
pattern | the string representation of the pointcut |
the object-oriented view of the passed-in pointcut pattern
public function bindPointcutFactory(rule:PointcutRule, factory:PointcutFactory):Void
Binds a new factory
to the given rule
.
rule | the rule that must evaluate to true to indicate that the
factory shall be used for a given pointcut pattern
|
factory | the factory to add |
IllegalArgumentException | if rule is null or undefined
|
IllegalArgumentException | if factory is null or undefined
|