1 20 package org.objectweb.modfact.corba.service; 21 22 import java.io.FileInputStream ; 23 import java.io.FileNotFoundException ; 24 import java.io.FileOutputStream ; 25 26 public class GenerationService 27 extends org.objectweb.modfact.corba.service.cmdline.common.ModfactApplicationBase 28 implements 29 org.objectweb.modfact.corba.service.cmdline.io.ImportApplication, 30 org.objectweb.modfact.corba.service.cmdline.io.ExportApplication { 31 32 33 private boolean idl = false; 34 35 36 private boolean java = false; 37 38 39 private boolean dtd = false; 40 41 42 private boolean xmiImport = false; 43 44 45 private boolean xmiExport = false; 46 47 48 private boolean server = false; 49 50 51 private boolean mappingValid = false; 52 53 54 private String input = null; 55 56 57 private String output = null; 58 59 62 public GenerationService() { 63 super( 64 new org.objectweb.util.cmdline.lib.DefaultCommandLine( 65 new String [] { "GenerationService" }, 66 new String [0], 67 new String [] { "Tool to manage the MOF Repository" }, 68 true)); 69 getCommandLine().addOption( 71 new org.objectweb.modfact.corba.service.cmdline.client.OptionIDL( 72 this)); 73 getCommandLine().addOption( 74 new org.objectweb.modfact.corba.service.cmdline.client.OptionJava( 75 this)); 76 getCommandLine().addOption( 77 new org.objectweb.modfact.corba.service.cmdline.client.OptionDTD( 78 this)); 79 getCommandLine().addOption( 80 new org 81 .objectweb 82 .modfact 83 .corba 84 .service 85 .cmdline 86 .client 87 .OptionXMIImport( 88 this)); 89 getCommandLine().addOption( 90 new org 91 .objectweb 92 .modfact 93 .corba 94 .service 95 .cmdline 96 .client 97 .OptionXMIExport( 98 this)); 99 getCommandLine().addOption( 100 new org 101 .objectweb 102 .modfact 103 .corba 104 .service 105 .cmdline 106 .client 107 .OptionServer( 108 this)); 109 getCommandLine().addOption( 110 new org 111 .objectweb 112 .modfact 113 .corba 114 .service 115 .cmdline 116 .client 117 .OptionIDLtoJavaMappingValid(this)); 118 getCommandLine().addOption( 119 new org.objectweb.modfact.corba.service.cmdline.io.OptionInput( 120 this)); 121 getCommandLine().addOption( 122 new org.objectweb.modfact.corba.service.cmdline.io.OptionOutput( 123 this)); 124 } 125 126 132 public void setDTD(boolean dtd) { 133 this.dtd = dtd; 134 } 135 136 142 public void setIDL(boolean idl) { 143 this.idl = idl; 144 } 145 146 152 public void setJava(boolean java) { 153 this.java = java; 154 } 155 156 162 public void setXMIImport(boolean xmiImport) { 163 this.xmiImport = xmiImport; 164 } 165 166 172 public void setXMIExport(boolean xmiExport) { 173 this.xmiExport = xmiExport; 174 } 175 176 182 public void setServer(boolean server) { 183 this.server = server; 184 } 185 186 193 public void setMappingValid(boolean mappingValid) { 194 this.mappingValid = mappingValid; 195 } 196 197 203 public void setOutput(String output) { 204 this.output = output; 205 } 206 207 213 public void setInputFile(String input) { 214 this.input = input; 215 } 216 217 223 public int start(String [] args) { 224 try { 225 Generation client = new Generation(); 226 client.execute( 227 idl, 228 dtd, 229 java, 230 xmiImport, 231 xmiExport, 232 server, 233 mappingValid, 234 new FileInputStream (input), 235 new FileOutputStream (output), 236 orb_); 237 return 0; 238 } catch (FileNotFoundException ex) { 239 report_exception(ex); 240 return -1; 241 } 242 } 243 244 250 public static void main(String [] args) { 251 GenerationService application = new GenerationService(); 252 application.runMain(args); 253 } 254 255 } 256 | Popular Tags |