Announcement Announcement Module
No announcement yet.
AspectJ & spring integration Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • AspectJ & spring integration

    hello all,
    can anyone tell me how to integrate aspectj with Spring?
    i have found a site where a sample is shown

    however i was not able to find class

    org.aspectj.springframework.beans.factory.config.A spectBootstrapBean

    And, same issue with Spring reference documentation (Chapter 6).

    the method 'factory-method="aspectOf" ' is not shown..
    where does it come from?

    can anyone help me?

    thanx and regards

  • #2
    The example in chapter 6 of the Reference Manual is complete. factory-method is an IoC container feature, telling Spring to call a static method to obtain an instance of the class to apply Setter Injection to.

    Adrian's blog was written before we added this feature, specifically to support AspectJ (although it's also useful in some other cases).

    Uses factory-method="aspectOf" you cause the IoC container to get the instance of a singleton aspect. It can then apply Dependency Injection to it, configuring how it will subsequently behave.


    • #3

      The aspectOf() method is a method that your singleton AspectJ aspect will expose as part of its API. It allows Spring to access the singleton instance and then configure it.

      For non-singleton aspects, check out the work in progress over at