KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_rar > deployment > api > Utility


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  *
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * 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 of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20  * USA
21  *
22  * Initial developer: Eric Hardesty
23  * --------------------------------------------------------------------------
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 JavaDoc;
30 import java.util.List JavaDoc;
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 classes
49  *
50  * @author Eric Hardesty
51  */

52
53 public class Utility {
54
55     /**
56      * Convert the list
57      * @return the updated list
58      */

59     public static List JavaDoc adminobject(List JavaDoc cp) {
60         
61         List JavaDoc conv = new JLinkedList("AdminobjectDesc");
62         for (Iterator JavaDoc i = cp.iterator(); i.hasNext(); ) {
63             conv.add(new AdminobjectDesc((Adminobject) i.next()));
64         }
65         return conv;
66     }
67
68     /**
69      * Convert the list
70      * @return the updated list
71      */

72     public static List JavaDoc authenticationMechanism(List JavaDoc am) {
73         List JavaDoc conv = new JLinkedList("AuthenticationMechanismDesc");
74         for (Iterator JavaDoc i = am.iterator(); i.hasNext(); ) {
75             conv.add(new AuthenticationMechanismDesc((AuthenticationMechanism) i.next()));
76         }
77         return conv;
78     }
79
80     /**
81      * Convert the list
82      * @return the updated list
83      */

84     public static List JavaDoc configProperty(List JavaDoc cp) {
85         
86         List JavaDoc conv = new JLinkedList("ConfigPropertyDesc");
87         for (Iterator JavaDoc i = cp.iterator(); i.hasNext(); ) {
88             conv.add(new ConfigPropertyDesc((ConfigProperty) i.next()));
89         }
90         return conv;
91     }
92
93     /**
94      * Convert the list
95      * @return the updated list
96      */

97     public static List JavaDoc connectionDefinition(List JavaDoc cd) {
98         List JavaDoc conv = new JLinkedList("ConnectionDefinitionDesc");
99         for (Iterator JavaDoc i = cd.iterator(); i.hasNext(); ) {
100             conv.add(new ConnectionDefinitionDesc((ConnectionDefinition) i.next()));
101         }
102         return conv;
103     }
104
105     /**
106      * Convert the list
107      * @return the updated list
108      */

109     public static List JavaDoc jonasActivationspec(List JavaDoc jas) {
110         List JavaDoc conv = new JLinkedList("JonasActivationspecDesc");
111         for (Iterator JavaDoc i = jas.iterator(); i.hasNext(); ) {
112             conv.add(new JonasActivationspecDesc((JonasActivationspec) i.next()));
113         }
114         return conv;
115     }
116
117     /**
118      * Convert the list
119      * @return the updated list
120      */

121     public static List JavaDoc jonasAdminobject(List JavaDoc jao) {
122         List JavaDoc conv = new JLinkedList("JonasAdminobjectDesc");
123         for (Iterator JavaDoc i = jao.iterator(); i.hasNext(); ) {
124             conv.add(new JonasAdminobjectDesc((JonasAdminobject) i.next()));
125         }
126         return conv;
127     }
128
129     /**
130      * Convert the list
131      * @return the updated list
132      */

133     public static List JavaDoc jonasConfigProperty(List JavaDoc jcp) {
134         List JavaDoc conv = new JLinkedList("JonasConfigPropertyDesc");
135         for (Iterator JavaDoc i = jcp.iterator(); i.hasNext(); ) {
136             conv.add(new JonasConfigPropertyDesc((JonasConfigProperty) i.next()));
137         }
138         return conv;
139     }
140
141     /**
142      * Convert the list
143      * @return the updated list
144      */

145     public static List JavaDoc jonasConnectionDefinition(List JavaDoc jcd) {
146         List JavaDoc conv = new JLinkedList("JonasConnectionDefinitionDesc");
147         for (Iterator JavaDoc i = jcd.iterator(); i.hasNext(); ) {
148             conv.add(new JonasConnectionDefinitionDesc((JonasConnectionDefinition) i.next()));
149         }
150         return conv;
151     }
152
153     /**
154      * Convert the list
155      * @return the updated list
156      */

157     public static List JavaDoc messagelistener(List JavaDoc ml) {
158         List JavaDoc conv = new JLinkedList("MessagelistenerDesc");
159         for (Iterator JavaDoc i = ml.iterator(); i.hasNext(); ) {
160             conv.add(new MessagelistenerDesc((Messagelistener) i.next()));
161         }
162         return conv;
163     }
164     /**
165      * Convert the list
166      * @return the updated list
167      */

168     public static List JavaDoc requiredConfigProperty(List JavaDoc rcp) {
169         
170         List JavaDoc conv = new JLinkedList("RequiredConfigPropertyDesc");
171         for (Iterator JavaDoc i = rcp.iterator(); i.hasNext(); ) {
172             conv.add(new RequiredConfigPropertyDesc((RequiredConfigProperty) i.next()));
173         }
174         return conv;
175     }
176
177     /**
178      * Convert the list
179      * @return the updated list
180      */

181     public static List JavaDoc securityPermission(List JavaDoc cp) {
182         
183         List JavaDoc conv = new JLinkedList("SecurityPermission");
184         for (Iterator JavaDoc i = cp.iterator(); i.hasNext(); ) {
185             conv.add(new SecurityPermissionDesc((SecurityPermission) i.next()));
186         }
187         return conv;
188     }
189
190     /**
191      * Convert the list
192      * @return the updated list
193      */

194     public static List JavaDoc tmConfigProperty(List JavaDoc cp) {
195         
196         List JavaDoc conv = new JLinkedList("TmConfigPropertyDesc");
197         for (Iterator JavaDoc i = cp.iterator(); i.hasNext(); ) {
198             conv.add(new TmConfigPropertyDesc((TmConfigProperty) i.next()));
199         }
200         return conv;
201     }
202
203 }
204
Popular Tags