KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_lib > genclientstub > modifier > ApplicationModifier


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 2004 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: ApplicationModifier.java,v 1.1 2004/10/11 13:16:15 benoitf Exp $
23  * --------------------------------------------------------------------------
24  */

25
26
27 package org.objectweb.jonas_lib.genclientstub.modifier;
28
29 import java.util.Iterator JavaDoc;
30
31 import org.objectweb.jonas_lib.genbase.archive.Application;
32 import org.objectweb.jonas_lib.genbase.archive.Client;
33 import org.objectweb.jonas_lib.genbase.archive.EjbJar;
34 import org.objectweb.jonas_lib.genbase.archive.WebApp;
35 import org.objectweb.jonas_lib.genbase.modifier.AbsApplicationModifier;
36 import org.objectweb.jonas_lib.genclientstub.generator.GeneratorFactory;
37
38 /**
39  * Modify a given Application.
40  * (code from WsGen)
41  * @author Florent Benoit
42  */

43 public class ApplicationModifier extends AbsApplicationModifier {
44
45     /**
46      * Creates a new ApplicationModifier.
47      *
48      * @param archive the Application J2EE archive
49      */

50     public ApplicationModifier(Application archive) {
51         super(archive, GeneratorFactory.getInstance().getConfiguration());
52     }
53
54     /**
55      * initialize modifier
56      */

57     protected void init() {
58
59         // fill ejbjar list
60
for (Iterator JavaDoc i = getApplication().getEjbJars(); i.hasNext();) {
61             EjbJar ejbjar = (EjbJar) i.next();
62             getEjbModifiers().add(new EjbJarModifier(ejbjar));
63         }
64
65         // fill webapp list
66
for (Iterator JavaDoc i = getApplication().getWebApps(); i.hasNext();) {
67             WebApp webapp = (WebApp) i.next();
68             getWebModifiers().add(new WebAppModifier(webapp));
69         }
70
71         // fill client list
72
for (Iterator JavaDoc i = getApplication().getClients(); i.hasNext();) {
73             Client client = (Client) i.next();
74             getCltModifiers().add(new ClientModifier(client));
75         }
76     }
77
78 }
Popular Tags