1. package com.sun.corba.se.PortableActivationIDL;
  2. /**
  3. * com/sun/corba/se/PortableActivationIDL/_ServerManagerImplBase.java .
  4. * Generated by the IDL-to-Java compiler (portable), version "3.2"
  5. * from ../../../../src/share/classes/com/sun/corba/se/PortableActivationIDL/activation.idl
  6. * Wednesday, September 15, 2004 3:50:44 AM PDT
  7. */
  8. /** Interface used to combine the Activator and Locator when both are
  9. * implemented together in the same process, as is currently the case
  10. * for our implementation.
  11. */
  12. public abstract class _ServerManagerImplBase extends org.omg.CORBA.portable.ObjectImpl
  13. implements com.sun.corba.se.PortableActivationIDL.ServerManager, org.omg.CORBA.portable.InvokeHandler
  14. {
  15. // Constructors
  16. public _ServerManagerImplBase ()
  17. {
  18. }
  19. private static java.util.Hashtable _methods = new java.util.Hashtable ();
  20. static
  21. {
  22. _methods.put ("registerServer", new java.lang.Integer (0));
  23. _methods.put ("serverGoingDown", new java.lang.Integer (1));
  24. _methods.put ("registerORB", new java.lang.Integer (2));
  25. _methods.put ("registerPOA", new java.lang.Integer (3));
  26. _methods.put ("poaDestroyed", new java.lang.Integer (4));
  27. _methods.put ("activate", new java.lang.Integer (5));
  28. _methods.put ("shutdown", new java.lang.Integer (6));
  29. _methods.put ("install", new java.lang.Integer (7));
  30. _methods.put ("uninstall", new java.lang.Integer (8));
  31. _methods.put ("getActiveServers", new java.lang.Integer (9));
  32. _methods.put ("getORBNames", new java.lang.Integer (10));
  33. _methods.put ("lookupPOATemplate", new java.lang.Integer (11));
  34. _methods.put ("locateServer", new java.lang.Integer (12));
  35. _methods.put ("locateServerForORB", new java.lang.Integer (13));
  36. _methods.put ("getEndpoint", new java.lang.Integer (14));
  37. _methods.put ("getServerPortForType", new java.lang.Integer (15));
  38. }
  39. public org.omg.CORBA.portable.OutputStream _invoke (String $method,
  40. org.omg.CORBA.portable.InputStream in,
  41. org.omg.CORBA.portable.ResponseHandler $rh)
  42. {
  43. org.omg.CORBA.portable.OutputStream out = null;
  44. java.lang.Integer __method = (java.lang.Integer)_methods.get ($method);
  45. if (__method == null)
  46. throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
  47. switch (__method.intValue ())
  48. {
  49. /** A new ORB started server registers itself with the Activator
  50. */
  51. case 0: // PortableActivationIDL/Activator/registerServer
  52. {
  53. try {
  54. String serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
  55. com.sun.corba.se.PortableActivationIDL.ServerProxy serverObj = com.sun.corba.se.PortableActivationIDL.ServerProxyHelper.read (in);
  56. this.registerServer (serverId, serverObj);
  57. out = $rh.createReply();
  58. } catch (com.sun.corba.se.PortableActivationIDL.ServerNotRegistered $ex) {
  59. out = $rh.createExceptionReply ();
  60. com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
  61. }
  62. break;
  63. }
  64. /** A server is shutting down that was started by this activator.
  65. * Complete termination of the server is detected by the death of the
  66. * process implementing the server.
  67. */
  68. case 1: // PortableActivationIDL/Activator/serverGoingDown
  69. {
  70. String serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
  71. this.serverGoingDown (serverId);
  72. out = $rh.createReply();
  73. break;
  74. }
  75. /** Called whenever an ORB instance is created. This registers
  76. * the transport endpoints and the ORB proxy callback object.
  77. * Note that we cannot detect when an ORB shuts down, although
  78. * all of the POA shutdowns should still be reported.
  79. */
  80. case 2: // PortableActivationIDL/Activator/registerORB
  81. {
  82. try {
  83. String serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
  84. String orbId = org.omg.PortableInterceptor.ORBIdHelper.read (in);
  85. com.sun.corba.se.PortableActivationIDL.ORBProxy orb = com.sun.corba.se.PortableActivationIDL.ORBProxyHelper.read (in);
  86. com.sun.corba.se.PortableActivationIDL.EndPointInfo endPointInfo[] = com.sun.corba.se.PortableActivationIDL.EndpointInfoListHelper.read (in);
  87. this.registerORB (serverId, orbId, orb, endPointInfo);
  88. out = $rh.createReply();
  89. } catch (com.sun.corba.se.PortableActivationIDL.ServerNotRegistered $ex) {
  90. out = $rh.createExceptionReply ();
  91. com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
  92. } catch (com.sun.corba.se.PortableActivationIDL.NoSuchEndPoint $ex) {
  93. out = $rh.createExceptionReply ();
  94. com.sun.corba.se.PortableActivationIDL.NoSuchEndPointHelper.write (out, $ex);
  95. } catch (com.sun.corba.se.PortableActivationIDL.ORBAlreadyRegistered $ex) {
  96. out = $rh.createExceptionReply ();
  97. com.sun.corba.se.PortableActivationIDL.ORBAlreadyRegisteredHelper.write (out, $ex);
  98. }
  99. break;
  100. }
  101. /** Construct or find an ORBD object template corresponding to the
  102. * server's object template and return it. Called whenever a
  103. * persistent POA is created.
  104. */
  105. case 3: // PortableActivationIDL/Activator/registerPOA
  106. {
  107. String serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
  108. String orbId = org.omg.PortableInterceptor.ORBIdHelper.read (in);
  109. org.omg.PortableInterceptor.ObjectReferenceTemplate poaTemplate = org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.read (in);
  110. org.omg.PortableInterceptor.ObjectReferenceTemplate $result = null;
  111. $result = this.registerPOA (serverId, orbId, poaTemplate);
  112. out = $rh.createReply();
  113. org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.write (out, $result);
  114. break;
  115. }
  116. /** Called whenever a POA is destroyed.
  117. */
  118. case 4: // PortableActivationIDL/Activator/poaDestroyed
  119. {
  120. String serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
  121. String orbId = org.omg.PortableInterceptor.ORBIdHelper.read (in);
  122. org.omg.PortableInterceptor.ObjectReferenceTemplate poaTemplate = org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.read (in);
  123. this.poaDestroyed (serverId, orbId, poaTemplate);
  124. out = $rh.createReply();
  125. break;
  126. }
  127. /** If the server is not running, start it up. This is allowed
  128. * whether or not the server has been installed.
  129. */
  130. case 5: // PortableActivationIDL/Activator/activate
  131. {
  132. try {
  133. String serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
  134. this.activate (serverId);
  135. out = $rh.createReply();
  136. } catch (com.sun.corba.se.PortableActivationIDL.ServerAlreadyActive $ex) {
  137. out = $rh.createExceptionReply ();
  138. com.sun.corba.se.PortableActivationIDL.ServerAlreadyActiveHelper.write (out, $ex);
  139. } catch (com.sun.corba.se.PortableActivationIDL.ServerNotRegistered $ex) {
  140. out = $rh.createExceptionReply ();
  141. com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
  142. } catch (com.sun.corba.se.PortableActivationIDL.ServerHeldDown $ex) {
  143. out = $rh.createExceptionReply ();
  144. com.sun.corba.se.PortableActivationIDL.ServerHeldDownHelper.write (out, $ex);
  145. }
  146. break;
  147. }
  148. /** If the server is running, shut it down
  149. */
  150. case 6: // PortableActivationIDL/Activator/shutdown
  151. {
  152. try {
  153. String serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
  154. this.shutdown (serverId);
  155. out = $rh.createReply();
  156. } catch (com.sun.corba.se.PortableActivationIDL.ServerNotActive $ex) {
  157. out = $rh.createExceptionReply ();
  158. com.sun.corba.se.PortableActivationIDL.ServerNotActiveHelper.write (out, $ex);
  159. } catch (com.sun.corba.se.PortableActivationIDL.ServerNotRegistered $ex) {
  160. out = $rh.createExceptionReply ();
  161. com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
  162. }
  163. break;
  164. }
  165. /** Invoke the server install hook. If the server is not
  166. * currently running, this method will activate it.
  167. */
  168. case 7: // PortableActivationIDL/Activator/install
  169. {
  170. try {
  171. String serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
  172. this.install (serverId);
  173. out = $rh.createReply();
  174. } catch (com.sun.corba.se.PortableActivationIDL.ServerNotRegistered $ex) {
  175. out = $rh.createExceptionReply ();
  176. com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
  177. } catch (com.sun.corba.se.PortableActivationIDL.ServerHeldDown $ex) {
  178. out = $rh.createExceptionReply ();
  179. com.sun.corba.se.PortableActivationIDL.ServerHeldDownHelper.write (out, $ex);
  180. } catch (com.sun.corba.se.PortableActivationIDL.ServerAlreadyInstalled $ex) {
  181. out = $rh.createExceptionReply ();
  182. com.sun.corba.se.PortableActivationIDL.ServerAlreadyInstalledHelper.write (out, $ex);
  183. }
  184. break;
  185. }
  186. /** Invoke the server uninstall hook. If the server is not
  187. * currently running, this method will activate it.
  188. * After this hook completes, the server may still be running.
  189. */
  190. case 8: // PortableActivationIDL/Activator/uninstall
  191. {
  192. try {
  193. String serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
  194. this.uninstall (serverId);
  195. out = $rh.createReply();
  196. } catch (com.sun.corba.se.PortableActivationIDL.ServerNotRegistered $ex) {
  197. out = $rh.createExceptionReply ();
  198. com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
  199. } catch (com.sun.corba.se.PortableActivationIDL.ServerHeldDown $ex) {
  200. out = $rh.createExceptionReply ();
  201. com.sun.corba.se.PortableActivationIDL.ServerHeldDownHelper.write (out, $ex);
  202. } catch (com.sun.corba.se.PortableActivationIDL.ServerAlreadyUninstalled $ex) {
  203. out = $rh.createExceptionReply ();
  204. com.sun.corba.se.PortableActivationIDL.ServerAlreadyUninstalledHelper.write (out, $ex);
  205. }
  206. break;
  207. }
  208. /** list active servers
  209. */
  210. case 9: // PortableActivationIDL/Activator/getActiveServers
  211. {
  212. String $result[] = null;
  213. $result = this.getActiveServers ();
  214. out = $rh.createReply();
  215. com.sun.corba.se.PortableActivationIDL.ServerIdsHelper.write (out, $result);
  216. break;
  217. }
  218. /** list all registered ORBs for a server
  219. */
  220. case 10: // PortableActivationIDL/Activator/getORBNames
  221. {
  222. try {
  223. String serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
  224. String $result[] = null;
  225. $result = this.getORBNames (serverId);
  226. out = $rh.createReply();
  227. com.sun.corba.se.PortableActivationIDL.ORBidListHelper.write (out, $result);
  228. } catch (com.sun.corba.se.PortableActivationIDL.ServerNotRegistered $ex) {
  229. out = $rh.createExceptionReply ();
  230. com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
  231. }
  232. break;
  233. }
  234. /** Find the server template that corresponds to the ORBD's
  235. * adapter id.
  236. */
  237. case 11: // PortableActivationIDL/Activator/lookupPOATemplate
  238. {
  239. String serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
  240. String orbId = org.omg.PortableInterceptor.ORBIdHelper.read (in);
  241. String orbAdapterName[] = org.omg.PortableInterceptor.AdapterNameHelper.read (in);
  242. org.omg.PortableInterceptor.ObjectReferenceTemplate $result = null;
  243. $result = this.lookupPOATemplate (serverId, orbId, orbAdapterName);
  244. out = $rh.createReply();
  245. org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.write (out, $result);
  246. break;
  247. }
  248. /** locate server - returns the port with a specific type for all registered
  249. * ORBs of an active server.
  250. * Starts the server if it is not already running.
  251. */
  252. case 12: // PortableActivationIDL/Locator/locateServer
  253. {
  254. try {
  255. String serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
  256. String endPoint = in.read_string ();
  257. com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerType $result = null;
  258. $result = this.locateServer (serverId, endPoint);
  259. out = $rh.createReply();
  260. com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerTypeHelper.write (out, $result);
  261. } catch (com.sun.corba.se.PortableActivationIDL.NoSuchEndPoint $ex) {
  262. out = $rh.createExceptionReply ();
  263. com.sun.corba.se.PortableActivationIDL.NoSuchEndPointHelper.write (out, $ex);
  264. } catch (com.sun.corba.se.PortableActivationIDL.ServerNotRegistered $ex) {
  265. out = $rh.createExceptionReply ();
  266. com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
  267. } catch (com.sun.corba.se.PortableActivationIDL.ServerHeldDown $ex) {
  268. out = $rh.createExceptionReply ();
  269. com.sun.corba.se.PortableActivationIDL.ServerHeldDownHelper.write (out, $ex);
  270. }
  271. break;
  272. }
  273. /** locate server - returns all ports registered with a specified ORB for
  274. * an active server
  275. * Starts the server if it is not already running.
  276. */
  277. case 13: // PortableActivationIDL/Locator/locateServerForORB
  278. {
  279. try {
  280. String serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
  281. String orbId = org.omg.PortableInterceptor.ORBIdHelper.read (in);
  282. com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORB $result = null;
  283. $result = this.locateServerForORB (serverId, orbId);
  284. out = $rh.createReply();
  285. com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORBHelper.write (out, $result);
  286. } catch (com.sun.corba.se.PortableActivationIDL.InvalidORBid $ex) {
  287. out = $rh.createExceptionReply ();
  288. com.sun.corba.se.PortableActivationIDL.InvalidORBidHelper.write (out, $ex);
  289. } catch (com.sun.corba.se.PortableActivationIDL.ServerNotRegistered $ex) {
  290. out = $rh.createExceptionReply ();
  291. com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
  292. } catch (com.sun.corba.se.PortableActivationIDL.ServerHeldDown $ex) {
  293. out = $rh.createExceptionReply ();
  294. com.sun.corba.se.PortableActivationIDL.ServerHeldDownHelper.write (out, $ex);
  295. }
  296. break;
  297. }
  298. /** get the port for the endpoint of the locator
  299. */
  300. case 14: // PortableActivationIDL/Locator/getEndpoint
  301. {
  302. try {
  303. String endPointType = in.read_string ();
  304. int $result = (int)0;
  305. $result = this.getEndpoint (endPointType);
  306. out = $rh.createReply();
  307. out.write_long ($result);
  308. } catch (com.sun.corba.se.PortableActivationIDL.NoSuchEndPoint $ex) {
  309. out = $rh.createExceptionReply ();
  310. com.sun.corba.se.PortableActivationIDL.NoSuchEndPointHelper.write (out, $ex);
  311. }
  312. break;
  313. }
  314. /** Useful from external BadServerIdHandlers which need
  315. * to pick a particular port type.
  316. */
  317. case 15: // PortableActivationIDL/Locator/getServerPortForType
  318. {
  319. try {
  320. com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORB location = com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORBHelper.read (in);
  321. String endPointType = in.read_string ();
  322. int $result = (int)0;
  323. $result = this.getServerPortForType (location, endPointType);
  324. out = $rh.createReply();
  325. out.write_long ($result);
  326. } catch (com.sun.corba.se.PortableActivationIDL.NoSuchEndPoint $ex) {
  327. out = $rh.createExceptionReply ();
  328. com.sun.corba.se.PortableActivationIDL.NoSuchEndPointHelper.write (out, $ex);
  329. }
  330. break;
  331. }
  332. default:
  333. throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
  334. }
  335. return out;
  336. } // _invoke
  337. // Type-specific CORBA::Object operations
  338. private static String[] __ids = {
  339. "IDL:PortableActivationIDL/ServerManager:1.0",
  340. "IDL:PortableActivationIDL/Activator:1.0",
  341. "IDL:PortableActivationIDL/Locator:1.0"};
  342. public String[] _ids ()
  343. {
  344. return (String[])__ids.clone ();
  345. }
  346. } // class _ServerManagerImplBase