1 25 26 27 package org.objectweb.jonas_lib.genclientstub.modifier; 28 29 import java.io.File ; 30 import java.util.Iterator ; 31 import java.util.List ; 32 33 import org.objectweb.jonas_lib.deployment.api.EjbRefDesc; 34 import org.objectweb.jonas_lib.genbase.GenBaseException; 35 import org.objectweb.jonas_lib.genbase.archive.Archive; 36 import org.objectweb.jonas_lib.genbase.archive.WebApp; 37 import org.objectweb.jonas_lib.genclientstub.generator.Generator; 38 import org.objectweb.jonas_lib.genclientstub.generator.GeneratorFactory; 39 40 import org.objectweb.util.monolog.api.BasicLevel; 41 42 47 public class WebAppModifier extends AbsArchiveModifier { 48 49 50 private WebApp web; 51 52 58 public WebAppModifier(WebApp webapp) { 59 super(webapp); 60 web = webapp; 61 } 62 63 71 public Archive modify() throws GenBaseException { 72 73 getLogger().log(BasicLevel.INFO, "Processing WebApp " + web.getName()); 74 75 GeneratorFactory gf = GeneratorFactory.getInstance(); 76 77 generateFoundStubs(gf.getConfiguration(), web); 79 80 List ejbRefs = web.getEjbRefDescs(); 82 for (Iterator j = ejbRefs.iterator(); j.hasNext();) { 83 EjbRefDesc ejbRef = (EjbRefDesc) j.next(); 84 85 Generator g = new Generator(gf.getConfiguration(), ejbRef, null, web); 87 g.generate(); 88 g.compile(); 89 g.addFiles(web); 91 } 92 93 return save(gf.getConfiguration(), "webapps" + File.separator 94 + web.getName()); 95 } 96 } | Popular Tags |