Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] newbie: wildcards in pointcuts

Hi there,

I've got some aspectj behaviour that's completely bewildering me. All the
while it seems to me it should be very simple. Your help is greatly
appreciated.

Here goes:
I want to intercept all service-method invocations on my sessionbeans and
insert some special handling. These service-method invocations have the
following characteristics:
- the argument type ends with the string 'RequestSDO'. So that's
org.myorganization.MultiplyByTwoRequestSDO for instance.
- the return type ends with the string 'ResponseSDO'. ->
org.myorganization.MultiplyByTwoResponseSDO
- the method name ends in 'Service'. I don't think that should be
necessary but I added that to make it easier. -> multiplyByTwoService

So that's the signature
public org.myorganization.MultiplyByTwoResponseSDO
multiplyByTwoService(org.myorganization.MultiplyByTwoRequestSDO
theRequest);

my aspect is as follows:
public aspect TestAspect {

	pointcut serviceInvocations():call(org.myorganization.*ResponseSDO
*.*Service(org.myorganization.*RequestSDO));

	before(): serviceInvocations(){
		System.out.println("*****************************");
	}
}


This does not work at all. As soon as I replace the wildcards with a
specific classname and a specific methodname it works. But that's not what
I'm after.

I'm using the aspect-plugin for eclipse v 1.1.4 in eclipse 3M4 by the way.

What am I missing here?


Again: your help is greatly appreciated,

Joost de Vries
the Netherlands




Back to the top