1. package com.sun.corba.se.ActivationIDL;
  2. /**
  3. * com/sun/corba/se/ActivationIDL/_ActivatorImplBase.java .
  4. * Generated by the IDL-to-Java compiler (portable), version "3.1"
  5. * from ../../../../../../src/share/classes/com/sun/corba/se/ActivationIDL/activation.idl
  6. * Sunday, February 22, 2004 11:21:42 PM PST
  7. */
  8. public abstract class _ActivatorImplBase extends org.omg.CORBA.portable.ObjectImpl
  9. implements com.sun.corba.se.ActivationIDL.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 ("active", new java.lang.Integer (0));
  19. _methods.put ("registerEndpoints", new java.lang.Integer (1));
  20. _methods.put ("getActiveServers", new java.lang.Integer (2));
  21. _methods.put ("activate", new java.lang.Integer (3));
  22. _methods.put ("shutdown", new java.lang.Integer (4));
  23. _methods.put ("install", new java.lang.Integer (5));
  24. _methods.put ("getORBNames", new java.lang.Integer (6));
  25. _methods.put ("uninstall", new java.lang.Integer (7));
  26. }
  27. public org.omg.CORBA.portable.OutputStream _invoke (String $method,
  28. org.omg.CORBA.portable.InputStream in,
  29. org.omg.CORBA.portable.ResponseHandler $rh)
  30. {
  31. org.omg.CORBA.portable.OutputStream out = null;
  32. java.lang.Integer __method = (java.lang.Integer)_methods.get ($method);
  33. if (__method == null)
  34. throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
  35. switch (__method.intValue ())
  36. {
  37. // A new ORB started server registers itself with the Activator
  38. case 0: // ActivationIDL/Activator/active
  39. {
  40. try {
  41. int serverId = com.sun.corba.se.ActivationIDL.ServerIdHelper.read (in);
  42. com.sun.corba.se.ActivationIDL.Server serverObj = com.sun.corba.se.ActivationIDL.ServerHelper.read (in);
  43. this.active (serverId, serverObj);
  44. out = $rh.createReply();
  45. } catch (com.sun.corba.se.ActivationIDL.ServerNotRegistered $ex) {
  46. out = $rh.createExceptionReply ();
  47. com.sun.corba.se.ActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
  48. }
  49. break;
  50. }
  51. // Install a particular kind of endpoint
  52. case 1: // ActivationIDL/Activator/registerEndpoints
  53. {
  54. try {
  55. int serverId = com.sun.corba.se.ActivationIDL.ServerIdHelper.read (in);
  56. String orbId = com.sun.corba.se.ActivationIDL.ORBidHelper.read (in);
  57. com.sun.corba.se.ActivationIDL.EndPointInfo endPointInfo[] = com.sun.corba.se.ActivationIDL.EndpointInfoListHelper.read (in);
  58. this.registerEndpoints (serverId, orbId, endPointInfo);
  59. out = $rh.createReply();
  60. } catch (com.sun.corba.se.ActivationIDL.ServerNotRegistered $ex) {
  61. out = $rh.createExceptionReply ();
  62. com.sun.corba.se.ActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
  63. } catch (com.sun.corba.se.ActivationIDL.NoSuchEndPoint $ex) {
  64. out = $rh.createExceptionReply ();
  65. com.sun.corba.se.ActivationIDL.NoSuchEndPointHelper.write (out, $ex);
  66. } catch (com.sun.corba.se.ActivationIDL.ORBAlreadyRegistered $ex) {
  67. out = $rh.createExceptionReply ();
  68. com.sun.corba.se.ActivationIDL.ORBAlreadyRegisteredHelper.write (out, $ex);
  69. }
  70. break;
  71. }
  72. // list active servers
  73. case 2: // ActivationIDL/Activator/getActiveServers
  74. {
  75. int $result[] = null;
  76. $result = this.getActiveServers ();
  77. out = $rh.createReply();
  78. com.sun.corba.se.ActivationIDL.ServerIdsHelper.write (out, $result);
  79. break;
  80. }
  81. // If the server is not running, start it up.
  82. case 3: // ActivationIDL/Activator/activate
  83. {
  84. try {
  85. int serverId = com.sun.corba.se.ActivationIDL.ServerIdHelper.read (in);
  86. this.activate (serverId);
  87. out = $rh.createReply();
  88. } catch (com.sun.corba.se.ActivationIDL.ServerAlreadyActive $ex) {
  89. out = $rh.createExceptionReply ();
  90. com.sun.corba.se.ActivationIDL.ServerAlreadyActiveHelper.write (out, $ex);
  91. } catch (com.sun.corba.se.ActivationIDL.ServerNotRegistered $ex) {
  92. out = $rh.createExceptionReply ();
  93. com.sun.corba.se.ActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
  94. } catch (com.sun.corba.se.ActivationIDL.ServerHeldDown $ex) {
  95. out = $rh.createExceptionReply ();
  96. com.sun.corba.se.ActivationIDL.ServerHeldDownHelper.write (out, $ex);
  97. }
  98. break;
  99. }
  100. // If the server is running, shut it down
  101. case 4: // ActivationIDL/Activator/shutdown
  102. {
  103. try {
  104. int serverId = com.sun.corba.se.ActivationIDL.ServerIdHelper.read (in);
  105. this.shutdown (serverId);
  106. out = $rh.createReply();
  107. } catch (com.sun.corba.se.ActivationIDL.ServerNotActive $ex) {
  108. out = $rh.createExceptionReply ();
  109. com.sun.corba.se.ActivationIDL.ServerNotActiveHelper.write (out, $ex);
  110. } catch (com.sun.corba.se.ActivationIDL.ServerNotRegistered $ex) {
  111. out = $rh.createExceptionReply ();
  112. com.sun.corba.se.ActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
  113. }
  114. break;
  115. }
  116. // currently running, this method will activate it.
  117. case 5: // ActivationIDL/Activator/install
  118. {
  119. try {
  120. int serverId = com.sun.corba.se.ActivationIDL.ServerIdHelper.read (in);
  121. this.install (serverId);
  122. out = $rh.createReply();
  123. } catch (com.sun.corba.se.ActivationIDL.ServerNotRegistered $ex) {
  124. out = $rh.createExceptionReply ();
  125. com.sun.corba.se.ActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
  126. } catch (com.sun.corba.se.ActivationIDL.ServerHeldDown $ex) {
  127. out = $rh.createExceptionReply ();
  128. com.sun.corba.se.ActivationIDL.ServerHeldDownHelper.write (out, $ex);
  129. } catch (com.sun.corba.se.ActivationIDL.ServerAlreadyInstalled $ex) {
  130. out = $rh.createExceptionReply ();
  131. com.sun.corba.se.ActivationIDL.ServerAlreadyInstalledHelper.write (out, $ex);
  132. }
  133. break;
  134. }
  135. // list all registered ORBs for a server
  136. case 6: // ActivationIDL/Activator/getORBNames
  137. {
  138. try {
  139. int serverId = com.sun.corba.se.ActivationIDL.ServerIdHelper.read (in);
  140. String $result[] = null;
  141. $result = this.getORBNames (serverId);
  142. out = $rh.createReply();
  143. com.sun.corba.se.ActivationIDL.ORBidListHelper.write (out, $result);
  144. } catch (com.sun.corba.se.ActivationIDL.ServerNotRegistered $ex) {
  145. out = $rh.createExceptionReply ();
  146. com.sun.corba.se.ActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
  147. }
  148. break;
  149. }
  150. // After this hook completes, the server may still be running.
  151. case 7: // ActivationIDL/Activator/uninstall
  152. {
  153. try {
  154. int serverId = com.sun.corba.se.ActivationIDL.ServerIdHelper.read (in);
  155. this.uninstall (serverId);
  156. out = $rh.createReply();
  157. } catch (com.sun.corba.se.ActivationIDL.ServerNotRegistered $ex) {
  158. out = $rh.createExceptionReply ();
  159. com.sun.corba.se.ActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
  160. } catch (com.sun.corba.se.ActivationIDL.ServerHeldDown $ex) {
  161. out = $rh.createExceptionReply ();
  162. com.sun.corba.se.ActivationIDL.ServerHeldDownHelper.write (out, $ex);
  163. } catch (com.sun.corba.se.ActivationIDL.ServerAlreadyUninstalled $ex) {
  164. out = $rh.createExceptionReply ();
  165. com.sun.corba.se.ActivationIDL.ServerAlreadyUninstalledHelper.write (out, $ex);
  166. }
  167. break;
  168. }
  169. default:
  170. throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
  171. }
  172. return out;
  173. } // _invoke
  174. // Type-specific CORBA::Object operations
  175. private static String[] __ids = {
  176. "IDL:ActivationIDL/Activator:1.0"};
  177. public String[] _ids ()
  178. {
  179. return (String[])__ids.clone ();
  180. }
  181. } // class _ActivatorImplBase