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: ResourceAdapterAOForm.java 6648 2005-04-26 16:19:08Z ehardesty $
023: * --------------------------------------------------------------------------
024: */
025:
026: package org.objectweb.jonas.webapp.jonasadmin.service.resource;
027:
028: import java.net.URL;
029: import java.util.ArrayList;
030: import java.util.Collections;
031: import java.util.Enumeration;
032: import java.util.Iterator;
033: import java.util.List;
034: import java.util.Properties;
035:
036: import javax.management.ObjectName;
037:
038: import javax.servlet.http.HttpServletRequest;
039:
040: import org.apache.struts.action.ActionErrors;
041: import org.apache.struts.action.ActionForm;
042: import org.apache.struts.action.ActionMapping;
043: import org.objectweb.jonas.webapp.jonasadmin.Jlists;
044: import org.objectweb.jonas.webapp.jonasadmin.JonasAdminJmx;
045: import org.objectweb.jonas.webapp.jonasadmin.common.LabelValueByLabelComparator;
046: import org.objectweb.jonas.webapp.taglib.LabelValueBean;
047: import org.objectweb.jonas_rar.deployment.api.RequiredConfigPropertyDesc;
048:
049: /**
050: * @author Michel-Ange ANTON
051: */
052: public class ResourceAdapterAOForm extends ActionForm {
053:
054: // --------------------------------------------------------- Properties variables
055:
056: private String description = null;
057: private String name = null;
058: private ArrayList listProperties = new ArrayList();
059: private ObjectName oName = null;
060:
061: private ArrayList listUsedByMdb = new ArrayList();
062:
063: // --------------------------------------------------------- Public Methods
064:
065: public void reset(ActionMapping mapping, HttpServletRequest request) {
066: }
067:
068: public ActionErrors validate(ActionMapping mapping,
069: HttpServletRequest request) {
070: ActionErrors oErrors = new ActionErrors();
071: return oErrors;
072: }
073:
074: // --------------------------------------------------------- Properties Methods
075:
076: public String getDescription() {
077: return description;
078: }
079:
080: public void setDescription(String description) {
081: this .description = description;
082: }
083:
084: public String getName() {
085: return name;
086: }
087:
088: public void setName(String name) {
089: this .name = name;
090: }
091:
092: public ArrayList getListProperties() {
093: return listProperties;
094: }
095:
096: public void setListProperties(Properties properties) {
097: this .listProperties.clear();
098: // Fill list with properties (keys and values)
099: String sKey;
100: Enumeration oEnum = properties.keys();
101: while (oEnum.hasMoreElements()) {
102: sKey = oEnum.nextElement().toString();
103: this .listProperties.add(new LabelValueBean(sKey, properties
104: .getProperty(sKey, "")));
105: }
106: Collections.sort(this .listProperties,
107: new LabelValueByLabelComparator());
108: }
109:
110: public void setOName(ObjectName oName) {
111: this .oName = oName;
112: }
113:
114: public ObjectName getOName() {
115: return oName;
116: }
117:
118: public ArrayList getListUsedByMdb() {
119: return listUsedByMdb;
120: }
121:
122: public void setListUsedByMdb(ArrayList listUsedByMdb) {
123: this.listUsedByMdb = listUsedByMdb;
124: }
125:
126: }
|