org.apache.shiro.aspectj
Class BeforeAdviceMethodInvocationAdapter

java.lang.Object
  extended by org.apache.shiro.aspectj.BeforeAdviceMethodInvocationAdapter
All Implemented Interfaces:
MethodInvocation

public class BeforeAdviceMethodInvocationAdapter
extends Object
implements MethodInvocation

Helper class that adapts an AspectJ JoinPoint.

Since:
1.0

Constructor Summary
BeforeAdviceMethodInvocationAdapter(Object anObject, Method aMethod, Object[] someArguments)
          Creates a new BeforeAdviceMethodInvocationAdapter instance.
 
Method Summary
static BeforeAdviceMethodInvocationAdapter createFrom(org.aspectj.lang.JoinPoint aJoinPoint)
          Factory method that creates a new BeforeAdviceMethodInvocationAdapter instance using the AspectJ JoinPoint provided.
 Object[] getArguments()
          Returns the (possibly null) arguments to be supplied to the method invocation.
 Method getMethod()
          Returns the actual Method 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeforeAdviceMethodInvocationAdapter

public BeforeAdviceMethodInvocationAdapter(Object anObject,
                                           Method aMethod,
                                           Object[] someArguments)
Creates a new BeforeAdviceMethodInvocationAdapter 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 new BeforeAdviceMethodInvocationAdapter instance using the AspectJ JoinPoint provided. If the joint point passed in is not a method joint point, this method throws an IllegalArgumentException.

Parameters:
aJoinPoint - The AspectJ JoinPoint 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 interface MethodInvocation
Returns:
the (possibly null) arguments to be supplied to the method invocation.

getMethod

public Method getMethod()
Description copied from interface: MethodInvocation
Returns the actual Method to be invoked.

Specified by:
getMethod in interface MethodInvocation
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 interface MethodInvocation
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 interface MethodInvocation
Returns:
the object that holds the current joinpoint's static part.
Since:
1.0


Copyright © 2004-2014 The Apache Software Foundation. All Rights Reserved.