I'm just starting to learn AspectJ, and I have use-case for say, User login. If a user's session data (cookies) doesn't match the stored data on the server, I want to change the function called. Say I have two operations:
class HttpServlet {
public function() {
}
public function2() {
}
public doLogin() {
}
}
and I have advise such as:
public aspect UserLoggedIn {
pointcut GreetingServer(): within(HttpServlet);
pointcut requireAuth():
GreetingServer() && execution(* function*(..));
before(): requireAuth() {
if ( notLoggedIn ) {
redirectToDoLoginAndAbortCalledFunction();
}
}
}
So how do I make redirectToDoLoginAndAbortCalledFunction() work?