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.Client; 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 ClientModifier extends AbsArchiveModifier { 48 49 50 private Client client; 51 52 57 public ClientModifier(Client client) { 58 super(client); 59 this.client = client; 60 } 61 62 69 public Archive modify() throws GenBaseException { 70 71 getLogger().log(BasicLevel.INFO, "Processing Client " + client.getName()); 72 73 GeneratorFactory gf = GeneratorFactory.getInstance(); 74 75 76 generateFoundStubs(gf.getConfiguration(), client); 78 79 80 81 List ejbRefs = client.getEjbRefDescs(); 83 for (Iterator j = ejbRefs.iterator(); j.hasNext();) { 84 EjbRefDesc ejbRef = (EjbRefDesc) j.next(); 85 86 Generator g = new Generator(gf.getConfiguration(), ejbRef, null, client); 88 g.generate(); 89 g.compile(); 90 g.addFiles(client); 92 } 93 94 return save(gf.getConfiguration(), "clients" + File.separator + client.getRootFile().getName()); 95 } 96 } | Popular Tags |