Package org.apache.shiro.aspectj
Class BeforeAdviceMethodInvocationAdapter
- java.lang.Object
-
- org.apache.shiro.aspectj.BeforeAdviceMethodInvocationAdapter
-
- All Implemented Interfaces:
MethodInvocation
public class BeforeAdviceMethodInvocationAdapter extends Object implements MethodInvocation
Helper class that adapts an AspectJJoinPoint
.- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description BeforeAdviceMethodInvocationAdapter(Object anObject, Method aMethod, Object[] someArguments)
Creates a newBeforeAdviceMethodInvocationAdapter
instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BeforeAdviceMethodInvocationAdapter
createFrom(org.aspectj.lang.JoinPoint aJoinPoint)
Factory method that creates a newBeforeAdviceMethodInvocationAdapter
instance using the AspectJJoinPoint
provided.Object[]
getArguments()
Returns the (possibly null) arguments to be supplied to the method invocation.Method
getMethod()
Returns the actualMethod
to be invoked.Object
getThis()
Returns the object that holds the current joinpoint's static part.Object
proceed()
Continues the method invocation chain, or if the last in the chain, the method itself.
-
-
-
Constructor Detail
-
BeforeAdviceMethodInvocationAdapter
public BeforeAdviceMethodInvocationAdapter(Object anObject, Method aMethod, Object[] someArguments)
Creates a newBeforeAdviceMethodInvocationAdapter
instance.- Parameters:
aMethod
- The method to invoke.someArguments
- The arguments of the method invocation.
-
-
Method Detail
-
createFrom
public static BeforeAdviceMethodInvocationAdapter createFrom(org.aspectj.lang.JoinPoint aJoinPoint)
Factory method that creates a newBeforeAdviceMethodInvocationAdapter
instance using the AspectJJoinPoint
provided. If the joint point passed in is not a method joint point, this method throws anIllegalArgumentException
.- Parameters:
aJoinPoint
- The AspectJJoinPoint
to use to adapt the advice.- Returns:
- The created instance.
- Throws:
IllegalArgumentException
- If the join point passed in does not involve a method call.
-
getArguments
public Object[] getArguments()
Description copied from interface:MethodInvocation
Returns the (possibly null) arguments to be supplied to the method invocation.- Specified by:
getArguments
in interfaceMethodInvocation
- Returns:
- the (possibly null) arguments to be supplied to the method invocation.
-
getMethod
public Method getMethod()
Description copied from interface:MethodInvocation
Returns the actualMethod
to be invoked.- Specified by:
getMethod
in interfaceMethodInvocation
- Returns:
- the actual
Method
to be invoked.
-
proceed
public Object proceed() throws Throwable
Description copied from interface:MethodInvocation
Continues the method invocation chain, or if the last in the chain, the method itself.- Specified by:
proceed
in interfaceMethodInvocation
- Returns:
- the result of the Method invocation.
- Throws:
Throwable
- if the method or chain throws a Throwable
-
getThis
public Object getThis()
Description copied from interface:MethodInvocation
Returns the object that holds the current joinpoint's static part. For instance, the target object for an invocation.- Specified by:
getThis
in interfaceMethodInvocation
- Returns:
- the object that holds the current joinpoint's static part.
- Since:
- 1.0
-
-