Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AJDT » problem using method param in after advice
problem using method param in after advice [message #725028] Tue, 13 September 2011 14:37 Go to next message
Steve Maring is currently offline Steve Maring
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 15:18 Go to previous message
Steve Maring is currently offline Steve Maring
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: Mon Sep 01 07:26:19 EDT 2014

Powered by FUDForum. Page generated in 0.01579 seconds