1 26 27 package org.objectweb.openccm.command.lib; 28 29 import org.objectweb.util.cmdline.api.CommandLine; 31 import org.objectweb.openccm.command.lib.ReleaseInfo; 32 import org.objectweb.openccm.corba.TheORB; 33 34 44 45 public abstract class ApplicationBase 46 extends org.objectweb.util.cmdline.lib.ApplicationBase 47 implements org.objectweb.openccm.command.api.Application 48 { 49 55 61 62 public 63 ApplicationBase() 64 { 65 super(); 67 } 68 69 74 public 75 ApplicationBase(CommandLine commandLine) 76 { 77 super(commandLine); 79 } 80 81 87 93 100 public String 101 getIdentity() 102 { 103 return getCommandLine().getLabels()[0] 104 + ' ' + ReleaseInfo.VERSION; 105 } 106 107 113 118 public String [] 119 getVersionInformation() 120 { 121 String [] result = super.getVersionInformation(); 122 result[0] = ReleaseInfo.NAME_SHORT + ' ' 123 + getIdentity() 124 + " (on top of " 125 + System.getProperty("orb.name", "UNKNOWN") 126 + ' ' 127 + System.getProperty("orb.version", "X.X") 128 + ')'; 129 return result; 130 } 131 132 139 public void 140 runMain(String [] args) 141 { 142 try 143 { 144 args = TheORB.initialize(args); 146 } 147 catch(org.objectweb.util.misc.api.ExceptionWrapper exc) 150 { 151 report_exception(exc.getException()); 152 } 153 catch(Exception exc) 154 { 155 report_exception(exc); 156 } 157 158 super.runMain(args); 160 } 161 162 169 public int 170 start(String [] args) 171 { 172 int status = 0; 173 174 try 175 { 176 status = run(args); 178 } 179 finally 180 { 181 TheORB.destroy(); 183 } 184 185 return status; 186 } 187 188 194 206 public abstract int 207 run(String [] args); 208 } 209 | Popular Tags |