limpbizkit | 009bb09 | 2008-05-07 06:36:02 +0000 | [diff] [blame] | 1 | /** |
| 2 | * Copyright (C) 2006 Google Inc. |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package com.google.inject; |
| 18 | |
limpbizkit | a843a95 | 2009-04-08 22:24:55 +0000 | [diff] [blame] | 19 | import com.google.inject.internal.ImmutableMap; |
limpbizkit | a98bc7a | 2008-08-29 16:52:44 +0000 | [diff] [blame] | 20 | import com.google.inject.spi.InjectionPoint; |
limpbizkit | 185d2a2 | 2008-06-16 07:22:47 +0000 | [diff] [blame] | 21 | import java.lang.reflect.Constructor; |
limpbizkit | 009bb09 | 2008-05-07 06:36:02 +0000 | [diff] [blame] | 22 | import java.lang.reflect.InvocationTargetException; |
limpbizkit | 696c5cd | 2008-12-30 21:48:17 +0000 | [diff] [blame] | 23 | import java.lang.reflect.Method; |
| 24 | import java.util.List; |
limpbizkit | 009bb09 | 2008-05-07 06:36:02 +0000 | [diff] [blame] | 25 | |
| 26 | /** |
| 27 | * Proxies calls to a {@link java.lang.reflect.Constructor} for a class |
| 28 | * {@code T}. |
| 29 | * |
| 30 | * @author crazybob@google.com (Bob Lee) |
| 31 | */ |
| 32 | interface ConstructionProxy<T> { |
| 33 | |
| 34 | /** |
| 35 | * Constructs an instance of {@code T} for the given arguments. |
| 36 | */ |
| 37 | T newInstance(Object... arguments) throws InvocationTargetException; |
| 38 | |
limpbizkit | a98bc7a | 2008-08-29 16:52:44 +0000 | [diff] [blame] | 39 | /** |
| 40 | * Returns the injection point for this constructor. |
| 41 | */ |
| 42 | InjectionPoint getInjectionPoint(); |
limpbizkit | 009bb09 | 2008-05-07 06:36:02 +0000 | [diff] [blame] | 43 | |
| 44 | /** |
limpbizkit | 185d2a2 | 2008-06-16 07:22:47 +0000 | [diff] [blame] | 45 | * Returns the injected constructor. If the injected constructor is synthetic (such as generated |
| 46 | * code for method interception), the natural constructor is returned. |
limpbizkit | 009bb09 | 2008-05-07 06:36:02 +0000 | [diff] [blame] | 47 | */ |
limpbizkit | 477f9f9 | 2008-07-28 07:05:14 +0000 | [diff] [blame] | 48 | Constructor<T> getConstructor(); |
limpbizkit | 696c5cd | 2008-12-30 21:48:17 +0000 | [diff] [blame] | 49 | |
limpbizkit | bf0d876 | 2009-02-19 09:06:22 +0000 | [diff] [blame] | 50 | /*if[AOP]*/ |
limpbizkit | 696c5cd | 2008-12-30 21:48:17 +0000 | [diff] [blame] | 51 | /** |
| 52 | * Returns the interceptors applied to each method, in order of invocation. |
| 53 | */ |
limpbizkit | eb40513 | 2009-04-14 00:50:25 +0000 | [diff] [blame] | 54 | ImmutableMap<Method, List<org.aopalliance.intercept.MethodInterceptor>> getMethodInterceptors(); |
limpbizkit | bf0d876 | 2009-02-19 09:06:22 +0000 | [diff] [blame] | 55 | /*end[AOP]*/ |
limpbizkit | 009bb09 | 2008-05-07 06:36:02 +0000 | [diff] [blame] | 56 | } |