[aspectwerkz-dev] [jira] Deleted: (AW-24) PointcutController

"[email protected] (JIRA)" <jira-yCVjj/[email protected]> Fri, 3 Aug 2007 07:10:38 +1000 (EST)
Newsgroups gmane.comp.java.aspectwerkz.devel
Message-ID <[email protected]>
     [ http://jira.codehaus.org/browse/AW-24?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

[email protected] deleted AW-24:
--------------------------------


> PointcutController
> ------------------
>
>                 Key: AW-24
>                 URL: http://jira.codehaus.org/browse/AW-24
>             Project: AspectWerkz
>          Issue Type: New Feature
>            Reporter: Jonas Boner
>            Assignee: Jonas Boner
>
> From Stefan Finkenzeller:
> I'd think all it takes is to delegate some of the code to the new controller objects.
> A quick first draft of the interface might look like this:
> 	public interface IPointCutController {
> 		public void handleException(Exception e, JoinPoint jp)
> 		public Advice getNextAdvice(JoinPoint jp)
> 	}
> A member of IPointCutController should be added to org/codehaus/aspectwerkz/pointcut/AbstractPointcut.java plus the public methods for getController/setController.
> Now, depending on the type of pointcut, there will be default controller objects like DefaultMethodPointCutController, which implement IPointCutController:
> 	public class AbstractPointCutController implements IPointCutController {
> 		public abstract void handleException(Exception e, JoinPoint jp);
> 		public abstract Advice getNextAdvice(JoinPoint jp);
> 	}
> 	public class DefaultMethodPointCutController extends AbstractPointCutController {
> 		public void handleException(Exception e, JoinPoint jp) {
> 			// adapt code from MethodJoinPoint.handleException() here
> 		}
> 		public Advice getNextAdvice(JoinPoint jp) {
> 			// adapt code from StaticMethodJoinPoint.proceed() here
> 		}
> 	}
> If no controller attribute is defined in the aspectwerkz definition, then the default controller is instantiated and assigned to the pointcut using setController. Otherwise the custom controller is instantiated (which itself implements IPointCutController).
> With this in place, we can delegate calls of a JoinPoint to the new controller objects:
> - JoinPoint.proceed does not just increment the current index for the advice, but asks the pointcut controller of the
> current pointcut for the next advice: m_pointcuts[m_currentPointcutIndex].getController().getNextAdvice(this). If null is returned, then step to next pointcut or execute original method (if out of pointcuts).
> - JoinPoint.handleException() delegates to handleException of the current PointcutController: m_pointcuts[m_currentPointcutIndex].getController().handleException(ex, this)
> In both cases, "this" will be passed to the controller, so the current state of the JoinPoint can be inspected and callbacks can be made.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email