You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ProceedingJoinPoint.java 2.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*******************************************************************************
  2. * Copyright (c) 2005 Contributors.
  3. * All rights reserved.
  4. * This program and the accompanying materials are made available
  5. * under the terms of the Eclipse Public License v1.0
  6. * which accompanies this distribution and is available at
  7. * http://eclipse.org/legal/epl-v10.html
  8. *
  9. * Contributors:
  10. * initial implementation Alexandre Vasseur
  11. *******************************************************************************/
  12. package org.aspectj.lang;
  13. import org.aspectj.runtime.internal.AroundClosure;
  14. /**
  15. * ProceedingJoinPoint exposes the proceed(..) method in order to support around advice in @AJ aspects
  16. *
  17. * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a>
  18. */
  19. public interface ProceedingJoinPoint extends JoinPoint {
  20. /**
  21. * The joinpoint needs to know about its closure so that proceed can delegate to closure.run()
  22. * <p/>
  23. * This internal method should not be called directly, and won't be visible to the end-user when
  24. * packed in a jar (synthetic method)
  25. *
  26. * @param arc
  27. */
  28. void set$AroundClosure(AroundClosure arc);
  29. /**
  30. * Proceed with the next advice or target method invocation
  31. *
  32. * @return
  33. * @throws Throwable
  34. */
  35. public Object proceed() throws Throwable;
  36. /**
  37. * Proceed with the next advice or target method invocation
  38. * <p/>
  39. * <p>Unlike code style, proceed(..) in annotation style places different requirements on the
  40. * parameters passed to it. The proceed(..) call takes, in this order:
  41. * <ul>
  42. * <li> If 'this()' was used in the pointcut for binding, it must be passed first in proceed(..).
  43. * <li> If 'target()' was used in the pointcut for binding, it must be passed next in proceed(..) -
  44. * it will be the first argument to proceed(..) if this() was not used for binding.
  45. * <li> Finally come all the arguments expected at the join point, in the order they are supplied
  46. * at the join point. Effectively the advice signature is ignored - it doesn't matter
  47. * if a subset of arguments were bound or the ordering was changed in the advice signature,
  48. * the proceed(..) calls takes all of them in the right order for the join point.
  49. * </ul>
  50. * <p>Since proceed(..) in this case takes an Object array, AspectJ cannot do as much
  51. * compile time checking as it can for code style. If the rules above aren't obeyed
  52. * then it will unfortunately manifest as a runtime error.
  53. * </p>
  54. *
  55. * @param args
  56. * @return
  57. * @throws Throwable
  58. */
  59. public Object proceed(Object[] args) throws Throwable;
  60. }