You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by akshay_ajmani <ak...@gmail.com> on 2009/07/06 15:18:44 UTC

service mix + spring

 I had a query regarding using spring aspects with service mix. I read online
and on the apache service discussion forums that each apache service unit is
indirectly a spring configuration.
We have an application in which we plan to use spring aspects so that we
could do some logging (log4j)  before invocation of some methods. This
application has several SU’s with each SU has its own  xml file i.e
xbean.xml  or camel service unit having camel-context.xml.
I was thinking of defining spring aspects in each of these xml files. Can
you please suggest to me if this is the best approach available or is there
any other approach.
I thank you once again for your time.


-- 
View this message in context: http://www.nabble.com/service-mix-%2B-spring-tp24355283p24355283.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: service mix + spring

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

Yes xbean.xml is a pure Spring beans file.

It means that, in your SU, if you add a dependency (in the POM for 
example) to the spring-aop and aopalliance libs, you can use AOP in the 
xbean.xml.

Nevertheless, as each SU has its own classloader (by default), I think 
the best way is to add AOP definition in each xbean.xml.

To be honest, I have never try this but it should work :)

Regards
JB

akshay_ajmani wrote:
>  I had a query regarding using spring aspects with service mix. I read online
> and on the apache service discussion forums that each apache service unit is
> indirectly a spring configuration.
> We have an application in which we plan to use spring aspects so that we
> could do some logging (log4j)  before invocation of some methods. This
> application has several SU’s with each SU has its own  xml file i.e
> xbean.xml  or camel service unit having camel-context.xml.
> I was thinking of defining spring aspects in each of these xml files. Can
> you please suggest to me if this is the best approach available or is there
> any other approach.
> I thank you once again for your time.
> 
> 

-- 
Jean-Baptiste Onofré
---------------------------------
  HomePage
http://www.nanthrax.net
---------------------------------
  Contacts
jbonofre@apache.org
jb@nanthrax.net
---------------------------------
  OpenSource
BuildProcess/AutoDeploy
http://buildprocess.sourceforge.net
Apache ServiceMix
http://servicemix.apache.org
-----------------------------------
PGP : 17D4F086