Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Re: aspectj-users Digest, Vol 33, Issue 15

Dear Ramnivas Laddad,

  Thanks for the help. I'm working with java programs instrumentation and verification using AspectJ. In fact, we apply the Design by Contract technique. I'm studying AspectJ and use these concepts (DBC) at same time. Our compiler, generates for each assertion ( e.g., precondition, normal or exceptional postcondition, and invariants) the advice responsible for instrumenting the assertion. Moreover, Our contracts instrumentation must be on aspect per class, I mean one aspect association per-object association. Because that, We need to reference them in a single pointcut (not anonymous) to use the perthis().

 About the AspectJ advice, specially after advice, As we use normal or exceptional postcondition (When a method terminates by throwing an exception) testing, we actually use both after returning and after throwing advice. Because the simple after advice always execute no matters ...  Thus,  We thought  to use  it  instead using the two kinds of after advice. The main problem is that we cannot handling the exception, because we need to know the type of the exception thrown (If it is a assertion violation exception or a simple exception thrown by a method).


  If you don´t mind, I can change more information about my research and Would be my pleasure If you can help me (discussing more issues about how can I improve my work).

Thanks for the help!!!

best regards!

On Nov 13, 2007 2:00 PM, < aspectj-users-request@xxxxxxxxxxx> wrote:
Send aspectj-users mailing list submissions to
       aspectj-users@xxxxxxxxxxx

To subscribe or unsubscribe via the World Wide Web, visit
        https://dev.eclipse.org/mailman/listinfo/aspectj-users
or, via email, send a message with subject or body 'help' to
       aspectj-users-request@xxxxxxxxxxx

You can reach the person managing the list at
       aspectj-users-owner@xxxxxxxxxxx

When replying, please edit your Subject line so it is more specific
than "Re: Contents of aspectj-users digest..."


Today's Topics:

  1. Re: "About AspectJ creation and After advice" (Ramnivas Laddad)
  2. Re: Why i get java.lang.NoSuchFieldError ? (Andy Clement)


----------------------------------------------------------------------

Message: 1
Date: Tue, 13 Nov 2007 10:19:36 -0500
From: "Ramnivas Laddad" < ramnivas@xxxxxxxxxxxxxxx>
Subject: Re: [aspectj-users] "About AspectJ creation and After advice"
To: aspectj-users@xxxxxxxxxxx
Message-ID:
       < ef9c6b3b0711130719y1dffa68an37f99fdc48c09f0d@xxxxxxxxxxxxxx>
Content-Type: text/plain; charset="iso-8859-1"

For question 1: Why not use named pointcuts? Then, if you want, you can
create one more named pointcut combining the 20 pointcuts and used it in
perthis().

For question 2: There isn't a way to handle exception in plain after advice.
Why do you want to do this?

-Ramnivas

On Nov 12, 2007 9:45 PM, Henrique Mostaert <henrique.mr@xxxxxxxxx> wrote:

> Dear AspectJ users,
>
>    I have simple two questions about AspectJ.
>
>
>    -  About AspectJ creation (association), we have the "per-object
>    association", which associates a separate aspect instance with the execution
>    object
>    (this) for the join point matching the pointcut specified inside
>    perthis(). However, suppose we have an Aspect with twenty (20) *anonymous
>    **pointcut*.
>
>           Question 1: Is there any way to perform the perthis() for this
> Aspect without explicit all the 20 *anonymous **pointcut* inside the
> perthis()?
>
>    - About After advice, we have two more kinds of after advice besides
>    the simpler one. One of them is the After throwing -- that is responsible to
>    add behavior when the intercepted method throws an exception. We also can
>    verify the kind of the exception thrown: *after() throwing(Throwable
>    throwable), by using thowable inside the advice's body.*
>
>             Question 2: I know the uses of after advice (after, after
> returning and after throwing). However, I really want If there exists any
> way to handler an exception (or verify the kind
>                              of exception thrown) using a simple after
> advice (no using after throwing).
>
>
>   Best regards!
>
> --
> Henrique Mostaert
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://dev.eclipse.org/mailman/listinfo/aspectj-users/attachments/20071113/102d8415/attachment.html

------------------------------

Message: 2
Date: Tue, 13 Nov 2007 16:25:18 +0000
From: "Andy Clement" < andrew.clement@xxxxxxxxx>
Subject: Re: [aspectj-users] Why i get java.lang.NoSuchFieldError ?
To: aspectj-users@xxxxxxxxxxx
Message-ID:
       <689d61aa0711130825v2ac4527etf07a177acd0b5d0@xxxxxxxxxxxxxx>
Content-Type: text/plain; charset=ISO-8859-1

You must ensure the aspect type representing the XML concrete aspect
itself is woven.  See these two bugs in bugzilla:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=166647

https://bugs.eclipse.org/bugs/show_bug.cgi?id=186322

What is the name you are giving your generated aspect?  Is it being
put into the package 'org.objectweb.jonas.webapp.jonasadmin..*' which
would enable it to be included by the <weaver> include statement?

Andy.

On 13/11/2007, Jean-Louis PASTUREL
< jeanlouis.pasturel@xxxxxxxxxxxxxxxxxx> wrote:
>
>
>
>
> I complete my post :
>
> This pointcut :
>
> _expression_="within(org.objectweb.jonas.webapp.jonasadmin..* )
> AND  call(public *
> org.objectweb.jonas.webapp.jonasadmin..*(..)) AND
> !cflowbelow(call(public *
> org.objectweb.jonas.webapp.jonasadmin..*(..)) ) "?
>
>
>
>
>
>  doesn't work with the element <weaver> filled like this :
>
> <weaver>
>
>             <include
> within="org.objectweb.jonas.webapp.jonasadmin..*"/>
>
>             </weaver>
>
>
>
>
> When I comment the include tag, it runs ! but there are error send to
> console :
>
>
>
> [JClassLoader@5164f0 ] error can't determine superclass of missing type
> org.objec
>
> tweb.jonas_ws.deployment.lib.MappingFileManager
>
> when weaving type
> org.objectweb.jonas_ws.deployment.api.ServiceRefDesc
>
> when weaving classes
>
> when weaving
>
>  [Xlint:cantFindType]
>
> [JClassLoader@5164f0] error can't determine superclass of missing type
> org.objec
>
> tweb.jonas_ws.deployment.lib.MappingFileManager
>
> when weaving type
> org.objectweb.jonas_ws.deployment.api.ServiceRefDesc
>
> when weaving classes
>
> when weaving
>
>
>
> Is there a precedence  between the within clause of aspctj/concrete-aspect
> tag and the within clause of weaver/include tag ?
>
> Cordialement / Best regards
>
> Jean-Louis PASTUREL
>
>
>
>  ________________________________
>
>
> De : aspectj-users-bounces@xxxxxxxxxxx
> [mailto: aspectj-users-bounces@xxxxxxxxxxx] De la part de
> Jean-Louis PASTUREL
>  Envoyé : mardi 13 novembre 2007 09:04
>  À : aspectj-users@xxxxxxxxxxx
>  Objet : [aspectj-users] Why i get java.lang.NoSuchFieldError ?
>
>
>
>
> HI
>
> I get this Exception
>  java.lang.NoSuchFieldError:ajc$cfowCounter$0
>
> With a pointcut defined in aop.xml like this :
>
> _expression_="within(org.objectweb.jonas.webapp.jonasadmin..*)
> AND  call(public *
> org.objectweb.jonas.webapp.jonasadmin..*(..)) AND
> !cflowbelow(call(public *
> org.objectweb.jonas.webapp.jonasadmin..* (..)) ) "?
>
>
>
> When i remove the !cflowbelow(..) condition there is no error.
>
> With AspectJ lastbuild :
> aspectj-DEVELOPMENT-20071112180727.jar. Running on Windows
> XP, JRockit 1.5.0_11
>
>
>
>
>
> Cordialement / Best regards
>
> Jean-Louis PASTUREL
>
>
>
> *********************************
>  This message and any attachments (the "message") are confidential and
> intended solely for the addressees.
>  Any unauthorised use or dissemination is prohibited.
>  Messages are susceptible to alteration.
>  France Telecom Group shall not be liable for the message if altered,
> changed or falsified.
>  If you are not the intended addressee of this message, please cancel it
> immediately and inform the sender.
>  ********************************
>
> *********************************
>  This message and any attachments (the "message") are confidential and
> intended solely for the addressees.
>  Any unauthorised use or dissemination is prohibited.
>  Messages are susceptible to alteration.
>  France Telecom Group shall not be liable for the message if altered,
> changed or falsified.
>  If you are not the intended addressee of this message, please cancel it
> immediately and inform the sender.
>  ********************************
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>


------------------------------

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


End of aspectj-users Digest, Vol 33, Issue 15
*********************************************



--
Henrique Mostaert, Departamento de Sistemas Computacionais, UPE
http://www.dsc.upe.br/~hemr

Back to the top