Skip to main content

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

This is just a guess, but should you be using the .. form?

Also, I can't tell from your example, what class is "multiplyByTwoService" defined on?

Cheers,
Nick
On Mar 4, 2004, at 10:44 AM, Joost de Vries wrote:

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


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




Back to the top