Interface JoinPoint

All Known Subinterfaces:
ProceedingJoinPoint

public interface JoinPoint

Provides reflective access to both the state available at a join point and static information about it. This information is available from the body of advice using the special form thisJoinPoint. The primary use of this reflective information is for tracing and logging applications.

 aspect Logging {
     before(): within(com.bigboxco..*) && execution(public * *(..)) {
         System.err.println("entering: " + thisJoinPoint);
         System.err.println("  w/args: " + thisJoinPoint.getArgs());
         System.err.println("      at: " + thisJoinPoint.getSourceLocation());
     }
 }
 
  • Field Details

  • Method Details

    • toString

      String toString()
      Overrides:
      toString in class Object
    • toShortString

      String toShortString()
      Returns:
      an abbreviated string representation of the join point.
    • toLongString

      String toLongString()
      Returns:
      an extended string representation of the join point.
    • getThis

      Object getThis()

      Returns the currently executing object. This will always be the same object as that matched by the this pointcut designator. Unless you specifically need this reflective access, you should use the this pointcut designator to get at this object for better static typing and performance.

      Returns null when there is no currently executing object available. This includes all join points that occur in a static context.

      Returns:
      the currently executing object (or null if not available - e.g. static context)
    • getTarget

      Object getTarget()
      Returns the target object. This will always be the same object as that matched by the target pointcut designator. Unless you specifically need this reflective access, you should use the target pointcut designator to get at this object for better static typing and performance. Returns null when there is no target object
      Returns:
      the target object (or null if there isn't one)
    • getArgs

      Object[] getArgs()
      Returns:
      the arguments at this join point
    • getSignature

      Signature getSignature()
      getStaticPart().getSignature() returns the same object
      Returns:
      the signature at the join point.
    • getSourceLocation

      SourceLocation getSourceLocation()

      If there is no source location available, returns null.

      Returns the SourceLocation of the defining class for default constructors.

      getStaticPart().getSourceLocation() returns the same object.

      Returns:
      the source location corresponding to the join point.
    • getKind

      String getKind()
      This string is guaranteed to be interned. getStaticPart().getKind() returns the same object.
      Returns:
      a string representing the kind of join point.
    • getStaticPart

      JoinPoint.StaticPart getStaticPart()
      Returns:
      an object that encapsulates the static parts of this join point.