KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_ws > wsgen > modifier > ApplicationModifier


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 2003-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.5 2004/10/11 13:16:14 benoitf Exp $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.jonas_ws.wsgen.modifier;
27
28 import java.util.Iterator JavaDoc;
29
30 import org.objectweb.jonas_lib.genbase.archive.Application;
31 import org.objectweb.jonas_lib.genbase.archive.Client;
32 import org.objectweb.jonas_lib.genbase.archive.EjbJar;
33 import org.objectweb.jonas_lib.genbase.archive.WebApp;
34 import org.objectweb.jonas_lib.genbase.modifier.AbsApplicationModifier;
35
36
37 import org.objectweb.jonas_ws.wsgen.WsGenException;
38 import org.objectweb.jonas_ws.wsgen.generator.GeneratorFactory;
39
40 /**
41  * Modify a given Application.
42  * @author Guillaume Sauthier
43  */

44 public class ApplicationModifier extends AbsApplicationModifier {
45
46     /**
47      * Creates a new ApplicationModifier.
48      * @param archive the Application J2EE archive
49      * @throws WsGenException if the application modifier cannot be built
50      */

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

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