Top Description Inners Fields Methods
org.aspectj.lang

public Interface JoinPoint

Known Direct Subinterfaces
org.aspectj.lang.ProceedingJoinPoint
Imports
org.aspectj.lang.reflect.SourceLocation

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 and Inner Type Summary

Modifier and TypeClass and Description
public static interface
public static interface
JoinPoint.StaticPart

This helper object contains only the static information about a join point.

Field Summary

Modifier and TypeField 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

Method Summary

Modifier and TypeMethod and Description
public Object[]

Returns:

the arguments at this join point
getArgs
()

public String

Returns:

a string representing the kind of join point.
getKind
()

This string is guaranteed to be interned.

public Signature

Returns:

the signature at the join point.
getSignature
()

getStaticPart().getSignature() returns the same object

public SourceLocation

Returns:

the source location corresponding to the join point.
getSourceLocation
()

If there is no source location available, returns null.

public JoinPoint.StaticPart

Returns:

an object that encapsulates the static parts of this join point.
getStaticPart
()

public Object

Returns:

the target object (or null if there isn't one)
getTarget
()

Returns the target object.

public Object

Returns:

the currently executing object (or null if not available - e.g. static context)
getThis
()

Returns the currently executing object.

public String

Returns:

an extended string representation of the join point.
toLongString
()

public String

Returns:

an abbreviated string representation of the join point.
toShortString
()

public String

Field Detail

ADVICE_EXECUTIONback to summary
public static final String ADVICE_EXECUTION
CONSTRUCTOR_CALLback to summary
public static final String CONSTRUCTOR_CALL
CONSTRUCTOR_EXECUTIONback to summary
public static final String CONSTRUCTOR_EXECUTION
EXCEPTION_HANDLERback to summary
public static final String EXCEPTION_HANDLER
FIELD_GETback to summary
public static final String FIELD_GET
FIELD_SETback to summary
public static final String FIELD_SET
INITIALIZATIONback to summary
public static final String INITIALIZATION
METHOD_CALLback to summary
public static final String METHOD_CALL
METHOD_EXECUTIONback to summary
public static final String METHOD_EXECUTION

The legal return values from getKind()

PREINITIALIZATIONback to summary
public static final String PREINITIALIZATION
STATICINITIALIZATIONback to summary
public static final String STATICINITIALIZATION
SYNCHRONIZATION_LOCKback to summary
public static final String SYNCHRONIZATION_LOCK
SYNCHRONIZATION_UNLOCKback to summary
public static final String SYNCHRONIZATION_UNLOCK

Method Detail

getArgsback to summary
public Object[] getArgs()
Returns:Object[]

the arguments at this join point

getKindback to summary
public String getKind()

This string is guaranteed to be interned. getStaticPart().getKind() returns the same object.

Returns:String

a string representing the kind of join point.

getSignatureback to summary
public Signature getSignature()

getStaticPart().getSignature() returns the same object

Returns:Signature

the signature at the join point.

getSourceLocationback 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().getSourceLocation() returns the same object.

Returns:SourceLocation

the source location corresponding to the join point.

getStaticPartback to summary
public JoinPoint.StaticPart getStaticPart()
Returns:JoinPoint.StaticPart

an object that encapsulates the static parts of this join point.

getTargetback to summary
public 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:Object

the target object (or null if there isn't one)

getThisback to summary
public 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:Object

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

toLongStringback to summary
public String toLongString()
Returns:String

an extended string representation of the join point.

toShortStringback to summary
public String toShortString()
Returns:String

an abbreviated string representation of the join point.

toStringback to summary
public String toString()
org.aspectj.lang back to summary

public Interface JoinPoint.EnclosingStaticPart

extends StaticPart
Known Direct Implementers
org.aspectj.runtime.reflect.JoinPointImpl.EnclosingStaticPartImpl

Method Summary

Inherited from org.aspectj.lang.JoinPoint.StaticPart:
getIdgetKindgetSignaturegetSourceLocationtoLongStringtoShortStringtoString
org.aspectj.lang back to summary

public Interface JoinPoint.StaticPart

Known Direct Subinterfaces
org.aspectj.lang.JoinPoint.EnclosingStaticPart
Known Direct Implementers
org.aspectj.runtime.reflect.JoinPointImpl.StaticPartImpl

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); }
}
See Also
JoinPoint#getStaticPart()

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the id of this joinpoint
getId
()

Return the id for this JoinPoint.StaticPart.

public String

Returns:

a string representing the kind of join point. This String is guaranteed to be interned
getKind
()

public Signature

Returns:

the signature at the join point.
getSignature
()

public SourceLocation

Returns:

the SourceLocation of the defining class for default constructors
getSourceLocation
()

Returns the source location corresponding to the join point.

public String

Returns:

an extended string representation of the join point
toLongString
()

public String

Returns:

an abbreviated string representation of the join point
toShortString
()

public String

Method Detail

getIdback 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.
The id is guaranteed to remain constant across repeated executions of a program but may change if the code is recompiled.
The benefit of having an id is that it can be used for array index purposes which can be quicker than using the JoinPoint.StaticPart object itself in a map lookup.
Since two JoinPoint.StaticPart instances in different advised types may have the same id, then if the id is being used to index some joinpoint specific state then that state must be maintained on a pertype basis - either by using pertypewithin() or an ITD.

Returns:int

the id of this joinpoint

getKindback to summary
public String getKind()
Returns:String

a string representing the kind of join point. This String is guaranteed to be interned

getSignatureback to summary
public Signature getSignature()
Returns:Signature

the signature at the join point.

getSourceLocationback to summary
public SourceLocation getSourceLocation()

Returns the source location corresponding to the join point. If there is no source location available, returns null.

Returns:SourceLocation

the SourceLocation of the defining class for default constructors

toLongStringback to summary
public String toLongString()
Returns:String

an extended string representation of the join point

toShortStringback to summary
public String toShortString()
Returns:String

an abbreviated string representation of the join point

toStringback to summary
public String toString()