EJBModule.java

00001 /*
00002  * JOnAS: Java(TM) Open Application Server
00003  * Copyright (C) 1999 Bull S.A.
00004  * Contact: jonas-team@objectweb.org
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
00019  * USA
00020  *
00021  * --------------------------------------------------------------------------
00022  * $Id: EJBModule.java,v 1.4 2004/03/19 14:31:51 sauthieg Exp $
00023  * --------------------------------------------------------------------------
00024  */
00025 
00026 package org.objectweb.jonas.container;
00027 
00028 // JOnAS Management
00029 import java.util.ArrayList;
00030 
00031 import org.objectweb.jonas.management.j2eemanagement.J2EEModule;
00032 import org.objectweb.jonas_ejb.container.JContainer;
00033 
00039 public class EJBModule extends J2EEModule {
00040 
00041     protected JContainer cont;
00042 
00043     // JSR 77
00044     private ArrayList ejbs = new ArrayList();
00045 
00046     // private attributes
00047     String containerName = null;
00048     String fileName = null;
00049 
00050     public EJBModule(String objectName, JContainer cont, String fileName, String containerName) {
00051         super(objectName);
00052         this.cont = cont;
00053         this.fileName = fileName;
00054         this.containerName = containerName;
00055     }
00056 
00057     public String[] getEjbs() {
00058         return ((String[]) ejbs.toArray(new String[ejbs.size()]));
00059     }
00060 
00061     protected void addEjb(String ejbObjectName) {
00062         ejbs.add(ejbObjectName);
00063     }
00064 
00065     public int getCurrentNumberOfEJB() {
00066         return ejbs.size();
00067     }
00068 
00069     public int getCurrentNumberOfBMP() {
00070         return cont.getEntityBMPNb();
00071     }
00072 
00073     public int getCurrentNumberOfCMP() {
00074         return cont.getEntityCMPNb();
00075     }
00076 
00077     public int getCurrentNumberOfSBF() {
00078         return cont.getStatefulSessionNb();
00079     }
00080 
00081     public int getCurrentNumberOfSBL() {
00082         return cont.getStatelessSessionNb();
00083     }
00084 
00085     public int getCurrentNumberOfMDB() {
00086         return cont.getMessageDrivenNb();
00087     }
00088 
00089     public String getContainerName() {
00090         return containerName;
00091     }
00092 
00093     public String getFileName() {
00094         return fileName;
00095     }
00096 
00097 }

Generated on Tue Feb 15 15:05:14 2005 for JOnAS by  doxygen 1.3.9.1