KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > modfact > jmi > service > GenerationService


1 /**
2  * copyright 2002 2004 Laboratoire d'Informatique Paris 6 (LIP6)
3  *
4  * This file is part of ModFact.
5  *
6  * ModFact is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * at your option) any later version.
10  *
11  * ModFact 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
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with ModFact; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  */

20 package org.objectweb.modfact.jmi.service;
21
22
23 public class GenerationService
24     extends org.objectweb.modfact.jmi.service.cmdline.xmiio.ImportApplication {
25
26     /** The API Zip file. */
27     private String JavaDoc apiFile = null;
28
29     /** The Impl Zip file. */
30     private String JavaDoc implFile = null;
31
32     /** The XMI Import Zip file. */
33     private String JavaDoc importFile = null;
34
35     /** The XMI Export Zip file. */
36     private String JavaDoc exportFile = null;
37
38
39     /**
40      * Constructor of a GenerationService.
41      */

42     public GenerationService() {
43         super(
44             new org.objectweb.util.cmdline.lib.DefaultCommandLine(
45                 new String JavaDoc[] { "GenerationService" },
46                 new String JavaDoc[0],
47                 new String JavaDoc[] { "Tool to manage the MOF Repository" },
48                 true));
49         // Creates the GenerationService options
50
getCommandLine().addOption(
51             new org.objectweb.modfact.jmi.service.cmdline.client.OptionApi(this));
52         getCommandLine().addOption(
53             new org.objectweb.modfact.jmi.service.cmdline.client.OptionImpl(this));
54         getCommandLine().addOption(
55             new org.objectweb.modfact.jmi.service.cmdline.client.OptionImport(this));
56         getCommandLine().addOption(
57             new org.objectweb.modfact.jmi.service.cmdline.client.OptionExport(this));
58     }
59
60     /**
61      * Starts the main function.
62      *
63      * @param args
64      * The command line arguments.
65      */

66     public int start(String JavaDoc[] args) {
67         try {
68             Generation client = new Generation();
69             client.execute(metaModelFile, apiFile, implFile, importFile, exportFile);
70             return 0;
71         } catch (Exception JavaDoc ex) {
72             report_exception(ex);
73             return -1;
74         }
75     }
76
77     /**
78      * The main method.
79      *
80      * @param args
81      * The command line arguments.
82      */

83     public static void main(String JavaDoc[] args) {
84         GenerationService application = new GenerationService();
85         application.runMain(args);
86     }
87         
88
89     /**
90      * Sets the apiFile.
91      * @param apiFile The apiFile to set
92      */

93     public void setApiFile(String JavaDoc apiFile) {
94         this.apiFile = apiFile;
95     }
96
97     /**
98      * Sets the exportFile.
99      * @param exportFile The exportFile to set
100      */

101     public void setExportFile(String JavaDoc exportFile) {
102         this.exportFile = exportFile;
103     }
104
105     /**
106      * Sets the implFile.
107      * @param implFile The implFile to set
108      */

109     public void setImplFile(String JavaDoc implFile) {
110         this.implFile = implFile;
111     }
112
113     /**
114      * Sets the importFile.
115      * @param importFile The importFile to set
116      */

117     public void setImportFile(String JavaDoc importFile) {
118         this.importFile = importFile;
119     }
120
121 }
122
123
124
Popular Tags