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.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 Alexandre Vasseur
  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. * This internal method should not be called directly, and won't be visible to the end-user when
  23. * packed in a jar (synthetic method).
  24. *
  25. * @param arc the around closure to associate with this joinpoint
  26. */
  27. void set$AroundClosure(AroundClosure arc);
  28. /**
  29. * Proceed with the next advice or target method invocation
  30. *
  31. * @return the result of proceeding
  32. * @throws Throwable if the invoked proceed throws anything
  33. */
  34. public Object proceed() throws Throwable;
  35. /**
  36. * Proceed with the next advice or target method invocation.
  37. *
  38. * Unlike code style, proceed(..) in annotation style places different requirements on the
  39. * parameters passed to it. The proceed(..) call takes, in this order:
  40. * <ul>
  41. * <li> If 'this()' was used in the pointcut for binding, it must be passed first in proceed(..).
  42. * <li> If 'target()' was used in the pointcut for binding, it must be passed next in proceed(..) -
  43. * it will be the first argument to proceed(..) if this() was not used for binding.
  44. * <li> Finally come all the arguments expected at the join point, in the order they are supplied
  45. * at the join point. Effectively the advice signature is ignored - it doesn't matter
  46. * if a subset of arguments were bound or the ordering was changed in the advice signature,
  47. * the proceed(..) calls takes all of them in the right order for the join point.
  48. * </ul>
  49. * Since proceed(..) in this case takes an Object array, AspectJ cannot do as much
  50. * compile time checking as it can for code style. If the rules above aren't obeyed
  51. * then it will unfortunately manifest as a runtime error.
  52. *
  53. * @param args the arguments to proceed with
  54. * @return the result of proceeding
  55. * @throws Throwable if the invoked proceed throws anything
  56. */
  57. public Object proceed(Object[] args) throws Throwable;
  58. }