KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > injection > InjectionContainer


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2005, JBoss Inc., and individual contributors as indicated
4 * by the @authors tag. See the copyright.txt in the distribution for a
5 * full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */

22 package org.jboss.injection;
23
24 import org.jboss.ejb3.Container;
25 import org.jboss.ejb3.DependencyPolicy;
26 import org.jboss.ejb3.entity.PersistenceUnitDeployment;
27 import org.jboss.metamodel.descriptor.EnvironmentRefGroup;
28
29 import javax.naming.Context JavaDoc;
30 import javax.naming.NameNotFoundException JavaDoc;
31 import java.util.Map JavaDoc;
32 import java.util.List JavaDoc;
33 import java.lang.annotation.Annotation JavaDoc;
34 import java.lang.reflect.Method JavaDoc;
35 import java.lang.reflect.Field JavaDoc;
36 import java.lang.reflect.AccessibleObject JavaDoc;
37
38 /**
39  * This is the container that manages all injections. Could be an EJB Container
40  * or a WAR.
41  *
42  * @author <a HREF="mailto:bill@jboss.org">Bill Burke</a>
43  * @version $Revision: 57413 $
44  */

45 public interface InjectionContainer
46 {
47    /**
48     * Some identifier that can be used in error messages
49     *
50     * @return
51     */

52    String JavaDoc getIdentifier();
53
54    /**
55     * For error messages
56     *
57     * @return ejb-jar.xml, web.xml, etc..
58     */

59    String JavaDoc getDeploymentDescriptorType();
60
61    ClassLoader JavaDoc getClassloader();
62
63    Map JavaDoc<String JavaDoc, EncInjector> getEncInjectors();
64    Map JavaDoc<String JavaDoc, Map JavaDoc<AccessibleObject JavaDoc, Injector>> getEncInjections();
65
66    // EncInjectors/Handlers may need to add extra instance injectors
67
List JavaDoc<Injector> getInjectors();
68
69    Context JavaDoc getEnc();
70    Context JavaDoc getEncEnv();
71
72
73    PersistenceUnitDeployment getPersistenceUnitDeployment(String JavaDoc unitName) throws NameNotFoundException JavaDoc;
74
75    Container resolveEjbContainer(String JavaDoc link, Class JavaDoc businessIntf);
76    Container resolveEjbContainer(Class JavaDoc businessIntf) throws NameNotFoundException JavaDoc;
77    String JavaDoc getEjbJndiName(Class JavaDoc businessInterface) throws NameNotFoundException JavaDoc;
78    String JavaDoc getEjbJndiName(String JavaDoc link, Class JavaDoc businessInterface);
79
80    /**
81     * If class has container overridable annotations, this method will
82     * discover those overriden annotations.
83     *
84     * @param annotationType
85     * @param clazz
86     * @return
87     */

88    <T extends Annotation JavaDoc> T getAnnotation(Class JavaDoc<T> annotationType, Class JavaDoc<?> clazz);
89    
90    /**
91     * If class has container overridable annotations, this method will
92     * discover those overriden annotations.
93
94     * @param annotationType
95     * @param clazz
96     * @param method
97     * @return
98     */

99    <T extends Annotation JavaDoc> T getAnnotation(Class JavaDoc<T> annotationType, Class JavaDoc<?> clazz, Method JavaDoc method);
100    
101    <T extends Annotation JavaDoc> T getAnnotation(Class JavaDoc<T> annotationType, Method JavaDoc method);
102
103    /**
104     * If class has container overridable annotations, this method will
105     * discover those overriden annotations.
106
107     * @param annotationType
108     * @param clazz
109     * @param field
110     * @return
111     */

112    <T extends Annotation JavaDoc> T getAnnotation(Class JavaDoc<T> annotationType, Class JavaDoc<?> clazz, Field JavaDoc field);
113    
114    <T extends Annotation JavaDoc> T getAnnotation(Class JavaDoc<T> annotationType, Field JavaDoc field);
115
116    DependencyPolicy getDependencyPolicy();
117    
118    EnvironmentRefGroup getEnvironmentRefGroup();
119    
120 }
121
Popular Tags