KickJava   Java API By Example, From Geeks To Geeks.

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


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: EjbSessionForm.java,v 1.5 2005/01/04 14:38:19 danesa Exp $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.jonas.webapp.jonasadmin.service.ejb;
27
28
29 import javax.servlet.http.HttpServletRequest JavaDoc;
30
31 import org.apache.struts.action.ActionErrors;
32 import org.apache.struts.action.ActionMapping;
33
34 /**
35  * @author Michel-Ange ANTON
36  */

37 public class EjbSessionForm extends EjbForm {
38 // --------------------------------------------------------- Default for session time out
39
public static final String JavaDoc SESSION_TIME_OUT_DEFAULT = "0";
40
41 // --------------------------------------------------------- Properties Variables
42

43     /**
44      * MBean Ejb Session properties
45      */

46     private String JavaDoc sessionTimeOut = SESSION_TIME_OUT_DEFAULT;
47 // --------------------------------------------------------- Public Methods
48

49     /**
50      * Reset all properties to their default values.
51      *
52      * @param mapping The mapping used to select this instance
53      * @param request The servlet request we are processing
54      */

55
56     public void reset(ActionMapping mapping, HttpServletRequest JavaDoc request) {
57         super.reset(mapping, request);
58         sessionTimeOut = SESSION_TIME_OUT_DEFAULT;
59         this.setAction("apply");
60     }
61
62    // --------------------------------------------------------- Properties Methods
63

64     public String JavaDoc getSessionTimeOut() {
65         return sessionTimeOut;
66     }
67
68     public void setSessionTimeOut(String JavaDoc sessionTimeOut) {
69         this.sessionTimeOut = sessionTimeOut;
70     }
71
72     /**
73      * Validate the properties that have been set from this HTTP request,
74      * and return an <code>ActionErrors</code> object that encapsulates any
75      * validation errors that have been found. If no errors are found, return
76      * <code>null</code> or an <code>ActionErrors</code> object with no
77      * recorded error messages.
78      *
79      * @param mapping The mapping used to select this instance
80      * @param request The servlet request we are processing
81      * @return List of errors or null
82      */

83     public ActionErrors validate(ActionMapping mapping, HttpServletRequest JavaDoc request) {
84         ActionErrors errors = new ActionErrors();
85         numberCheck(errors, "sessionTimeOut", sessionTimeOut, true, 0, Integer.MAX_VALUE);
86         return errors;
87     }
88
89
90
91 }
92
Popular Tags