KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > deployment > InjectionCapable


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23 package com.sun.enterprise.deployment;
24
25 import java.lang.reflect.Method JavaDoc;
26 import java.lang.reflect.Field JavaDoc;
27 import java.util.Set JavaDoc;
28
29 /**
30  * InjectionCapable describes a type of J2EE component environment resource
31  * that is capable of being injected at runtime.
32  *
33  * @author Kenneth Saks
34  */

35 public interface InjectionCapable {
36
37     /**
38      * True if a particular resource instance is injectable. All injectable
39      * resources are also exposed via their corresponding java:comp/env
40      * namespaces, but not all resources in java:comp/env are injectable.
41      * A resource is either field injectable or method injectable but never
42      * both.
43      */

44     public boolean isInjectable();
45     
46     /**
47      * @return the set of injection targets for this resource dependency
48      */

49     public Set JavaDoc<InjectionTarget> getInjectionTargets();
50     
51     /**
52      * Add a new injection target for this dependency
53      */

54     public void addInjectionTarget(InjectionTarget target);
55
56     /**
57      * ComponentEnvName is the name of the corresponding java:comp/env
58      * entry for the object that is to be injected.
59      */

60     public String JavaDoc getComponentEnvName();
61
62     /**
63      * This is the class name of the type of resource that is to be injected.
64      */

65     public String JavaDoc getInjectResourceType();
66     public void setInjectResourceType(String JavaDoc resourceType);
67     
68 }
69
Popular Tags