001 /*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements. See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership. The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License. You may obtain a copy of the License at
009 *
010 * http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing,
013 * software distributed under the License is distributed on an
014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 * KIND, either express or implied. See the License for the
016 * specific language governing permissions and limitations
017 * under the License.
018 */
019 package org.apache.shiro.aop;
020
021 import java.lang.reflect.Method;
022
023 /**
024 * 3rd-party API independent representation of a method invocation. This is needed so Shiro can support other
025 * MethodInvocation instances from other AOP frameworks/APIs.
026 *
027 * @author Jeremy Haile
028 * @author Les Hazlewood
029 * @since 0.1
030 */
031 public interface MethodInvocation {
032
033 /**
034 * Continues the method invocation chain, or if the last in the chain, the method itself.
035 *
036 * @return the result of the Method invocation.
037 * @throws Throwable if the method or chain throws a Throwable
038 */
039 Object proceed() throws Throwable;
040
041 /**
042 * Returns the actual {@link Method Method} to be invoked.
043 *
044 * @return the actual {@link Method Method} to be invoked.
045 */
046 Method getMethod();
047
048 /**
049 * Returns the (possibly null) arguments to be supplied to the method invocation.
050 *
051 * @return the (possibly null) arguments to be supplied to the method invocation.
052 */
053 Object[] getArguments();
054
055 /**
056 * Returns the object that holds the current joinpoint's static part.
057 * For instance, the target object for an invocation.
058 *
059 * @return the object that holds the current joinpoint's static part.
060 * @since 1.0
061 */
062 Object getThis();
063
064
065 }
066