Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: AOP with spring dm server

  1. #1
    Join Date
    Nov 2008
    Posts
    232

    Default AOP with spring dm server

    Is it not possible to have my Aspect defined in standalone bundle that is to say seperate from the bundle implementing the service being adviced

  2. #2
    Join Date
    Oct 2008
    Posts
    493

    Default

    Are you using AspectJ with load-time weaving or compile-time weaving?

    This is definitely possible when compile-time weaving is used: dm Server itself uses a number of aspects that are held in bundles that are separate to those that have been advised.

    If you're using load-time weaving then things become significantly more complex. My advice in this case would be to consider using compile-time weaving if possible.
    Andy Wilkinson
    SpringSource

  3. #3
    Join Date
    Nov 2008
    Posts
    232

    Default

    i am using runtime weaving support provided by spring AOP

    Basically i have a Bundle(say BundleA) with service interface ,BundleB implementing the interface

    Now i don't want each implementer to have a Aspect defined in there application context ,instead i would prefer to define Aspect in the interface bundle so that all the Bundles which provide implementation are adviced

  4. #4
    Join Date
    Oct 2008
    Posts
    493

    Default

    Ah, ok, you're using Spring AOP: that makes things easier.

    When you configure a LoadTimeWeaver bean in your application context, dm Server automatically replaces it with an OSGi-aware load-time weaver implementation: KernelLoadTimeWeaver.

    You'll have to make sure that your bundle manifest imports the package(s) that contain your aspect(s).

    I would recommend giving this a go and letting us know if you encounter any problems and we'll do what we can to help.
    Andy Wilkinson
    SpringSource

  5. #5
    Join Date
    Nov 2008
    Posts
    232

    Default

    Hi Andy ,

    This did not work either .

    Regards

    vishal

  6. #6
    Join Date
    Oct 2008
    Posts
    493

    Default

    Ok. What was the failure that you encountered? It's going to be very hard to diagnose the problem without more details on what you were trying to do, and what went wrong. We'll need stack traces, log output, etc.
    Andy Wilkinson
    SpringSource

  7. #7
    Join Date
    Nov 2008
    Posts
    232

    Default

    Shall i upload my demo bundles ,If it may help

  8. #8
    Join Date
    Oct 2008
    Posts
    493

    Default

    Yes, that may help, but we may be able to identify the problem just from the stack trace of the error (assuming you're getting one) so please let us know what this is too.
    Andy Wilkinson
    SpringSource

  9. #9
    Join Date
    Nov 2008
    Posts
    232

    Default

    Hi andy ,
    I am not getting any Exception as such but my sysouts from the advice
    I have attached my Demo
    Attached Files Attached Files
    Last edited by vishalj; Oct 26th, 2009 at 12:38 AM.

  10. #10
    Join Date
    Oct 2008
    Posts
    493

    Default

    Thanks, Vishal. Could you attach compiled binaries already in their bundles, please? I'd like to be sure that we're both working against the exact same code.
    Andy Wilkinson
    SpringSource

Posting Permissions

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