Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] LTW: Using an Aspect method in concrete-aspectdeclaration

Hi Ron,

Thanks for your quick reply. I used your approach and
it worked beautifully. I tried both overriding the
pointcut and implementing an abstract pointcut(both
ways worked). 

Thanks again for the help. 

--- Ron Bodkin <rbodkin@xxxxxxxxxxxxxx> wrote:

> Jenni,
> 
> I think you are hitting a limitation of concrete
> aspects in AspectJ.
> However, this general approach can definitely can
> work. I haven't tried
> using the superaspect's pointcut, instead for
> Glassbox we do it like this,
> where we override a template pointcut (which could
> also be abstract):
> 
> public abstract aspect TemplateOperationMonitor
> extends MvcFrameworkMonitor
> {    protected pointcut
> methodSignatureControllerExecTarget();   
>     
>     protected pointcut
> methodSignatureControllerExec(Object controller) :  
>         methodSignatureControllerExecTarget() &&
> execution(* *(..)) &&
> target(controller);
> ...
> }
> 
> <aspectj>
>     <weaver>...
>     </weaver>
>     <aspects>
> 	    <concrete-aspect name="test.TestMonitor" 
> 	
>
extends="glassbox.monitor.ui.TemplateOperationMonitor">
>     
>     	    <pointcut
> name="methodSignatureControllerExecTarget" 
>     	    
> expression="within(*..DummyMonitoredItem)"/>
> 	    </concrete-aspect>
> ...
> 
> -----Original Message-----
> From: aspectj-users-bounces@xxxxxxxxxxx
> [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf
> Of jennie
> Sent: Monday, March 05, 2007 12:12 PM
> To: aspectj-users@xxxxxxxxxxx
> Subject: [aspectj-users] LTW: Using an Aspect method
> in
> concrete-aspectdeclaration
> 
> Hi there,
> 
> I'm declaring a concrete-aspect in my aop.xml file ,
> but it doesn't seem to get registered. I don't see
> any
> concrete-aspect error or warning messages. I think
> it's not working because I'm defining the pointcut
> expression with an aspect method:
> 
> In aop.xml:
> ..
> ..
> 
> <concrete-aspect
> name="com.myco.aspects.AbstractAspectInstance"
> extends="com.myco.aspects.AbstractAspect">
>         <pointcut name="coverageAll"
>
expression="com.myco.aspects.coverage.TestCoverage.coverageA
> ll() &amp;&amp; within(com.sampleApp..*)"/>
> </concrete-aspect>
> 
> 
> I'm trying to track coverage for certain methods in
> an
> app, but want to configure the app package
> dynamically
> in the aop.xml. 
> 
> com.myco.aspects.coverage.TestCoverage2 contains
> pointcuts for standard method calls and looks like: 
> 
> package com.myco.aspects.coverage;
> 
> public aspect TestCoverage
> {
> 
> pointcut coverageInputStream() :
>         call(int InputStream+.read(..));
> 
> pointcut coverageOutputStream() :
>         call(OutputStream
> Process+.getOutputStream(..));
> 
> pointcut coverageAll() :
>       coverageInputStream() || 
>       coverageOutputStream();
> }
> 
> Is this way of defining concrete-aspects in aop.xml
> possible? 
> 
> I want to append the expression
> "within(com.sampleApp..*)", depending on the app I
> want to examine, dynamically in aop.xml instead of
> hard-coding it. 
> 
> Any help is appreciated. Thanks in advance. 
> 
> 
>  
>



 
____________________________________________________________________________________
No need to miss a message. Get email on-the-go 
with Yahoo! Mail for Mobile. Get started.
http://mobile.yahoo.com/mail 


Back to the top