Good question. Here is my brief view:
1) We experimented AOP(AspectJ) to handle cross-cutting concerns at Java code level, for example, providing the trace entries/exits. 2) In Tuscany SCA, we can achieve a service component level AOP by policy interceptors. Since now the component invocations are managed by the Tuscany runtime, it's possible to declare policies (or default) and have the policy interceptors to deal with such concerns. You can look at the policy-logging module to see how it works. It would also be interesting to see if it's possible to model such service level cross-cutting concerns using a DSL like the AOP and contribute to the SCA domain so that Tuscany runtime can take care of them. Thanks, Raymond ________________________________________________________________ Raymond Feng [email protected] Apache Tuscany PMC member and committer: tuscany.apache.org Co-author of Tuscany SCA In Action book: www.tuscanyinaction.com Personal Web Site: www.enjoyjava.com ________________________________________________________________ On Mar 1, 2011, at 12:24 PM, Millies, Sebastian wrote: > Hello there, > > well, I've got rid of those annoying messages with the seemingly broken > aspects that are in the Tuscany 1.6 distribution by simply removing > the aop.xml from the tuscany-sca-all-1.6.jar, and I can get aspects > up and running that make no references to services. > > However, the crux is that I want aspects to react to certain states > of affair in one component by calling services in a remote component. > > Is there any clean way to inject a service reference into an aspect? > Could the aspect itself be programmed as a service? > > I seem to lack a basic grasp of how aspects and services might work together. > Therefore, I'd be grateful for some pointers to information on the topic of > how service-orientation and aspects go together, if at all. > > -- Sebastian > >> -----Original Message----- >> >> From: Millies, Sebastian >> Sent: Tuesday, March 01, 2011 1:25 PM >> To: '[email protected]' >> Subject: AOP example sought >> >> Hello there, >> >> I’d like to trace all my Tuscany 1.6 components using aop. > [snip] >> I want the tracing output documented using my own Logging component >> (which is not itself traced), so I will need to provide my own Aspect >> class. >> >> At the moment, I have done nothing but provide start a component with >> -javaagent:${workspace_loc}\lib\aspectjweaver-1.6.1.jar, >> and immediately I get a lot of output to System.err with messages like >> >> info using configuration >> file:/C:/Programme/ApacheSoftwareFoundation/tuscany-sca-1.7- >> SNAPSHOT/lib/tuscany-sca-all-1.7-SNAPSHOT.jar!/META-INF/aop.xml >> info define aspect org.apache.tuscany.sca.aspectj.UserTimingAspect >> [RMIServiceClassLoader@19a61d3] warning no match for this type name: >> org.apache.tuscany.sca.aspectj.UserTimingAspect >> [Xlint:invalidAbsoluteTypeName] >> error Non-aspect types can only be specified in a declare precedence >> statement when subtypes are included. Non-aspect type is : >> org.apache.tuscany.sca.aspectj.UserTimingAspect > [snip] >
