01: /**
02: * JOnAS: Java(TM) Open Application Server
03: * Copyright (C) 2004 Bull S.A.
04: * Contact: jonas-team@objectweb.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * 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 5590 2004-10-11 13:16:15Z benoitf $
23: * --------------------------------------------------------------------------
24: */package org.objectweb.jonas_lib.genclientstub.modifier;
25:
26: import java.util.Iterator;
27:
28: import org.objectweb.jonas_lib.genbase.archive.Application;
29: import org.objectweb.jonas_lib.genbase.archive.Client;
30: import org.objectweb.jonas_lib.genbase.archive.EjbJar;
31: import org.objectweb.jonas_lib.genbase.archive.WebApp;
32: import org.objectweb.jonas_lib.genbase.modifier.AbsApplicationModifier;
33: import org.objectweb.jonas_lib.genclientstub.generator.GeneratorFactory;
34:
35: /**
36: * Modify a given Application.
37: * (code from WsGen)
38: * @author Florent Benoit
39: */
40: public class ApplicationModifier extends AbsApplicationModifier {
41:
42: /**
43: * Creates a new ApplicationModifier.
44: *
45: * @param archive the Application J2EE archive
46: */
47: public ApplicationModifier(Application archive) {
48: super (archive, GeneratorFactory.getInstance()
49: .getConfiguration());
50: }
51:
52: /**
53: * initialize modifier
54: */
55: protected void init() {
56:
57: // fill ejbjar list
58: for (Iterator i = getApplication().getEjbJars(); i.hasNext();) {
59: EjbJar ejbjar = (EjbJar) i.next();
60: getEjbModifiers().add(new EjbJarModifier(ejbjar));
61: }
62:
63: // fill webapp list
64: for (Iterator i = getApplication().getWebApps(); i.hasNext();) {
65: WebApp webapp = (WebApp) i.next();
66: getWebModifiers().add(new WebAppModifier(webapp));
67: }
68:
69: // fill client list
70: for (Iterator i = getApplication().getClients(); i.hasNext();) {
71: Client client = (Client) i.next();
72: getCltModifiers().add(new ClientModifier(client));
73: }
74: }
75:
76: }
|