Eric Bodden | 5 Feb 12:09
Picon

MODULARITY: aosd.2012 - Call for Participation

                     << CALL FOR PARTICIPATION >>

=======================================================================

    11th International Conference on Aspect-Oriented Software Development
                        MODULARITY: aosd 2012
                        http://aosd.net/2012
                         March 25-30, 2012
              Hasso-Plattner-Institut Potsdam, Germany

=======================================================================

The full program is online and registration is open.

Deadline for early registration: February 20, 2012
See: http://aosd.net/2012

In cooperation with:
* ACM SIGSOFT
* ACM SIGPLAN

Sponsors:
* Oracle
* SAP Innovation Center Potsdam
* Microsoft Research
* AOSD-Europe
* AOSA
* Hasso-Plattner-Institut Potsdam

=======================================================================
(Continue reading)

Eric Bodden | 5 Feb 12:21
Picon

Student Events at MODULARITY: aosd 2012

                     << ANNOUNCEMENT OF STUDENT EVENTS >>

=======================================================================

 11th International Conference on Aspect-Oriented Software Development
                        MODULARITY: aosd 2012

                    Announcement of Student Events
         http://www.aosd.net/2012/program/student-events.html
                          students <at> aosd.net

                          March 25-30, 2012
               Hasso-Plattner-Institut Potsdam, Germany

=======================================================================

We'd like to announce the student events for the upcoming MODULARITY:
aosd•2012 conference. These events are a valuable experience to meet
other students, to identify new research ideas, and to present results
to other researchers.

*** Student Grants for AOSD Registration ***

We are happy to announce that AOSD Europe will fund up to 10 grants
supporting student registrations for MODULARITY: aosd•2012. We target
a balanced mix of European countries and select students based on
received applications (a short motivation letter with no more than
250 words).

Please note: The grants are limited to students from European
(Continue reading)

trhouse | 9 Feb 23:09
Picon

Capturing join points based on thread

Hi all,
  I want to exclude join points based on the thread.

Example. I want to capture all method calls on class Foo unless those 
methods were being executed on thread X.

Is this possible?

Thank you.
Andy Clement | 10 Feb 19:38
Picon

Re: Capturing join points based on thread

You can use the thread information but only in an if() clause.  Here
is an example program that selectively applies to joinpoints on a
thread:

===
aspect X {
	before(): call(* foo(..)) &&
if(Thread.currentThread().getName().equals("two")) {
		System.out.println("Intercepted call to foo on thread 'two'");
	}
}

public class Flibble {
	public static void main(String[] args) {
		Thread s = new Thread(new MyRunnable(),"one");
		Thread t = new Thread(new MyRunnable(),"two");
		s.start();
		t.start();
	}
}

class MyRunnable implements Runnable {

	@Override
	public void run() {
		for (int i = 0; i < 10; i++) {
			foo();
		}
	}

(Continue reading)

Dénes Németh | 11 Feb 21:35
Picon

status of hasmethod and hasfield

Hi

Does anyone know what is the status of the "experimental" features hasmethod and hasfield?

On the maven aspectj site I found "Enables the compiler to support hasmethod(method_pattern) and hasfield(field_pattern) type patterns, but only within declare statements. It's experimental and undocumented because it may change, and because it doesn't yet take into account ITDs."

Is there any documentation on them?
is " it doesn't yet take into account ITDs." true?
Are they still considered to be experimental?

Best wishes,
Denes

_______________________________________________
aspectj-users mailing list
aspectj-users <at> eclipse.org
https://dev.eclipse.org/mailman/listinfo/aspectj-users
Dénes Németh | 11 Feb 22:08
Picon

precedence inside a single aspect

Hi

The compiler reports that I have circular advice precedence.
If either before/after/around is commented out it compiles.

If we move after and p2 to a different aspect and define
precedence between the two aspects it works.

Is it possible to get this working without moving p2 to a different aspect.

best wishes,
D

Again this is just an example to try out how aspectj works, so please do not try to make sense from it.

package info.caforge.aspectj.model.advice;
public class Preced {
    public String foo(){
        System.err.println("foo");
        return "foor";
    }
}

package info.caforge.aspectj.aspects;
import info.caforge.aspectj.model.advice.Preced;
public aspect Precedence {
    pointcut p1() : execution(String Preced.foo());
    pointcut p2() : execution(String Preced.foo());
   
    before () : p1(){
        System.err.println("before");
    }
    after () : p2(){
        System.err.println("after");
    }
    String around () : p1(){
        System.err.println("around in");
        proceed();
        System.err.println("around out");
        return "around";
    }
   
    //declare precedence: Precedence.p1, Precedence.p2;
}

_______________________________________________
aspectj-users mailing list
aspectj-users <at> eclipse.org
https://dev.eclipse.org/mailman/listinfo/aspectj-users
Matthew Adams | 12 Feb 18:03
Gravatar

Pointcut for "where any parameters are annotated by"?

Hi all,

Just wondering if there's a way to express a pointcut meaning "any method
with any parameters annotated with @javax.validation.constraint.*".

For example, these would match:
public void m1(@Foo in x, int y) ...
public void m2(int x, @Foo int y) ...
public void m3(@Foo int x, @Foo int y, int z) ...

These would not:
public void m1(int x) ...
public void @Foo m2(int x) ...
public void m3(int x, int y, int z) ...

The best I've come up with is support for a fixed set of pointcuts of size n
that supports the first n arguments:

    pointcut validatedMethodCall() :
        execution(* *(@(javax.validation.constraints.*) (*), ..))
        || execution(* *(*, @(javax.validation.constraints.*) (*), ..))
        || execution(* *(*, *, @(javax.validation.constraints.*) (*), ..))
        || execution(* *(*, *, *, @(javax.validation.constraints.*) (*),
..))
        || execution(* *(*, *, *, *, @(javax.validation.constraints.*) (*),
..))
        || execution(* *(*, *, *, *, *, @(javax.validation.constraints.*)
(*), ..))
        || execution(* *(*, *, *, *, *, *, @(javax.validation.constraints.*)
(*), ..))
        || execution(* *(*, *, *, *, *, *, *,
@(javax.validation.constraints.*) (*), ..));

I'd prefer a more general syntax.  Something like the following would be
nice:

    pointcut validatedMethodCall() :
        execution(* *(@(javax.validation.constraints.*) (..)))

Thanks,
Matthew

--
View this message in context: http://aspectj.2085585.n4.nabble.com/Pointcut-for-where-any-parameters-are-annotated-by-tp4381499p4381499.html
Sent from the AspectJ - users mailing list archive at Nabble.com.
Andy Clement | 13 Feb 17:18
Picon

Re: status of hasmethod and hasfield

Hi,

> Is there any documentation on them?
> is " it doesn't yet take into account ITDs." true?
> Are they still considered to be experimental?

I'm afraid they continue to be experimenta because they don't take
ITDs into account.  If you don't care about ITDs, you can use them and
they'll work fine.

This old issue contains a lot of the discussion:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=86818

The mailing list (archive) contains many examples of how to use them,
but they basically function as you would expect:

-----8<------
public class A {
  public static void main(String[]argv) {
  }
}

aspect X {
  declare parents: hasmethod(public void main(..)) implements
java.io.Serializable;
}
-----8<------
$ ajc -1.5 -showWeaveInfo -XhasMember A.java
Extending interface set for type 'A' (A.java) to include
'java.io.Serializable' (A.java)

cheers,
Andy

On 11 February 2012 12:35, Dénes Németh <mr.nemeth.denes <at> gmail.com> wrote:
> Hi
>
> Does anyone know what is the status of the "experimental" features hasmethod
> and hasfield?
>
> On the maven aspectj site I found "Enables the compiler to support
> hasmethod(method_pattern) and hasfield(field_pattern) type patterns, but
> only within declare statements. It's experimental and undocumented because
> it may change, and because it doesn't yet take into account ITDs."
>
> Is there any documentation on them?
> is " it doesn't yet take into account ITDs." true?
> Are they still considered to be experimental?
>
> Best wishes,
> Denes
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users <at> eclipse.org
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
Andy Clement | 13 Feb 17:21
Picon

Re: Pointcut for "where any parameters are annotated by"?

Hi Matthew,

This is discussed in here:

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

but there are still issues around agreeing a syntax (and a reasonable
implementation).

At the moment the best you can do is what you have, support annotation
of argument 'n' by having variants for each.

Maybe add your proposed syntax to that bugzilla as a suggestion, I
don't think we have something like that.

cheers,
Andy

On 12 February 2012 09:03, Matthew Adams <matthew <at> matthewadams.me> wrote:
> Hi all,
>
> Just wondering if there's a way to express a pointcut meaning "any method
> with any parameters annotated with @javax.validation.constraint.*".
>
> For example, these would match:
> public void m1(@Foo in x, int y) ...
> public void m2(int x, @Foo int y) ...
> public void m3(@Foo int x, @Foo int y, int z) ...
>
> These would not:
> public void m1(int x) ...
> public void @Foo m2(int x) ...
> public void m3(int x, int y, int z) ...
>
> The best I've come up with is support for a fixed set of pointcuts of size n
> that supports the first n arguments:
>
>    pointcut validatedMethodCall() :
>        execution(* *(@(javax.validation.constraints.*) (*), ..))
>        || execution(* *(*, @(javax.validation.constraints.*) (*), ..))
>        || execution(* *(*, *, @(javax.validation.constraints.*) (*), ..))
>        || execution(* *(*, *, *, @(javax.validation.constraints.*) (*),
> ..))
>        || execution(* *(*, *, *, *, @(javax.validation.constraints.*) (*),
> ..))
>        || execution(* *(*, *, *, *, *, @(javax.validation.constraints.*)
> (*), ..))
>        || execution(* *(*, *, *, *, *, *, @(javax.validation.constraints.*)
> (*), ..))
>        || execution(* *(*, *, *, *, *, *, *,
> @(javax.validation.constraints.*) (*), ..));
>
> I'd prefer a more general syntax.  Something like the following would be
> nice:
>
>    pointcut validatedMethodCall() :
>        execution(* *(@(javax.validation.constraints.*) (..)))
>
> Thanks,
> Matthew
>
>
> --
> View this message in context: http://aspectj.2085585.n4.nabble.com/Pointcut-for-where-any-parameters-are-annotated-by-tp4381499p4381499.html
> Sent from the AspectJ - users mailing list archive at Nabble.com.
> _______________________________________________
> aspectj-users mailing list
> aspectj-users <at> eclipse.org
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
Andy Clement | 13 Feb 17:26
Picon

Re: precedence inside a single aspect

Hi,

Advice ordering rules are discussed here (end of the page):
http://www.eclipse.org/aspectj/doc/released/progguide/semantics-advice.html
(declare precedence can't be used for ordering advice within an aspect)

This ordering will compile:
aspect Precedence {
    pointcut p1() : execution(String Preced.foo());
    pointcut p2() : execution(String Preced.foo());

    String around () : p1(){
        System.err.println("around in");
        proceed();
        System.err.println("around out");
        return "around";
    }

    before () : p1(){
        System.err.println("before");
    }
    after () : p2(){
        System.err.println("after");
    }
    //declare precedence: Precedence.p1, Precedence.p2;
}

cheers
Andy

On 11 February 2012 13:08, Dénes Németh <mr.nemeth.denes <at> gmail.com> wrote:
> Hi
>
> The compiler reports that I have circular advice precedence.
> If either before/after/around is commented out it compiles.
>
> If we move after and p2 to a different aspect and define
> precedence between the two aspects it works.
>
> Is it possible to get this working without moving p2 to a different aspect.
>
> best wishes,
> D
>
> Again this is just an example to try out how aspectj works, so please do not
> try to make sense from it.
>
> package info.caforge.aspectj.model.advice;
> public class Preced {
>     public String foo(){
>         System.err.println("foo");
>         return "foor";
>     }
> }
>
> package info.caforge.aspectj.aspects;
> import info.caforge.aspectj.model.advice.Preced;
> public aspect Precedence {
>     pointcut p1() : execution(String Preced.foo());
>     pointcut p2() : execution(String Preced.foo());
>
>     before () : p1(){
>         System.err.println("before");
>     }
>     after () : p2(){
>         System.err.println("after");
>     }
>     String around () : p1(){
>         System.err.println("around in");
>         proceed();
>         System.err.println("around out");
>         return "around";
>     }
>
>     //declare precedence: Precedence.p1, Precedence.p2;
> }
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users <at> eclipse.org
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>

Gmane