KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > sun > share > configbean > customizers > ejbmodule > StatelessEjbCustomizer


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 /*
20  * StatelessEjbCustomizer.java October 21, 2003, 12:15 PM
21  *
22  */

23 package org.netbeans.modules.j2ee.sun.share.configbean.customizers.ejbmodule;
24
25 import java.util.ArrayList JavaDoc;
26 import java.util.Collection JavaDoc;
27
28 import javax.swing.event.TableModelListener JavaDoc;
29
30 //DEPLOYMENT API
31
import javax.enterprise.deploy.spi.DConfigBean JavaDoc;
32
33 import org.netbeans.modules.j2ee.sun.dd.api.ejb.BeanPool;
34 import org.netbeans.modules.j2ee.sun.share.configbean.BaseEjb;
35 import org.netbeans.modules.j2ee.sun.share.configbean.SessionEjb;
36 import org.netbeans.modules.j2ee.sun.share.configbean.StatelessEjb;
37
38 /**
39  *
40  * @author Rajeshwar Patil
41  * @version %I%, %G%
42  */

43 public class StatelessEjbCustomizer extends SessionEjbCustomizer
44             implements TableModelListener JavaDoc {
45
46     private StatelessEjb theBean;
47     private BeanPoolPanel beanPoolPanel;
48
49     /** Creates a new instance of StatelessEjbCustomizer */
50     public StatelessEjbCustomizer() {
51     }
52     
53     public StatelessEjbCustomizer(DConfigBean JavaDoc bean) {
54         setObject(bean);
55     }
56
57     public void setObject(Object JavaDoc bean) {
58         super.setObject(bean);
59         
60         // Only do this if the bean is actually changing.
61
if(theBean != bean) {
62             if(bean instanceof StatelessEjb) {
63                 theBean = (StatelessEjb) bean;
64             }
65         }
66     }
67
68
69     public String JavaDoc getHelpId() {
70         return "AS_CFG_StatelessEjb"; //NOI18N
71
}
72
73
74     //get the bean specific panel
75
protected javax.swing.JPanel JavaDoc getBeanPanel(){
76         return null;
77     }
78
79
80     //initialize all the elements in the bean specific panel
81
protected void initializeBeanPanel(BaseEjb theBean){};
82     
83
84     protected void addTabbedBeanPanels() {
85         super.addTabbedBeanPanels();
86         beanPoolPanel = new BeanPoolPanel(this);
87         beanPoolPanel.getAccessibleContext().setAccessibleName(bundle.getString("BeanPool_Acsbl_Name")); //NOI18N
88
beanPoolPanel.getAccessibleContext().setAccessibleDescription(bundle.getString("BeanPool_Acsbl_Desc")); //NOI18N
89
tabbedPanel.insertTab(bundle.getString("LBL_BeanPool"), null, beanPoolPanel, null, 0); // NOI18N
90
//Select Bean Pool Panel
91
tabbedPanel.setSelectedIndex(tabbedPanel.indexOfTab(bundle.getString("LBL_BeanPool"))); //NOI18N
92
}
93
94
95     protected void initializeTabbedBeanPanels(BaseEjb theBean) {
96         super.initializeTabbedBeanPanels(theBean);
97         if(!(theBean instanceof StatelessEjb)){
98             assert(false);
99         }
100         StatelessEjb statelessEjb = (StatelessEjb)theBean;
101         BeanPool beanPool = statelessEjb.getBeanPool();
102         beanPoolPanel.setValues(beanPool);
103     }
104
105
106     public Collection JavaDoc getErrors(){
107         ArrayList JavaDoc errors = null;
108         if(validationSupport == null) assert(false);
109         errors = (ArrayList JavaDoc)super.getErrors();
110
111         //Stateless Session Ejb field Validations
112

113         return errors;
114     }
115
116
117     public java.awt.GridBagConstraints JavaDoc getErrorPanelConstraints(){
118         return super.getErrorPanelConstraints();
119     }
120 }
121
Popular Tags