01: /**
02: * JOnAS: Java(TM) Open Application Server
03: * Copyright (C) 1999 Bull S.A.
04: * Contact: jonas-team@objectweb.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * 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: EditEjbSessionAction.java 9680 2006-10-06 12:08:33Z danesa $
23: * --------------------------------------------------------------------------
24: */package org.objectweb.jonas.webapp.jonasadmin.service.ejb;
25:
26: import javax.management.ObjectName;
27: import javax.servlet.http.HttpServletRequest;
28: import javax.servlet.http.HttpServletResponse;
29:
30: import org.apache.struts.action.ActionForm;
31: import org.apache.struts.action.ActionForward;
32: import org.apache.struts.action.ActionMapping;
33: import org.apache.struts.action.ActionMessage;
34: import org.apache.struts.action.ActionMessages;
35:
36: /**
37: * @author Michel-Ange ANTON
38: */
39: public class EditEjbSessionAction extends EditEjbAction {
40:
41: // --------------------------------------------------------- Public Methods
42:
43: public ActionForward executeAction(ActionMapping pMapping,
44: ActionForm pForm, HttpServletRequest pRequest,
45: HttpServletResponse pResponse) {
46: ActionMessages messages = new ActionMessages();
47: ActionMessage msg = new ActionMessage(
48: "default.ejb.type.session.sessionTimeOut");
49: messages.add("defaultSessionTimeOut", msg);
50: saveMessages(pRequest, messages);
51: return super
52: .executeAction(pMapping, pForm, pRequest, pResponse);
53: }
54:
55: // --------------------------------------------------------- Protected Methods
56:
57: /**
58: * Return a <code>EjbSessionForm</code> instance associate to the EJB.
59: *
60: * @return A form instance
61: */
62: protected EjbForm getEjbForm() {
63: return new EjbSessionForm();
64: }
65:
66: /**
67: * Fill all infos of EJB Session in the <code>EjbSessionForm</code> instance.
68: *
69: * @param p_Form Instance to fill
70: * @param p_ObjectName Instance to get infos
71: * @throws Exception
72: */
73: protected void fillEjbInfo(EjbForm p_Form, ObjectName p_ObjectName,
74: String serverName) throws Exception {
75: fillEjbGlobalInfo(p_Form, p_ObjectName);
76:
77: EjbSessionForm oForm = (EjbSessionForm) p_Form;
78: String sessionTimeOut = toStringIntegerAttribute(p_ObjectName,
79: "sessionTimeOut");
80: oForm.setSessionTimeOut(sessionTimeOut);
81: }
82:
83: /**
84: * The global forward to go.
85: *
86: * @return Forward
87: */
88: protected String getEjbForward() {
89: return "Ejb Session";
90: }
91: }
|