01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package java.lang.reflect;
19:
20: /**
21: * Implementors of this interface decode and dispatch methods sent to proxy
22: * instances.
23: *
24: * @see Proxy
25: */
26: public interface InvocationHandler {
27:
28: /**
29: * Return the result of decoding and dispatching the method which was
30: * originally sent to the proxy instance.
31: *
32: * @param proxy
33: * the proxy instance which was the receiver of the method.
34: * @param method
35: * the Method invoked on the proxy instance.
36: * @param args
37: * an array of objects containing the parameters passed to the
38: * method, or null if no arguments are expected. primitive types
39: * are wrapped in the appropriate class.
40: * @return the result of executing the method
41: *
42: * @throws Throwable
43: * if an exception was thrown by the invoked method. The
44: * exception must match one of the declared exception types for
45: * the invoked method or any unchecked exception type. If not
46: * then an UndeclaredThrowableException is thrown.
47: */
48: public Object invoke(Object proxy, Method method, Object[] args)
49: throws Throwable;
50: }
|