1 20 21 package org.objectweb.modfact.corba.service.cmdline.common; 22 23 26 public abstract class ModfactApplicationBase 27 extends org.objectweb.util.cmdline.lib.ApplicationBase { 28 29 30 protected org.omg.CORBA.ORB orb_; 31 32 36 protected ModfactApplicationBase(org.objectweb.util.cmdline.lib.DefaultCommandLine commandLine) { 37 super(commandLine, false); 38 getCommandLine().addOption(new OptionQuiet()); 39 } 40 41 45 public String getMailingList() { 46 return "modfact@lip6.fr"; 47 } 48 49 54 public String [] getVersionInformation() { 55 return new String [] { 56 getIdentity(), 57 "", 58 "Copyright (C) 2000-2003 Laboratoire d'Informatique Paris 6 (LIP6)", 59 "Contact: " + getMailingList(), 60 "", 61 "ModFact is free software; you can redistribute it and/or", 62 "modify it under the terms of the GNU Lesser General Public", 63 "License as published by the Free Software Foundation; either", 64 "version 2 of the License, or any later version.", 65 "", 66 "ModFact is distributed in the hope that it will be useful,", 67 "but WITHOUT ANY WARRANTY; without even the implied warranty of", 68 "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU", 69 "Lesser General Public License for more details.", 70 "", 71 "You should have received a copy of the GNU Lesser General Public", 72 "License along with this library; if not, write to the Free Software", 73 "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA" }; 74 } 75 76 82 public void runMain(String [] args) { 83 try { 84 orb_ = org.omg.CORBA.ORB.init(args, System.getProperties()); 87 } catch (org.objectweb.util.api.ExceptionWrapper exc) { 88 report_exception(exc.getException()); 89 } catch (java.lang.Exception exc) { 90 report_exception(exc); 91 } 92 super.runMain(removeORBArgument(args)); 94 } 95 96 101 private String [] removeORBArgument(String [] args) { 102 int nb = 0; 103 String [] tmp = new String [args.length]; 104 for (int i = 0; i < args.length; i++) { 105 if (!args[i].startsWith("-ORB")) { 106 tmp[nb] = args[i]; 107 nb++; 108 } else { 109 if (args[i].startsWith("-ORBInitRef")) 110 i++; 111 i++; 112 } 113 } 114 String [] tmp2 = new String [nb]; 115 for (int i = 0; i < nb; i++) 116 tmp2[i] = tmp[i]; 117 return tmp2; 118 } 119 120 } 121 | Popular Tags |