[aspectwerkz-user] (!cflow) usage

"Sameer Pokarna" <[email protected]> Mon, 24 Apr 2006 19:26:56 +0530
Newsgroups gmane.comp.java.aspectwerkz.user
Message-ID <[email protected]>
Hi,

 

I have a following use case:

 

com.samples.cflow.p1.Caller1.method()

com.samples.cflow.p1.p2.Caller1.method()

com.samples.cflow.Caller3.method()

 

All these methods have the following implementation:

    public void method ()

    {

        System.out.println("Caller1.method");

        DriverManager mgr = new DriverManager();

        mgr.driver();

    }

 

And the DriverManager implementation looks like this:

public final class DriverManager

{

    public void driver ()

    {

        System.out.println("DriverManager.driver");

        Driver driver = new Driver ();

        driver.driver();

    }

}

 

public final class Driver

{

    public void driver ()

    {

        System.out.println("Driver.driver");

    }

}

 

The aspect xml looks like this:

 

<aspectwerkz>

    <system id="cflow-test-aspects">

        <package name="com.samples.cflow">

            <aspect class="DriverAspect" deployment-model="perJVM">

                <pointcut name="p1call"

                    expression="cflow(call(*
com.samples.cflow.p1..*(..)))"/>

                <pointcut name="calleeDriver"

                    expression="execution(public *
com.samples.cflow.Driver.driver(..))"/>

                <advice name="driverAspectMethod" type="around"

                    bind-to="calleeDriver AND !p1call"/>

            </aspect>

        </package>

    </system>

</aspectwerkz>

 

I expect that the Caller3.methd() will result in a aspect being invoked.

 

However, I am observing that the Caller2 and Caller1 trigger the aspect
invocation, whereas I would have expected Caller3 to do so.

 

Caller1.method

DriverManager.driver

DriverAspect.driverAspect

Driver.driver

Caller2.method

DriverManager.driver

DriverAspect.driverAspect

Driver.driver

Caller3.method

DriverManager.driver

Driver.driver

 

This is the same behavior as the case if I remove the "!" from the advice
"driverAspectMethod" (in this case, it is the correct behavior).

The "!" does not seem to be having any effect on the JoinPoint application.
Is there something wrong in the way I am using cflow?

 

 

Regards,

Sameer