KickJava   Java API By Example, From Geeks To Geeks.

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


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.util.List JavaDoc;
26 import java.util.LinkedList JavaDoc;
27
28 import java.lang.reflect.Method JavaDoc;
29
30 public class InjectionInfo {
31
32     private List JavaDoc<InjectionCapable> injectionResources;
33
34     // Name of post-consturct method. Set to null if there is no post-construct
35
// method for this class.
36
private String JavaDoc postConstructMethodName;
37
38     // Cached post-construct reflection object method. Only
39
// set at runtime.
40
private Method JavaDoc postConstructMethod;
41
42     // Name of pre-destroy method. Set to null if there is no pre-destroy
43
// method for this class.
44
private String JavaDoc preDestroyMethodName;
45
46     // Cached pre-destroy reflection object method. Only
47
// set at runtime.
48
private Method JavaDoc preDestroyMethod;
49
50     private String JavaDoc className;
51
52     public InjectionInfo() {
53     }
54
55     public InjectionInfo(String JavaDoc cName, String JavaDoc postmName, String JavaDoc premName,
56             List JavaDoc<InjectionCapable> resources) {
57         className = cName;
58         postConstructMethodName = postmName;
59         preDestroyMethodName = premName;
60         injectionResources = resources;
61     }
62
63     public List JavaDoc<InjectionCapable> getInjectionResources() {
64         if (injectionResources == null) {
65             injectionResources = new LinkedList JavaDoc<InjectionCapable>();
66         }
67         return injectionResources;
68     }
69
70     public void setInjectionResources(List JavaDoc<InjectionCapable> resources) {
71         injectionResources = resources;
72     }
73
74     public String JavaDoc getPostConstructMethodName() {
75         return postConstructMethodName;
76     }
77
78     public void setPostConstructMethodName(String JavaDoc methodName) {
79         postConstructMethodName = methodName;
80     }
81
82     public Method JavaDoc getPostConstructMethod() {
83         return postConstructMethod;
84     }
85
86     public void setPostConstructMethod(Method JavaDoc method) {
87         postConstructMethod = method;
88     }
89
90     public String JavaDoc getPreDestroyMethodName() {
91         return preDestroyMethodName;
92     }
93
94     public Method JavaDoc getPreDestroyMethod() {
95         return preDestroyMethod;
96     }
97
98     public void setPreDestroyMethod(Method JavaDoc method) {
99         preDestroyMethod = method;
100     }
101
102     public String JavaDoc getClassName() {
103         return className;
104     }
105
106     public void setClassName(String JavaDoc name) {
107         className = name;
108     }
109 }
110
Popular Tags