Interface JoinPoint
- All Known Subinterfaces:
ProceedingJoinPoint
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()); } }
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
static interface
This helper object contains only the static information about a join point. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
The legal return values from getKind()static final String
static final String
static final String
static final String
-
Method Summary
Modifier and TypeMethodDescriptionObject[]
getArgs()
getKind()
This string is guaranteed to be interned.getStaticPart().getSignature()
returns the same objectIf there is no source location available, returns null.Returns the target object.getThis()
Returns the currently executing object.toString()
-
Field Details
-
METHOD_EXECUTION
-
METHOD_CALL
- See Also:
-
CONSTRUCTOR_EXECUTION
- See Also:
-
CONSTRUCTOR_CALL
- See Also:
-
FIELD_GET
- See Also:
-
FIELD_SET
- See Also:
-
STATICINITIALIZATION
- See Also:
-
PREINITIALIZATION
- See Also:
-
INITIALIZATION
- See Also:
-
EXCEPTION_HANDLER
- See Also:
-
SYNCHRONIZATION_LOCK
- See Also:
-
SYNCHRONIZATION_UNLOCK
- See Also:
-
ADVICE_EXECUTION
- See Also:
-
-
Method Details
-
toString
-
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 thethis
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 thetarget
pointcut designator. Unless you specifically need this reflective access, you should use thetarget
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.
-