1 /**2 * JOnAS: Java(TM) Open Application Server3 * Copyright (C) 1999 Bull S.A. 4 * Contact: jonas-team@objectweb.org5 * 6 * This library is free software; you can redistribute it and/or7 *8 * modify it under the terms of the GNU Lesser General Public9 * License as published by the Free Software Foundation; either10 * version 2.1 of the License, or 1any later version.11 * 12 * This library is distributed in the hope that it will be useful,13 * but WITHOUT ANY WARRANTY; without even the implied warranty of14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU15 * Lesser General Public License for more details.16 * 17 * You should have received a copy of the GNU Lesser General Public18 * License along with this library; if not, write to the Free Software19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-130720 * USA21 *22 * Initial developer: Eric Hardesty23 * --------------------------------------------------------------------------24 * $Id: Utility.java,v 1.3 2005/04/14 20:20:21 ehardesty Exp $25 * --------------------------------------------------------------------------26 */27 package org.objectweb.jonas_rar.deployment.api;28 29 import java.util.Iterator ;30 import java.util.List ;31 32 import org.objectweb.jonas_rar.deployment.xml.Adminobject;33 import org.objectweb.jonas_rar.deployment.xml.AuthenticationMechanism;34 import org.objectweb.jonas_rar.deployment.xml.ConfigProperty;35 import org.objectweb.jonas_rar.deployment.xml.ConnectionDefinition;36 import org.objectweb.jonas_rar.deployment.xml.JonasActivationspec;37 import org.objectweb.jonas_rar.deployment.xml.JonasAdminobject;38 import org.objectweb.jonas_rar.deployment.xml.JonasConfigProperty;39 import org.objectweb.jonas_rar.deployment.xml.JonasConnectionDefinition;40 import org.objectweb.jonas_rar.deployment.xml.Messagelistener;41 import org.objectweb.jonas_rar.deployment.xml.RequiredConfigProperty;42 import org.objectweb.jonas_rar.deployment.xml.SecurityPermission;43 import org.objectweb.jonas_rar.deployment.xml.TmConfigProperty;44 45 import org.objectweb.jonas_lib.deployment.xml.JLinkedList;46 47 /** 48 * This class is a utility class for the rar api deployment classes49 * 50 * @author Eric Hardesty51 */52 53 public class Utility {54 55 /** 56 * Convert the list57 * @return the updated list58 */59 public static List adminobject(List cp) {60 61 List conv = new JLinkedList("AdminobjectDesc");62 for (Iterator i = cp.iterator(); i.hasNext(); ) {63 conv.add(new AdminobjectDesc((Adminobject) i.next()));64 }65 return conv;66 }67 68 /** 69 * Convert the list70 * @return the updated list71 */72 public static List authenticationMechanism(List am) {73 List conv = new JLinkedList("AuthenticationMechanismDesc");74 for (Iterator i = am.iterator(); i.hasNext(); ) {75 conv.add(new AuthenticationMechanismDesc((AuthenticationMechanism) i.next()));76 }77 return conv;78 }79 80 /** 81 * Convert the list82 * @return the updated list83 */84 public static List configProperty(List cp) {85 86 List conv = new JLinkedList("ConfigPropertyDesc");87 for (Iterator i = cp.iterator(); i.hasNext(); ) {88 conv.add(new ConfigPropertyDesc((ConfigProperty) i.next()));89 }90 return conv;91 }92 93 /** 94 * Convert the list95 * @return the updated list96 */97 public static List connectionDefinition(List cd) {98 List conv = new JLinkedList("ConnectionDefinitionDesc");99 for (Iterator i = cd.iterator(); i.hasNext(); ) {100 conv.add(new ConnectionDefinitionDesc((ConnectionDefinition) i.next()));101 }102 return conv;103 }104 105 /** 106 * Convert the list107 * @return the updated list108 */109 public static List jonasActivationspec(List jas) {110 List conv = new JLinkedList("JonasActivationspecDesc");111 for (Iterator i = jas.iterator(); i.hasNext(); ) {112 conv.add(new JonasActivationspecDesc((JonasActivationspec) i.next()));113 }114 return conv;115 }116 117 /** 118 * Convert the list119 * @return the updated list120 */121 public static List jonasAdminobject(List jao) {122 List conv = new JLinkedList("JonasAdminobjectDesc");123 for (Iterator i = jao.iterator(); i.hasNext(); ) {124 conv.add(new JonasAdminobjectDesc((JonasAdminobject) i.next()));125 }126 return conv;127 }128 129 /** 130 * Convert the list131 * @return the updated list132 */133 public static List jonasConfigProperty(List jcp) {134 List conv = new JLinkedList("JonasConfigPropertyDesc");135 for (Iterator i = jcp.iterator(); i.hasNext(); ) {136 conv.add(new JonasConfigPropertyDesc((JonasConfigProperty) i.next()));137 }138 return conv;139 }140 141 /** 142 * Convert the list143 * @return the updated list144 */145 public static List jonasConnectionDefinition(List jcd) {146 List conv = new JLinkedList("JonasConnectionDefinitionDesc");147 for (Iterator i = jcd.iterator(); i.hasNext(); ) {148 conv.add(new JonasConnectionDefinitionDesc((JonasConnectionDefinition) i.next()));149 }150 return conv;151 }152 153 /** 154 * Convert the list155 * @return the updated list156 */157 public static List messagelistener(List ml) {158 List conv = new JLinkedList("MessagelistenerDesc");159 for (Iterator i = ml.iterator(); i.hasNext(); ) {160 conv.add(new MessagelistenerDesc((Messagelistener) i.next()));161 }162 return conv;163 }164 /** 165 * Convert the list166 * @return the updated list167 */168 public static List requiredConfigProperty(List rcp) {169 170 List conv = new JLinkedList("RequiredConfigPropertyDesc");171 for (Iterator i = rcp.iterator(); i.hasNext(); ) {172 conv.add(new RequiredConfigPropertyDesc((RequiredConfigProperty) i.next()));173 }174 return conv;175 }176 177 /** 178 * Convert the list179 * @return the updated list180 */181 public static List securityPermission(List cp) {182 183 List conv = new JLinkedList("SecurityPermission");184 for (Iterator i = cp.iterator(); i.hasNext(); ) {185 conv.add(new SecurityPermissionDesc((SecurityPermission) i.next()));186 }187 return conv;188 }189 190 /** 191 * Convert the list192 * @return the updated list193 */194 public static List tmConfigProperty(List cp) {195 196 List conv = new JLinkedList("TmConfigPropertyDesc");197 for (Iterator i = cp.iterator(); i.hasNext(); ) {198 conv.add(new TmConfigPropertyDesc((TmConfigProperty) i.next()));199 }200 return conv;201 }202 203 }204