Results 1 to 4 of 4

Thread: aop.xml (aspectwerkz)

  1. #1
    Join Date
    Aug 2010
    Posts
    2

    Default aop.xml (aspectwerkz)

    is there any document that describe exactly the information of this file?

    i want to declare an aspect that works for classes in an specific package (and sub-packages) and in the default package (no-package).

    The first is easy:
    expression=" within(mypackage..) and call (_____"

    but, how can i do it for any class with no package ? (and i dont know the names of the classes)

    (that is becouse i want that to catch all calls from jsp to a certain method, and the webserver compiles it with no package)


    is there any way to negate the expresion "within" ?
    I mean somethig like:
    ( whitin(myYesPackage..) and not within(myNoPackage..) ) and call(





    thanks

    javi.
    Last edited by javierc; Aug 20th, 2010 at 09:08 AM.

  2. #2
    Join Date
    Jul 2010
    Location
    Venice, Italy
    Posts
    709

    Default

    If this regards a specific method, why not using execution() instead of within() in poincut definition? Anyway, you can compose poincuts using the standard ||(or or), &&(or and) and !(to negate). Just take a look at this.

  3. #3
    Join Date
    Aug 2010
    Posts
    2

    Default

    if i use "execution", callee and caller are the same...

    my problem:

    if i call A.x() from a jsp, i want to execute f(A.x()),
    but if not, i want to execute A.x()

    <pointcut name="getStringFromView" expression=" within(mycomponents..) and hasmethod(void _jspService(..)) and call(java.lang.String com.myapp.util.view.View+.get*())" />

    Is there anything to configure aspectwerkz, for not to waste time inspecting packages that i dont want to transform?
    My server takes a lot (8 minutes using execution, 4 using call) to be ready.

  4. #4
    Join Date
    Jul 2010
    Location
    Venice, Italy
    Posts
    709

    Default

    Maybe I don't fully get what you really want to do, but shouldn't
    Code:
    execution(signature_of_method_you_want_to_get_advised) && !within(package(s)_you_want_to_exclude)
    do?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •