Announcement Announcement Module
No announcement yet.
aop.xml (aspectwerkz) Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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(


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

  • #2
    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
      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
        Maybe I don't fully get what you really want to do, but shouldn't
        execution(signature_of_method_you_want_to_get_advised) && !within(package(s)_you_want_to_exclude)