Hi Guillaume,
thanks for the insight!
It would be great if you could comment on my reply to Bruce's answer.
How can I use AOP in a ServiceMix runtime environment?
Thanks in advance!
Cheers,
Oliver.
gnodet wrote:
>
> Yeah, shared libraries are meant to be used by components, not service
> units.
> Though servicemix 3.2 is able to include SL in SU classloaders using the
> <classpath>
> <library> xxx </library>
> </classpath>
>
>
>
>
> On 6/26/07, Bruce Snyder <[EMAIL PROTECTED]> wrote:
>>
>> On 6/25/07, okuntze <[EMAIL PROTECTED]> wrote:
>> >
>> > Hi,
>> >
>> > I'm trying to use Spring AOP in my ServiceMix runtime.
>> >
>> > Since I'm apparently doing something basic terribly wrong, it would be
>> great
>> > if you could help me out with some info.
>> >
>> > I have an aspect like this:
>> >
>> > <code>
>> > package de.mycompany.myproject;
>> >
>> > import org.aspectj.lang.annotation.Aspect;
>> > import org.aspectj.lang.annotation.Pointcut;
>> >
>> > @Aspect
>> > public class MonitoringAspect {
>> > @Pointcut("execution(* de.mycompany.myproject..*.*(..)))")
>> > public Object doSomething() {
>> > throw new RuntimeException("Im doSomething Advice!!!");
>> > }
>> > }
>> > </code>
>> >
>> > Furthermore I have a corresponding xbean file:
>> >
>> > <code>
>> > <?xml version="1.0" encoding="UTF-8"?>
>> > <beans xmlns="http://www.springframework.org/schema/beans"
>> > xmlns:aop="http://www.springframework.org/schema/aop"
>> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
>> > <aop:aspectj-autoproxy/>
>> > <bean class="de.mycompany.myproject.MonitoringAspect"
>> > id="swiftTransformationMonitoringAspect"/>
>> > </beans>
>> > </code>
>> >
>> > And finally I have a POM like this:
>> >
>> > <code>
>> > <?xml version="1.0" encoding="UTF-8"?>
>> > <project xmlns="http://maven.apache.org/POM/4.0.0"
>> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>> > <modelVersion>4.0.0</modelVersion>
>> > <parent>
>> > <groupId>oliver.osiris.playground.sandbox</groupId>
>> > <artifactId>sandbox</artifactId>
>> > <version>1.0</version>
>> > </parent>
>> >
>> >
>> <groupId>oliver.osiris.playground.sandbox.swifttransformation-monitoring
>> </groupId>
>> > <artifactId>swifttransformation-aspect</artifactId>
>> > <name>Osiris :: sandbox :: swifttransformation-monitoring ::
>> > swifttransformation-aspect</name>
>> > <packaging>jbi-shared-library</packaging>
>> > <version>1.0</version>
>> > <url>${site.root}//sandbox/</url>
>> > <dependencies>
>> > <dependency>
>> > <groupId>aspectj</groupId>
>> > <artifactId>aspectjrt</artifactId>
>> > <version>1.5.3</version>
>> > </dependency>
>> > </dependencies>
>> > <build>
>> > <plugins>
>> > <plugin>
>> > <groupId>org.apache.servicemix.tooling
>> </groupId>
>> >
>> <artifactId>jbi-maven-plugin</artifactId>
>> >
>> <version>${servicemix-version}</version>
>> > <extensions>true</extensions>
>> > </plugin>
>> > </plugins>
>> > </build>
>> > </project>
>> > </code>
>> >
>> > So what I am doing is: Using the POM to build a ServiceMix shared
>> library
>> > containing the aspect class and the Spring xbean configuration.
>> >
>> > Unfortunately the advice ist never executed.
>> >
>> > What am I doing wrong?
>>
>> Are the beans you're trying to advise instantiated explicitly by
>> Spring? Also, why are you building a shared library?
>>
>> Bruce
>> --
>> perl -e 'print
>> unpack("u30","D0G)[EMAIL PROTECTED]&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
>> );'
>>
>> Apache Geronimo - http://geronimo.apache.org/
>> Apache ActiveMQ - http://activemq.org/
>> Apache ServiceMix - http://servicemix.org/
>> Castor - http://castor.org/
>>
>
>
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Principal Engineer, IONA
> Blog: http://gnodet.blogspot.com/
>
>
--
View this message in context:
http://www.nabble.com/Spring-AOP-integration-in-ServiceMix-tf3975690s12049.html#a11301040
Sent from the ServiceMix - User mailing list archive at Nabble.com.