Spring aop pointcut expression to access method return type?

The Javadoc for JoinPoint mentions a getSignature() method, whose return type Signature has a sub interface MethodSignature you could try casting to, which has a method getReturnType() which might be what you are looking for.

The Javadoc for JoinPoint mentions a getSignature() method, whose return type Signature has a sub interface MethodSignature you could try casting to, which has a method getReturnType(), which might be what you are looking for.

I am aware of this. This is the way I am prepared to go if no better solution exists, but I would prefer a pointcut expression. – Sean Patrick Floyd Jun 23 '10 at 10:08.

You can do that check inside the around advice method(handleServiceCall() in your case) Object actuals = pjp.proceed(); if(actuals instanceof MyResponse){ //TO:DO: Your code here }.

I know, but that won't help, because I won't always do pjp.proceed(). If my aspect decides that the user doesn't have the right to execute the service call, it will create a response object directly without proceeding. – Sean Patrick Floyd Jun 23 '10 at 9:27 Do not use '*' as the 'ret-type-pattern' in the pointcut expression.

Instead use the actual return type of the method that you want to intercept. – chedine Jun 23 '10 at 9:46 no good: I want to intercept many different return types, and I want to know which one I have. – Sean Patrick Floyd Jun 23 '10 at 10:07.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions