EditEjbEntityAction.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: EditEjbEntityAction.java,v 1.6 2004/10/11 14:20:57 durieuxp Exp $
00023  * --------------------------------------------------------------------------
00024  */
00025 
00026 package org.objectweb.jonas.webapp.jonasadmin.service.ejb;
00027 
00028 import javax.management.ObjectName;
00029 
00030 import org.objectweb.jonas.jmx.JonasManagementRepr;
00031 
00035 public class EditEjbEntityAction extends EditEjbAction {
00036 
00037 // --------------------------------------------------------- Public Methods
00038 
00039 // --------------------------------------------------------- Protected Methods
00040 
00046     protected EjbForm getEjbForm() {
00047         return new EjbEntityForm();
00048     }
00049 
00057     protected void fillEjbInfo(EjbForm p_Form, ObjectName p_ObjectName)
00058         throws Exception {
00059         fillEjbGlobalInfo(p_Form, p_ObjectName);
00060 
00061         EjbEntityForm oForm = (EjbEntityForm) p_Form;
00062         oForm.setCacheSize(getIntegerAttribute(p_ObjectName, "cacheSize"));
00063         oForm.setMaxCacheSize(getIntegerAttribute(p_ObjectName, "maxCacheSize"));
00064         oForm.setMinPoolSize(getIntegerAttribute(p_ObjectName, "minPoolSize"));
00065         oForm.setPassivationTimeOut(getIntegerAttribute(p_ObjectName, "passivationTimeOut"));
00066         oForm.setInactivityTimeOut(getIntegerAttribute(p_ObjectName, "inactivityTimeOut"));
00067         oForm.setPersistency(getStringAttribute(p_ObjectName, "persistency"));
00068         oForm.setPoolSize(getIntegerAttribute(p_ObjectName, "poolSize"));
00069         oForm.setShared(getBooleanAttribute(p_ObjectName, "shared"));
00070         oForm.setPrefetch(getBooleanAttribute(p_ObjectName, "prefetch"));
00071         oForm.setLockPolicy(getStringAttribute(p_ObjectName, "lockPolicy"));
00072 
00073         Integer[] aiEntityCounters = (Integer[]) JonasManagementRepr.getAttribute(p_ObjectName
00074             , "entityCounters");
00075         oForm.setUsedInTxInstance(aiEntityCounters[0].intValue());
00076         oForm.setUsedOutTxInstance(aiEntityCounters[1].intValue());
00077         oForm.setUnusedInstance(aiEntityCounters[2].intValue());
00078         oForm.setPassivatedInstance(aiEntityCounters[3].intValue());
00079         oForm.setRemovedInstance(aiEntityCounters[4].intValue());
00080     }
00081 
00087     protected String getEjbForward() {
00088         return "Ejb Entity";
00089     }
00090 }

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