KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > webapp > jonasadmin > service > ejb > EditEjbEntityAction


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: EditEjbEntityAction.java,v 1.6 2004/10/11 14:20:57 durieuxp Exp $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.jonas.webapp.jonasadmin.service.ejb;
27
28 import javax.management.ObjectName JavaDoc;
29
30 import org.objectweb.jonas.jmx.JonasManagementRepr;
31
32 /**
33  * @author Michel-Ange ANTON
34  */

35 public class EditEjbEntityAction extends EditEjbAction {
36
37 // --------------------------------------------------------- Public Methods
38

39 // --------------------------------------------------------- Protected Methods
40

41     /**
42      * Return a <code>EjbEntityForm</code> instance associate to the EJB.
43      *
44      * @return A form instance
45      */

46     protected EjbForm getEjbForm() {
47         return new EjbEntityForm();
48     }
49
50     /**
51      * Fill all infos of EJB Entity in the <code>EjbEntityForm</code> instance.
52      *
53      * @param p_Form Instance to fill
54      * @param p_ObjectName Instance to get infos
55      * @throws Exception
56      */

57     protected void fillEjbInfo(EjbForm p_Form, ObjectName JavaDoc p_ObjectName)
58         throws Exception JavaDoc {
59         fillEjbGlobalInfo(p_Form, p_ObjectName);
60
61         EjbEntityForm oForm = (EjbEntityForm) p_Form;
62         oForm.setCacheSize(getIntegerAttribute(p_ObjectName, "cacheSize"));
63         oForm.setMaxCacheSize(getIntegerAttribute(p_ObjectName, "maxCacheSize"));
64         oForm.setMinPoolSize(getIntegerAttribute(p_ObjectName, "minPoolSize"));
65         oForm.setPassivationTimeOut(getIntegerAttribute(p_ObjectName, "passivationTimeOut"));
66         oForm.setInactivityTimeOut(getIntegerAttribute(p_ObjectName, "inactivityTimeOut"));
67         oForm.setPersistency(getStringAttribute(p_ObjectName, "persistency"));
68         oForm.setPoolSize(getIntegerAttribute(p_ObjectName, "poolSize"));
69         oForm.setShared(getBooleanAttribute(p_ObjectName, "shared"));
70         oForm.setPrefetch(getBooleanAttribute(p_ObjectName, "prefetch"));
71         oForm.setLockPolicy(getStringAttribute(p_ObjectName, "lockPolicy"));
72
73         Integer JavaDoc[] aiEntityCounters = (Integer JavaDoc[]) JonasManagementRepr.getAttribute(p_ObjectName
74             , "entityCounters");
75         oForm.setUsedInTxInstance(aiEntityCounters[0].intValue());
76         oForm.setUsedOutTxInstance(aiEntityCounters[1].intValue());
77         oForm.setUnusedInstance(aiEntityCounters[2].intValue());
78         oForm.setPassivatedInstance(aiEntityCounters[3].intValue());
79         oForm.setRemovedInstance(aiEntityCounters[4].intValue());
80     }
81
82     /**
83      * The global forward to go.
84      *
85      * @return Forward
86      */

87     protected String JavaDoc getEjbForward() {
88         return "Ejb Entity";
89     }
90 }
91
Popular Tags