jasco.runtime
Interface MethodJoinpoint

All Known Implementing Classes:
DistributedJascoMethod, DummyMixinJP, JascoDirectCallbackMethod, JascoMethod, ReflectJascoMethod, TraversalJascoMethod

public interface MethodJoinpoint

The thisJoinPoint keyword availabe in JAsCo aspects is of type MethodJoinpoint, this means that all subsequent methods are availabe for this keyword. thisJoinPoint refers to the method joinpoint that triggered the aspect.

Author:
Wim

Method Summary
 java.lang.Class[] getActualArgumentTypes()
          Returns the actual argument types
 java.lang.annotation.Annotation[] getAnnotations()
          Returns all defined annotations
 java.lang.Object[] getArgumentsArray()
          Returns an array of all arguments
 java.lang.Object getCalledObject()
          Returns the object the method is invoked upon
 java.lang.ClassLoader getClassLoader()
          Returns the classLoader responsible for loading this joinpoint.
 java.lang.String getClassName()
          Returns the fully quantified name of class the method is declared
 java.lang.Class[] getExceptionTypes()
          Returns java.lang.reflect.class objects denoting types of exceptions thrown by this method
 java.lang.String[] getFormalArgumentTypeNames()
          returns array of full class names of formal arguments
 java.lang.Class[] getFormalArgumentTypes()
          Returns the formal argument types
 java.lang.String getFullName()
          Deprecated. use getSignature instead
 int getModifiers()
          Returns the modifiers intger, see java.lang.reflect.Modifier
 java.lang.String getName()
          Returns the method name
 java.lang.Class getReturnType()
          Returns java.lang.reflect.class object denoting the return type of this method
 java.lang.String getReturnTypeName()
          returns full class name of return type
 java.lang.String getSignature()
          Returns the unique name for this method joinpoint
 int getSourceLocation()
          returns location of joinpoint in original source code
 java.lang.Object invoke(java.lang.Object obj, java.lang.Object[] args)
          Invokes the replaced method or subsequent around advices, only availabe in around advice
 java.lang.Object invokeAgain()
          Allows to invoke the original method all over again with original arguments.
 java.lang.Object invokeAgain(java.lang.Object calledobject, java.lang.Object[] args)
          Allows to invoke the original method all over again.
 java.lang.Object invokeJAsCoMethod()
          Invokes the replaced method or subsequent around advices with original arguments, only availabe in around advice.
 java.lang.Object invokeNoAspectAgain()
          Allows to invoke the original method again with original arguments.
 java.lang.Object invokeOriginal(java.lang.Object obj, java.lang.Object[] args)
          Invokes the original method, only availabe in around advice.
 java.lang.Object invokeOriginalJAsCoMethod()
          Invokes the original method with original arguments, only availabe in around advice.
 boolean isCall()
          Returns true when this method joinpoint is a call joinpoint
 boolean isExecution()
          Returns true when this method joinpoint is an execution joinpoint
 java.lang.Class loadClass()
          Loads this class
 

Method Detail

getExceptionTypes

java.lang.Class[] getExceptionTypes()
Returns java.lang.reflect.class objects denoting types of exceptions thrown by this method


getReturnType

java.lang.Class getReturnType()
Returns java.lang.reflect.class object denoting the return type of this method


getFullName

java.lang.String getFullName()
Deprecated. use getSignature instead

Returns the unique name for this method joinpoint


getSignature

java.lang.String getSignature()
Returns the unique name for this method joinpoint


isExecution

boolean isExecution()
Returns true when this method joinpoint is an execution joinpoint


isCall

boolean isCall()
Returns true when this method joinpoint is a call joinpoint


getName

java.lang.String getName()
Returns the method name


loadClass

java.lang.Class loadClass()
Loads this class


getAnnotations

java.lang.annotation.Annotation[] getAnnotations()
Returns all defined annotations


getActualArgumentTypes

java.lang.Class[] getActualArgumentTypes()
Returns the actual argument types


getFormalArgumentTypes

java.lang.Class[] getFormalArgumentTypes()
Returns the formal argument types


getClassName

java.lang.String getClassName()
Returns the fully quantified name of class the method is declared


getModifiers

int getModifiers()
Returns the modifiers intger, see java.lang.reflect.Modifier


getArgumentsArray

java.lang.Object[] getArgumentsArray()
Returns an array of all arguments


getCalledObject

java.lang.Object getCalledObject()
Returns the object the method is invoked upon


invokeJAsCoMethod

java.lang.Object invokeJAsCoMethod()
                                   throws java.lang.Exception
Invokes the replaced method or subsequent around advices with original arguments, only availabe in around advice. Is equivalent to invoking proceed(), proceed is however the preferred because it will execute considerably faster because of optimizations.

Throws:
ProceedFinishedException - proceed was previously invoked and all advices and original method already executed.
java.lang.Exception

invokeOriginalJAsCoMethod

java.lang.Object invokeOriginalJAsCoMethod()
                                           throws java.lang.Exception
Invokes the original method with original arguments, only availabe in around advice. WARNING: This method bypasses the around chain, subsequent arounds are not executed! Use invokeJAsCoMethod if you just want to proceed.

Throws:
java.lang.Exception

invoke

java.lang.Object invoke(java.lang.Object obj,
                        java.lang.Object[] args)
                        throws java.lang.Exception
Invokes the replaced method or subsequent around advices, only availabe in around advice

Parameters:
obj - The object to invoke the method upon, is typically thisJoinPointObject keyword
args - The arguments to invoke the proceed chain with.
Throws:
ProceedFinishedException - proceed was previously invoked and all advices and original method already executed.
java.lang.Exception

invokeOriginal

java.lang.Object invokeOriginal(java.lang.Object obj,
                                java.lang.Object[] args)
                                throws java.lang.Exception
Invokes the original method, only availabe in around advice. WARNING: This method bypasses the around chain, subsequent arounds are not executed! Use invokeJAsCoMethod if you just want to proceed.

Parameters:
obj - The object to invoke the method upon, is typically thisJoinPointObject keyword
args - The arguments to invoke the original method with.
Throws:
java.lang.Exception

invokeAgain

java.lang.Object invokeAgain()
                             throws java.lang.Exception
Allows to invoke the original method all over again with original arguments. This means that the list of applicable aspects is rebuild. WARNING: could easily cause an infinite loop if this aspect is applicable again! Does not work with method overloading yet.

Throws:
java.lang.Exception

invokeAgain

java.lang.Object invokeAgain(java.lang.Object calledobject,
                             java.lang.Object[] args)
                             throws java.lang.Exception
Allows to invoke the original method all over again. This means that the list of applicable aspects is rebuild and all aspects (including the current one) are triggered again if applicable. WARNING: could easily cause an infinite loop if this aspect is applicable again! Does not work with method overloading yet.

Parameters:
calledobject - The object to invoke the method upon, is typically thisJoinPointObject keyword
args - The arguments to invoke the original method with.
Throws:
java.lang.Exception

invokeNoAspectAgain

java.lang.Object invokeNoAspectAgain()
                                     throws java.lang.Exception
Allows to invoke the original method again with original arguments. If this aspect is however triggered by a method defined in another aspect (aspects on aspects), the triggering method for that aspect is used unless that aspect is triggered by a method defined in an aspect etc...

Throws:
java.lang.Exception

getClassLoader

java.lang.ClassLoader getClassLoader()
Returns the classLoader responsible for loading this joinpoint. When using reflection on certain classes related to the joinpoint use this classloader to ensure classloader safety in complicated class loader hierarchies.


getReturnTypeName

java.lang.String getReturnTypeName()
returns full class name of return type

Returns:
full class name of return type

getFormalArgumentTypeNames

java.lang.String[] getFormalArgumentTypeNames()
returns array of full class names of formal arguments

Returns:
full class names of formal arguments

getSourceLocation

int getSourceLocation()
returns location of joinpoint in original source code

Returns:
line number or -1 if not available