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     * @since 0.1
028     */
029    public interface MethodInvocation {
030    
031        /**
032         * Continues the method invocation chain, or if the last in the chain, the method itself.
033         *
034         * @return the result of the Method invocation.
035         * @throws Throwable if the method or chain throws a Throwable
036         */
037        Object proceed() throws Throwable;
038    
039        /**
040         * Returns the actual {@link Method Method} to be invoked.
041         *
042         * @return the actual {@link Method Method} to be invoked.
043         */
044        Method getMethod();
045    
046        /**
047         * Returns the (possibly null) arguments to be supplied to the method invocation.
048         *
049         * @return the (possibly null) arguments to be supplied to the method invocation.
050         */
051        Object[] getArguments();
052    
053        /**
054         * Returns the object that holds the current joinpoint's static part.
055         * For instance, the target object for an invocation.
056         *
057         * @return the object that holds the current joinpoint's static part.
058         * @since 1.0
059         */
060        Object getThis();
061    
062    
063    }
064