1 22 package org.jboss.ejb3.test; 23 24 import java.io.File ; 25 import java.io.FileOutputStream ; 26 import java.io.PrintStream ; 27 import java.io.PrintWriter ; 28 29 35 public class SessionBeanGenerator 36 { 37 public static void main(String [] args) throws Exception 38 { 39 File intf = new File ("BigInterface.java"); 40 File bean = new File ("BigBean.java"); 41 FileOutputStream intfFp = new FileOutputStream (intf); 42 FileOutputStream beanFp = new FileOutputStream (bean); 43 PrintWriter intfWriter = new PrintWriter (intfFp); 44 PrintWriter beanWriter = new PrintWriter (beanFp); 45 46 intfWriter.println("package org.jboss.tutorial.simple;"); 47 intfWriter.println(); 48 intfWriter.println("public interface BigInterface"); 49 intfWriter.println("{"); 50 51 beanWriter.println("package org.jboss.tutorial.simple;"); 52 beanWriter.println(); 53 beanWriter.println("import javax.ejb.Stateless;"); 54 beanWriter.println(); 55 beanWriter.println("@Stateless"); 56 beanWriter.println("public class BigBean implements BigInterface"); 57 beanWriter.println("{"); 58 59 for (int i = 0; i < 100; i++) 60 { 61 String methodSignature = " public void method" + i + "(String param)"; 62 intfWriter.println(methodSignature + ";"); 63 beanWriter.println(methodSignature + " {}"); 64 } 65 66 beanWriter.println("}"); 67 intfWriter.println("}"); 68 beanWriter.flush(); 69 intfWriter.flush(); 70 intfFp.close(); 71 beanFp.close(); 72 } 73 } 74 | Popular Tags |