public static BeforeAdviceMethodInvocationAdapter createFrom(JoinPoint aJoinPoint) {
        if (aJoinPoint.getSignature() instanceof MethodSignature) {
            return new BeforeAdviceMethodInvocationAdapter(aJoinPoint.getThis(),
                    ((MethodSignature) aJoinPoint.getSignature()).getMethod(),
                    aJoinPoint.getArgs());

        } else if (aJoinPoint.getSignature() instanceof AdviceSignature) {
            return new BeforeAdviceMethodInvocationAdapter(aJoinPoint.getThis(),
                    ((AdviceSignature) aJoinPoint.getSignature()).getAdvice(),
                    aJoinPoint.getArgs());

        } else {
            throw new IllegalArgumentException("The joint point signature is invalid: expected a MethodSignature or "
                    + " an AdviceSignature but was " + aJoinPoint.getSignature());
        }
    }
Factory method that creates a new {@link BeforeAdviceMethodInvocationAdapter} instance
using the AspectJ {@link JoinPoint} provided. If the joint point passed in is not
a method joint point, this method throws an {@link IllegalArgumentException}.

@param aJoinPoint The AspectJ {@link JoinPoint} to use to adapt the advice.
@return The created instance.
@throws IllegalArgumentException If the join point passed in does not involve a method call.
support/aspectj/src/main/java/org/apache/shiro/aspectj/BeforeAdviceMethodInvocationAdapter.java