Access keys

DynamicPointcutFactory

Kind of class: class
Inherits from: BasicClass
Implements:
Author: Simon Wacker
Classpath: org.as2lib.aop.pointcut.DynamicPointcutFactory
File last modified: Friday, 19 August 2005, 17:17:52
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.

Constructor

DynamicPointcutFactory

function DynamicPointcutFactory (
Void)
Constructs a new DynamicPointcutFactory instance.

Instance methods

bindPointcutFactory

function bindPointcutFactory (
rule:PointcutRule, factory:PointcutFactory) : Void
Binds a new factory to the given rule.
Parameters:
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
Throws:

getPointcut

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.

Parameters:
pattern:
the string representation of the pointcut
Returns:
the object-oriented view of the passed-in pointcut pattern