KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > container > EJBModule


1 /*
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: EJBModule.java,v 1.4 2004/03/19 14:31:51 sauthieg Exp $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.jonas.container;
27
28 // JOnAS Management
29
import java.util.ArrayList JavaDoc;
30
31 import org.objectweb.jonas.management.j2eemanagement.J2EEModule;
32 import org.objectweb.jonas_ejb.container.JContainer;
33
34 /**
35  * MBean class for EJBModule management
36  *
37  * @author Adriana Danes JSR 77 (J2EE Management Standard)
38  */

39 public class EJBModule extends J2EEModule {
40
41     protected JContainer cont;
42
43     // JSR 77
44
private ArrayList JavaDoc ejbs = new ArrayList JavaDoc();
45
46     // private attributes
47
String JavaDoc containerName = null;
48     String JavaDoc fileName = null;
49
50     public EJBModule(String JavaDoc objectName, JContainer cont, String JavaDoc fileName, String JavaDoc containerName) {
51         super(objectName);
52         this.cont = cont;
53         this.fileName = fileName;
54         this.containerName = containerName;
55     }
56
57     public String JavaDoc[] getEjbs() {
58         return ((String JavaDoc[]) ejbs.toArray(new String JavaDoc[ejbs.size()]));
59     }
60
61     protected void addEjb(String JavaDoc ejbObjectName) {
62         ejbs.add(ejbObjectName);
63     }
64
65     public int getCurrentNumberOfEJB() {
66         return ejbs.size();
67     }
68
69     public int getCurrentNumberOfBMP() {
70         return cont.getEntityBMPNb();
71     }
72
73     public int getCurrentNumberOfCMP() {
74         return cont.getEntityCMPNb();
75     }
76
77     public int getCurrentNumberOfSBF() {
78         return cont.getStatefulSessionNb();
79     }
80
81     public int getCurrentNumberOfSBL() {
82         return cont.getStatelessSessionNb();
83     }
84
85     public int getCurrentNumberOfMDB() {
86         return cont.getMessageDrivenNb();
87     }
88
89     public String JavaDoc getContainerName() {
90         return containerName;
91     }
92
93     public String JavaDoc getFileName() {
94         return fileName;
95     }
96
97 }
98
Popular Tags