Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » problem using method param in after advice
problem using method param in after advice [message #725028] Tue, 13 September 2011 18:37 Go to next message
Steve Maring is currently offline Steve MaringFriend
Messages: 10
Registered: September 2010
Junior Member
I'm sure that I am doing something wrong. Could somebody please explain to me why my aspect is complaining about my pointcut with "formal unbound in pointcut"?

I'm trying to set a connection value after the connection is validated.


public aspect SetClientIdOnOracleConnectionAspect {

	pointcut validateConnectionPointcut(Connection conn) :
		execution(SQLException OracleValidConnectionChecker.isValidConnection(Connection));
		
	after(Connection conn) returning: validateConnectionPointcut(conn) {
		OracleConnectionClientIdApplicator applicator = new OracleConnectionClientIdApplicator();
		applicator.setClientIdOnConnection(conn);
	}
	
}



Thanks,
Steve Maring
Re: problem using method param in after advice [message #725044 is a reply to message #725028] Tue, 13 September 2011 19:18 Go to previous message
Steve Maring is currently offline Steve MaringFriend
Messages: 10
Registered: September 2010
Junior Member
got it ... I was missing the "&& args(conn)" part ...

public aspect SetClientIdOnOracleConnectionAspect {

	pointcut validateConnectionPointcut(Connection conn) :
		execution(SQLException OracleValidConnectionChecker.isValidConnection(Connection)) && args(conn);
		
	after(Connection conn) returning: validateConnectionPointcut(conn) {
		OracleConnectionClientIdApplicator applicator = new OracleConnectionClientIdApplicator();
		applicator.setClientIdOnConnection(conn);
	}
	
}


Previous Topic:AJDT and annotation processing
Next Topic:encrypt annotation
Goto Forum:
  


Current Time: Fri Apr 26 15:30:21 GMT 2024

Powered by FUDForum. Page generated in 0.03063 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top