1 26 27 package org.objectweb.openccm.command.lib; 28 29 import org.objectweb.util.cmdline.api.CommandLine; 31 import org.objectweb.openccm.corba.TheORB; 32 import org.objectweb.openccm.corba.TheRootPOA; 33 34 44 45 public abstract class ApplicationServerBase 46 extends ApplicationBase 47 implements org.objectweb.openccm.command.api.ApplicationServer 48 { 49 55 61 62 public 63 ApplicationServerBase() 64 { 65 super(); 67 } 68 69 74 public 75 ApplicationServerBase(CommandLine commandLine) 76 { 77 super(commandLine); 79 } 80 81 87 93 99 111 public int 112 run(String [] args) 113 { 114 org.omg.PortableServer.POA rootPOA = TheRootPOA.getRootPOA(); 116 117 try 119 { 120 rootPOA.the_POAManager().activate(); 121 } 122 catch(org.omg.PortableServer.POAManagerPackage.AdapterInactive exc) 123 { 124 throw new org.objectweb.openccm.corba.UserExceptionWrapper(exc); 126 } 127 128 int status = before_run(args); 130 131 if(status != 0) 132 { 133 return status; 134 } 135 136 TheORB.run(); 138 139 getConsole().message("Shutdown completed."); 140 141 try 142 { 143 after_run(); 145 } 146 catch(Exception exc) 147 { 148 } 149 150 return 0; 151 } 152 153 159 168 public abstract int 169 before_run(String [] args); 170 171 176 public abstract void 177 after_run(); 178 } 179 | Popular Tags |