1. package com.sun.corba.se.spi.activation;
  2. /**
  3. * com/sun/corba/se/spi/activation/_ServerManagerImplBase.java .
  4. * Generated by the IDL-to-Java compiler (portable), version "3.2"
  5. * from ../../../../src/share/classes/com/sun/corba/se/spi/activation/activation.idl
  6. * Wednesday, September 15, 2004 3:50:42 AM PDT
  7. */
  8. public abstract class _ServerManagerImplBase extends org.omg.CORBA.portable.ObjectImpl
  9. implements com.sun.corba.se.spi.activation.ServerManager, org.omg.CORBA.portable.InvokeHandler
  10. {
  11. // Constructors
  12. public _ServerManagerImplBase ()
  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. _methods.put ("locateServer", new java.lang.Integer (8));
  27. _methods.put ("locateServerForORB", new java.lang.Integer (9));
  28. _methods.put ("getEndpoint", new java.lang.Integer (10));
  29. _methods.put ("getServerPortForType", 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. case 0: // activation/Activator/active
  43. {
  44. try {
  45. int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in);
  46. com.sun.corba.se.spi.activation.Server serverObj = com.sun.corba.se.spi.activation.ServerHelper.read (in);
  47. this.active (serverId, serverObj);
  48. out = $rh.createReply();
  49. } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) {
  50. out = $rh.createExceptionReply ();
  51. com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex);
  52. }
  53. break;
  54. }
  55. // Install a particular kind of endpoint
  56. case 1: // activation/Activator/registerEndpoints
  57. {
  58. try {
  59. int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in);
  60. String orbId = com.sun.corba.se.spi.activation.ORBidHelper.read (in);
  61. com.sun.corba.se.spi.activation.EndPointInfo endPointInfo[] = com.sun.corba.se.spi.activation.EndpointInfoListHelper.read (in);
  62. this.registerEndpoints (serverId, orbId, endPointInfo);
  63. out = $rh.createReply();
  64. } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) {
  65. out = $rh.createExceptionReply ();
  66. com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex);
  67. } catch (com.sun.corba.se.spi.activation.NoSuchEndPoint $ex) {
  68. out = $rh.createExceptionReply ();
  69. com.sun.corba.se.spi.activation.NoSuchEndPointHelper.write (out, $ex);
  70. } catch (com.sun.corba.se.spi.activation.ORBAlreadyRegistered $ex) {
  71. out = $rh.createExceptionReply ();
  72. com.sun.corba.se.spi.activation.ORBAlreadyRegisteredHelper.write (out, $ex);
  73. }
  74. break;
  75. }
  76. // list active servers
  77. case 2: // activation/Activator/getActiveServers
  78. {
  79. int $result[] = null;
  80. $result = this.getActiveServers ();
  81. out = $rh.createReply();
  82. com.sun.corba.se.spi.activation.ServerIdsHelper.write (out, $result);
  83. break;
  84. }
  85. // If the server is not running, start it up.
  86. case 3: // activation/Activator/activate
  87. {
  88. try {
  89. int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in);
  90. this.activate (serverId);
  91. out = $rh.createReply();
  92. } catch (com.sun.corba.se.spi.activation.ServerAlreadyActive $ex) {
  93. out = $rh.createExceptionReply ();
  94. com.sun.corba.se.spi.activation.ServerAlreadyActiveHelper.write (out, $ex);
  95. } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) {
  96. out = $rh.createExceptionReply ();
  97. com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex);
  98. } catch (com.sun.corba.se.spi.activation.ServerHeldDown $ex) {
  99. out = $rh.createExceptionReply ();
  100. com.sun.corba.se.spi.activation.ServerHeldDownHelper.write (out, $ex);
  101. }
  102. break;
  103. }
  104. // If the server is running, shut it down
  105. case 4: // activation/Activator/shutdown
  106. {
  107. try {
  108. int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in);
  109. this.shutdown (serverId);
  110. out = $rh.createReply();
  111. } catch (com.sun.corba.se.spi.activation.ServerNotActive $ex) {
  112. out = $rh.createExceptionReply ();
  113. com.sun.corba.se.spi.activation.ServerNotActiveHelper.write (out, $ex);
  114. } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) {
  115. out = $rh.createExceptionReply ();
  116. com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex);
  117. }
  118. break;
  119. }
  120. // currently running, this method will activate it.
  121. case 5: // activation/Activator/install
  122. {
  123. try {
  124. int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in);
  125. this.install (serverId);
  126. out = $rh.createReply();
  127. } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) {
  128. out = $rh.createExceptionReply ();
  129. com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex);
  130. } catch (com.sun.corba.se.spi.activation.ServerHeldDown $ex) {
  131. out = $rh.createExceptionReply ();
  132. com.sun.corba.se.spi.activation.ServerHeldDownHelper.write (out, $ex);
  133. } catch (com.sun.corba.se.spi.activation.ServerAlreadyInstalled $ex) {
  134. out = $rh.createExceptionReply ();
  135. com.sun.corba.se.spi.activation.ServerAlreadyInstalledHelper.write (out, $ex);
  136. }
  137. break;
  138. }
  139. // list all registered ORBs for a server
  140. case 6: // activation/Activator/getORBNames
  141. {
  142. try {
  143. int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in);
  144. String $result[] = null;
  145. $result = this.getORBNames (serverId);
  146. out = $rh.createReply();
  147. com.sun.corba.se.spi.activation.ORBidListHelper.write (out, $result);
  148. } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) {
  149. out = $rh.createExceptionReply ();
  150. com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex);
  151. }
  152. break;
  153. }
  154. // After this hook completes, the server may still be running.
  155. case 7: // activation/Activator/uninstall
  156. {
  157. try {
  158. int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in);
  159. this.uninstall (serverId);
  160. out = $rh.createReply();
  161. } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) {
  162. out = $rh.createExceptionReply ();
  163. com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex);
  164. } catch (com.sun.corba.se.spi.activation.ServerHeldDown $ex) {
  165. out = $rh.createExceptionReply ();
  166. com.sun.corba.se.spi.activation.ServerHeldDownHelper.write (out, $ex);
  167. } catch (com.sun.corba.se.spi.activation.ServerAlreadyUninstalled $ex) {
  168. out = $rh.createExceptionReply ();
  169. com.sun.corba.se.spi.activation.ServerAlreadyUninstalledHelper.write (out, $ex);
  170. }
  171. break;
  172. }
  173. // Starts the server if it is not already running.
  174. case 8: // activation/Locator/locateServer
  175. {
  176. try {
  177. int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in);
  178. String endPoint = in.read_string ();
  179. com.sun.corba.se.spi.activation.LocatorPackage.ServerLocation $result = null;
  180. $result = this.locateServer (serverId, endPoint);
  181. out = $rh.createReply();
  182. com.sun.corba.se.spi.activation.LocatorPackage.ServerLocationHelper.write (out, $result);
  183. } catch (com.sun.corba.se.spi.activation.NoSuchEndPoint $ex) {
  184. out = $rh.createExceptionReply ();
  185. com.sun.corba.se.spi.activation.NoSuchEndPointHelper.write (out, $ex);
  186. } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) {
  187. out = $rh.createExceptionReply ();
  188. com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex);
  189. } catch (com.sun.corba.se.spi.activation.ServerHeldDown $ex) {
  190. out = $rh.createExceptionReply ();
  191. com.sun.corba.se.spi.activation.ServerHeldDownHelper.write (out, $ex);
  192. }
  193. break;
  194. }
  195. // Starts the server if it is not already running.
  196. case 9: // activation/Locator/locateServerForORB
  197. {
  198. try {
  199. int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in);
  200. String orbId = com.sun.corba.se.spi.activation.ORBidHelper.read (in);
  201. com.sun.corba.se.spi.activation.LocatorPackage.ServerLocationPerORB $result = null;
  202. $result = this.locateServerForORB (serverId, orbId);
  203. out = $rh.createReply();
  204. com.sun.corba.se.spi.activation.LocatorPackage.ServerLocationPerORBHelper.write (out, $result);
  205. } catch (com.sun.corba.se.spi.activation.InvalidORBid $ex) {
  206. out = $rh.createExceptionReply ();
  207. com.sun.corba.se.spi.activation.InvalidORBidHelper.write (out, $ex);
  208. } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) {
  209. out = $rh.createExceptionReply ();
  210. com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex);
  211. } catch (com.sun.corba.se.spi.activation.ServerHeldDown $ex) {
  212. out = $rh.createExceptionReply ();
  213. com.sun.corba.se.spi.activation.ServerHeldDownHelper.write (out, $ex);
  214. }
  215. break;
  216. }
  217. // get the port for the endpoint of the locator
  218. case 10: // activation/Locator/getEndpoint
  219. {
  220. try {
  221. String endPointType = in.read_string ();
  222. int $result = (int)0;
  223. $result = this.getEndpoint (endPointType);
  224. out = $rh.createReply();
  225. out.write_long ($result);
  226. } catch (com.sun.corba.se.spi.activation.NoSuchEndPoint $ex) {
  227. out = $rh.createExceptionReply ();
  228. com.sun.corba.se.spi.activation.NoSuchEndPointHelper.write (out, $ex);
  229. }
  230. break;
  231. }
  232. // to pick a particular port type.
  233. case 11: // activation/Locator/getServerPortForType
  234. {
  235. try {
  236. com.sun.corba.se.spi.activation.LocatorPackage.ServerLocationPerORB location = com.sun.corba.se.spi.activation.LocatorPackage.ServerLocationPerORBHelper.read (in);
  237. String endPointType = in.read_string ();
  238. int $result = (int)0;
  239. $result = this.getServerPortForType (location, endPointType);
  240. out = $rh.createReply();
  241. out.write_long ($result);
  242. } catch (com.sun.corba.se.spi.activation.NoSuchEndPoint $ex) {
  243. out = $rh.createExceptionReply ();
  244. com.sun.corba.se.spi.activation.NoSuchEndPointHelper.write (out, $ex);
  245. }
  246. break;
  247. }
  248. default:
  249. throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
  250. }
  251. return out;
  252. } // _invoke
  253. // Type-specific CORBA::Object operations
  254. private static String[] __ids = {
  255. "IDL:activation/ServerManager:1.0",
  256. "IDL:activation/Activator:1.0",
  257. "IDL:activation/Locator:1.0"};
  258. public String[] _ids ()
  259. {
  260. return (String[])__ids.clone ();
  261. }
  262. } // class _ServerManagerImplBase