1. package com.sun.corba.se.PortableActivationIDL;
  2. /**
  3. * com/sun/corba/se/PortableActivationIDL/_ActivatorImplBase.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. public abstract class _ActivatorImplBase extends org.omg.CORBA.portable.ObjectImpl
  9. implements com.sun.corba.se.PortableActivationIDL.Activator, org.omg.CORBA.portable.InvokeHandler
  10. {
  11. // Constructors
  12. public _ActivatorImplBase ()
  13. {
  14. }
  15. private static java.util.Hashtable _methods = new java.util.Hashtable ();
  16. static
  17. {
  18. _methods.put ("registerServer", new java.lang.Integer (0));
  19. _methods.put ("serverGoingDown", new java.lang.Integer (1));
  20. _methods.put ("registerORB", new java.lang.Integer (2));
  21. _methods.put ("registerPOA", new java.lang.Integer (3));
  22. _methods.put ("poaDestroyed", new java.lang.Integer (4));
  23. _methods.put ("activate", new java.lang.Integer (5));
  24. _methods.put ("shutdown", new java.lang.Integer (6));
  25. _methods.put ("install", new java.lang.Integer (7));
  26. _methods.put ("uninstall", new java.lang.Integer (8));
  27. _methods.put ("getActiveServers", new java.lang.Integer (9));
  28. _methods.put ("getORBNames", new java.lang.Integer (10));
  29. _methods.put ("lookupPOATemplate", new java.lang.Integer (11));
  30. }
  31. public org.omg.CORBA.portable.OutputStream _invoke (String $method,
  32. org.omg.CORBA.portable.InputStream in,
  33. org.omg.CORBA.portable.ResponseHandler $rh)
  34. {
  35. org.omg.CORBA.portable.OutputStream out = null;
  36. java.lang.Integer __method = (java.lang.Integer)_methods.get ($method);
  37. if (__method == null)
  38. throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
  39. switch (__method.intValue ())
  40. {
  41. /** A new ORB started server registers itself with the Activator
  42. */
  43. case 0: // PortableActivationIDL/Activator/registerServer
  44. {
  45. try {
  46. String serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
  47. com.sun.corba.se.PortableActivationIDL.ServerProxy serverObj = com.sun.corba.se.PortableActivationIDL.ServerProxyHelper.read (in);
  48. this.registerServer (serverId, serverObj);
  49. out = $rh.createReply();
  50. } catch (com.sun.corba.se.PortableActivationIDL.ServerNotRegistered $ex) {
  51. out = $rh.createExceptionReply ();
  52. com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
  53. }
  54. break;
  55. }
  56. /** A server is shutting down that was started by this activator.
  57. * Complete termination of the server is detected by the death of the
  58. * process implementing the server.
  59. */
  60. case 1: // PortableActivationIDL/Activator/serverGoingDown
  61. {
  62. String serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
  63. this.serverGoingDown (serverId);
  64. out = $rh.createReply();
  65. break;
  66. }
  67. /** Called whenever an ORB instance is created. This registers
  68. * the transport endpoints and the ORB proxy callback object.
  69. * Note that we cannot detect when an ORB shuts down, although
  70. * all of the POA shutdowns should still be reported.
  71. */
  72. case 2: // PortableActivationIDL/Activator/registerORB
  73. {
  74. try {
  75. String serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
  76. String orbId = org.omg.PortableInterceptor.ORBIdHelper.read (in);
  77. com.sun.corba.se.PortableActivationIDL.ORBProxy orb = com.sun.corba.se.PortableActivationIDL.ORBProxyHelper.read (in);
  78. com.sun.corba.se.PortableActivationIDL.EndPointInfo endPointInfo[] = com.sun.corba.se.PortableActivationIDL.EndpointInfoListHelper.read (in);
  79. this.registerORB (serverId, orbId, orb, endPointInfo);
  80. out = $rh.createReply();
  81. } catch (com.sun.corba.se.PortableActivationIDL.ServerNotRegistered $ex) {
  82. out = $rh.createExceptionReply ();
  83. com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
  84. } catch (com.sun.corba.se.PortableActivationIDL.NoSuchEndPoint $ex) {
  85. out = $rh.createExceptionReply ();
  86. com.sun.corba.se.PortableActivationIDL.NoSuchEndPointHelper.write (out, $ex);
  87. } catch (com.sun.corba.se.PortableActivationIDL.ORBAlreadyRegistered $ex) {
  88. out = $rh.createExceptionReply ();
  89. com.sun.corba.se.PortableActivationIDL.ORBAlreadyRegisteredHelper.write (out, $ex);
  90. }
  91. break;
  92. }
  93. /** Construct or find an ORBD object template corresponding to the
  94. * server's object template and return it. Called whenever a
  95. * persistent POA is created.
  96. */
  97. case 3: // PortableActivationIDL/Activator/registerPOA
  98. {
  99. String serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
  100. String orbId = org.omg.PortableInterceptor.ORBIdHelper.read (in);
  101. org.omg.PortableInterceptor.ObjectReferenceTemplate poaTemplate = org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.read (in);
  102. org.omg.PortableInterceptor.ObjectReferenceTemplate $result = null;
  103. $result = this.registerPOA (serverId, orbId, poaTemplate);
  104. out = $rh.createReply();
  105. org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.write (out, $result);
  106. break;
  107. }
  108. /** Called whenever a POA is destroyed.
  109. */
  110. case 4: // PortableActivationIDL/Activator/poaDestroyed
  111. {
  112. String serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
  113. String orbId = org.omg.PortableInterceptor.ORBIdHelper.read (in);
  114. org.omg.PortableInterceptor.ObjectReferenceTemplate poaTemplate = org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.read (in);
  115. this.poaDestroyed (serverId, orbId, poaTemplate);
  116. out = $rh.createReply();
  117. break;
  118. }
  119. /** If the server is not running, start it up. This is allowed
  120. * whether or not the server has been installed.
  121. */
  122. case 5: // PortableActivationIDL/Activator/activate
  123. {
  124. try {
  125. String serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
  126. this.activate (serverId);
  127. out = $rh.createReply();
  128. } catch (com.sun.corba.se.PortableActivationIDL.ServerAlreadyActive $ex) {
  129. out = $rh.createExceptionReply ();
  130. com.sun.corba.se.PortableActivationIDL.ServerAlreadyActiveHelper.write (out, $ex);
  131. } catch (com.sun.corba.se.PortableActivationIDL.ServerNotRegistered $ex) {
  132. out = $rh.createExceptionReply ();
  133. com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
  134. } catch (com.sun.corba.se.PortableActivationIDL.ServerHeldDown $ex) {
  135. out = $rh.createExceptionReply ();
  136. com.sun.corba.se.PortableActivationIDL.ServerHeldDownHelper.write (out, $ex);
  137. }
  138. break;
  139. }
  140. /** If the server is running, shut it down
  141. */
  142. case 6: // PortableActivationIDL/Activator/shutdown
  143. {
  144. try {
  145. String serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
  146. this.shutdown (serverId);
  147. out = $rh.createReply();
  148. } catch (com.sun.corba.se.PortableActivationIDL.ServerNotActive $ex) {
  149. out = $rh.createExceptionReply ();
  150. com.sun.corba.se.PortableActivationIDL.ServerNotActiveHelper.write (out, $ex);
  151. } catch (com.sun.corba.se.PortableActivationIDL.ServerNotRegistered $ex) {
  152. out = $rh.createExceptionReply ();
  153. com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
  154. }
  155. break;
  156. }
  157. /** Invoke the server install hook. If the server is not
  158. * currently running, this method will activate it.
  159. */
  160. case 7: // PortableActivationIDL/Activator/install
  161. {
  162. try {
  163. String serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
  164. this.install (serverId);
  165. out = $rh.createReply();
  166. } catch (com.sun.corba.se.PortableActivationIDL.ServerNotRegistered $ex) {
  167. out = $rh.createExceptionReply ();
  168. com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
  169. } catch (com.sun.corba.se.PortableActivationIDL.ServerHeldDown $ex) {
  170. out = $rh.createExceptionReply ();
  171. com.sun.corba.se.PortableActivationIDL.ServerHeldDownHelper.write (out, $ex);
  172. } catch (com.sun.corba.se.PortableActivationIDL.ServerAlreadyInstalled $ex) {
  173. out = $rh.createExceptionReply ();
  174. com.sun.corba.se.PortableActivationIDL.ServerAlreadyInstalledHelper.write (out, $ex);
  175. }
  176. break;
  177. }
  178. /** Invoke the server uninstall hook. If the server is not
  179. * currently running, this method will activate it.
  180. * After this hook completes, the server may still be running.
  181. */
  182. case 8: // PortableActivationIDL/Activator/uninstall
  183. {
  184. try {
  185. String serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
  186. this.uninstall (serverId);
  187. out = $rh.createReply();
  188. } catch (com.sun.corba.se.PortableActivationIDL.ServerNotRegistered $ex) {
  189. out = $rh.createExceptionReply ();
  190. com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
  191. } catch (com.sun.corba.se.PortableActivationIDL.ServerHeldDown $ex) {
  192. out = $rh.createExceptionReply ();
  193. com.sun.corba.se.PortableActivationIDL.ServerHeldDownHelper.write (out, $ex);
  194. } catch (com.sun.corba.se.PortableActivationIDL.ServerAlreadyUninstalled $ex) {
  195. out = $rh.createExceptionReply ();
  196. com.sun.corba.se.PortableActivationIDL.ServerAlreadyUninstalledHelper.write (out, $ex);
  197. }
  198. break;
  199. }
  200. /** list active servers
  201. */
  202. case 9: // PortableActivationIDL/Activator/getActiveServers
  203. {
  204. String $result[] = null;
  205. $result = this.getActiveServers ();
  206. out = $rh.createReply();
  207. com.sun.corba.se.PortableActivationIDL.ServerIdsHelper.write (out, $result);
  208. break;
  209. }
  210. /** list all registered ORBs for a server
  211. */
  212. case 10: // PortableActivationIDL/Activator/getORBNames
  213. {
  214. try {
  215. String serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
  216. String $result[] = null;
  217. $result = this.getORBNames (serverId);
  218. out = $rh.createReply();
  219. com.sun.corba.se.PortableActivationIDL.ORBidListHelper.write (out, $result);
  220. } catch (com.sun.corba.se.PortableActivationIDL.ServerNotRegistered $ex) {
  221. out = $rh.createExceptionReply ();
  222. com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
  223. }
  224. break;
  225. }
  226. /** Find the server template that corresponds to the ORBD's
  227. * adapter id.
  228. */
  229. case 11: // PortableActivationIDL/Activator/lookupPOATemplate
  230. {
  231. String serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
  232. String orbId = org.omg.PortableInterceptor.ORBIdHelper.read (in);
  233. String orbAdapterName[] = org.omg.PortableInterceptor.AdapterNameHelper.read (in);
  234. org.omg.PortableInterceptor.ObjectReferenceTemplate $result = null;
  235. $result = this.lookupPOATemplate (serverId, orbId, orbAdapterName);
  236. out = $rh.createReply();
  237. org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.write (out, $result);
  238. break;
  239. }
  240. default:
  241. throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
  242. }
  243. return out;
  244. } // _invoke
  245. // Type-specific CORBA::Object operations
  246. private static String[] __ids = {
  247. "IDL:PortableActivationIDL/Activator:1.0"};
  248. public String[] _ids ()
  249. {
  250. return (String[])__ids.clone ();
  251. }
  252. } // class _ActivatorImplBase