001: /*
002: * JOnAS: Java(TM) Open Application Server
003: * Copyright (C) 1999 Bull S.A.
004: * Contact: jonas-team@objectweb.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id: EditEjbEntityAction.java 9680 2006-10-06 12:08:33Z danesa $
023: * --------------------------------------------------------------------------
024: */
025:
026: package org.objectweb.jonas.webapp.jonasadmin.service.ejb;
027:
028: import javax.management.ObjectName;
029:
030: import org.objectweb.jonas.jmx.JonasManagementRepr;
031:
032: /**
033: * @author Michel-Ange ANTON
034: */
035: public class EditEjbEntityAction extends EditEjbAction {
036:
037: // --------------------------------------------------------- Public Methods
038:
039: // --------------------------------------------------------- Protected Methods
040:
041: /**
042: * Return a <code>EjbEntityForm</code> instance associate to the EJB.
043: *
044: * @return A form instance
045: */
046: protected EjbForm getEjbForm() {
047: return new EjbEntityForm();
048: }
049:
050: /**
051: * Fill all infos of EJB Entity in the <code>EjbEntityForm</code> instance.
052: *
053: * @param p_Form Instance to fill
054: * @param p_ObjectName Instance to get infos
055: * @throws Exception
056: */
057: protected void fillEjbInfo(EjbForm p_Form, ObjectName p_ObjectName,
058: String serverName) throws Exception {
059: fillEjbGlobalInfo(p_Form, p_ObjectName);
060:
061: EjbEntityForm oForm = (EjbEntityForm) p_Form;
062: oForm.setPassivationTimeOut(getIntegerAttribute(p_ObjectName,
063: "passivationTimeOut"));
064: oForm.setInactivityTimeOut(getIntegerAttribute(p_ObjectName,
065: "inactivityTimeOut"));
066: oForm.setDeadlockTimeOut(getIntegerAttribute(p_ObjectName,
067: "deadlockTimeOut"));
068: oForm.setReadTimeOut(getIntegerAttribute(p_ObjectName,
069: "readTimeOut"));
070: oForm.setPersistency(getStringAttribute(p_ObjectName,
071: "persistency"));
072: oForm.setShared(getBooleanAttribute(p_ObjectName, "shared"));
073: oForm
074: .setPrefetch(getBooleanAttribute(p_ObjectName,
075: "prefetch"));
076: oForm.setHardLimit(getBooleanAttribute(p_ObjectName,
077: "hardLimit"));
078: oForm.setLockPolicy(getStringAttribute(p_ObjectName,
079: "lockPolicy"));
080:
081: Integer[] aiEntityCounters = (Integer[]) JonasManagementRepr
082: .getAttribute(p_ObjectName, "entityCounters",
083: serverName);
084: oForm.setUsedInTxInstance(aiEntityCounters[0].intValue());
085: oForm.setUsedOutTxInstance(aiEntityCounters[1].intValue());
086: oForm.setUnusedInstance(aiEntityCounters[2].intValue());
087: oForm.setPassivatedInstance(aiEntityCounters[3].intValue());
088: oForm.setRemovedInstance(aiEntityCounters[4].intValue());
089: oForm.setPkNumber(aiEntityCounters[5].intValue());
090: }
091:
092: /**
093: * The global forward to go.
094: *
095: * @return Forward
096: */
097: protected String getEjbForward() {
098: return "Ejb Entity";
099: }
100: }
|