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());
}
}
| Modifier and Type | Class and Description |
|---|---|
| public static interface | |
| public static interface | JoinPoint.StaticPart
This helper object contains only the static information about a join point. |
| Modifier and Type | Field and Description |
|---|---|
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | METHOD_EXECUTION
The legal return values from getKind() |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String |
| Modifier and Type | Method and Description |
|---|---|
| public Object[] | |
| public String | Returns: a string representing the kind of join point.This string is guaranteed to be interned. |
| public Signature | Returns: the signature at the join point.
|
| public SourceLocation | Returns: the source location corresponding to the join point.If there is no source location available, returns null. |
| public JoinPoint. | |
| public Object | |
| public Object | Returns: the currently executing object (or null if not available - e.g. static context)Returns the currently executing object. |
| public String | |
| public String | |
| public String |
| ADVICE_EXECUTION | back to summary |
|---|---|
| public static final String ADVICE_EXECUTION | |
| CONSTRUCTOR_CALL | back to summary |
|---|---|
| public static final String CONSTRUCTOR_CALL | |
| CONSTRUCTOR_EXECUTION | back to summary |
|---|---|
| public static final String CONSTRUCTOR_EXECUTION | |
| EXCEPTION_HANDLER | back to summary |
|---|---|
| public static final String EXCEPTION_HANDLER | |
| FIELD_GET | back to summary |
|---|---|
| public static final String FIELD_GET | |
| FIELD_SET | back to summary |
|---|---|
| public static final String FIELD_SET | |
| INITIALIZATION | back to summary |
|---|---|
| public static final String INITIALIZATION | |
| METHOD_CALL | back to summary |
|---|---|
| public static final String METHOD_CALL | |
| METHOD_EXECUTION | back to summary |
|---|---|
| public static final String METHOD_EXECUTION The legal return values from getKind() | |
| PREINITIALIZATION | back to summary |
|---|---|
| public static final String PREINITIALIZATION | |
| STATICINITIALIZATION | back to summary |
|---|---|
| public static final String STATICINITIALIZATION | |
| SYNCHRONIZATION_LOCK | back to summary |
|---|---|
| public static final String SYNCHRONIZATION_LOCK | |
| SYNCHRONIZATION_UNLOCK | back to summary |
|---|---|
| public static final String SYNCHRONIZATION_UNLOCK | |
| getArgs | back to summary |
|---|---|
public Object[] getArgs()
| |
| getKind | back to summary |
|---|---|
| public String getKind() This string is guaranteed to be interned.
| |
| getSignature | back to summary |
|---|---|
| public Signature getSignature()
| |
| getSourceLocation | back to summary |
|---|---|
| public SourceLocation getSourceLocation() If there is no source location available, returns null. Returns the SourceLocation of the defining class for default constructors.
| |
| getStaticPart | back to summary |
|---|---|
public JoinPoint.
| |
| getTarget | back to summary |
|---|---|
| public Object getTarget() Returns the target object. This will always be
the same object as that matched by the
| |
| getThis | back to summary |
|---|---|
| public Object getThis() Returns the currently executing object. This will always be
the same object as that matched by the Returns null when there is no currently executing object available. This includes all join points that occur in a static context.
| |
| toLongString | back to summary |
|---|---|
public String toLongString()
| |
| toShortString | back to summary |
|---|---|
public String toShortString()
| |
| toString | back to summary |
|---|---|
| public String toString() | |
This helper object contains only the static information about a join point.
It is available from the JoinPoint.getStaticPart() method, and
can be accessed separately within advice using the special form
thisJoinPointStaticPart.
If you are only interested in the static information about a join point, you should access it through this type for the best performance. This is particularly useful for library methods that want to do serious manipulations of this information, i.e.
public class LoggingUtils {
public static void prettyPrint(JoinPoint.StaticPart jp) {
...
}
}
aspect Logging {
before(): ... { LoggingUtils.prettyPrint(thisJoinPointStaticPart); }
}
JoinPoint#getStaticPart()
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| public String | Returns: a string representing the kind of join point. This String is guaranteed to be interned
|
| public Signature | |
| public SourceLocation | Returns: the SourceLocation of the defining class for default constructorsReturns the source location corresponding to the join point. |
| public String | |
| public String | |
| public String |
| getId | back to summary |
|---|---|
| public int getId() Return the id for this JoinPoint.StaticPart. All JoinPoint.StaticPart
instances are assigned an id number upon creation. For each advised type
the id numbers start at 0.
| |
| getKind | back to summary |
|---|---|
public String getKind()
| |
| getSignature | back to summary |
|---|---|
public Signature getSignature()
| |
| getSourceLocation | back to summary |
|---|---|
| public SourceLocation getSourceLocation() Returns the source location corresponding to the join point. If there is no source location available, returns null.
| |
| toLongString | back to summary |
|---|---|
public String toLongString()
| |
| toShortString | back to summary |
|---|---|
public String toShortString()
| |
| toString | back to summary |
|---|---|
| public String toString() | |