1. package com.sun.corba.se.ActivationIDL;
  2. /**
  3. * com/sun/corba/se/ActivationIDL/_ActivatorStub.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 class _ActivatorStub extends org.omg.CORBA.portable.ObjectImpl implements com.sun.corba.se.ActivationIDL.Activator
  9. {
  10. // A new ORB started server registers itself with the Activator
  11. public void active (int serverId, com.sun.corba.se.ActivationIDL.Server serverObj) throws com.sun.corba.se.ActivationIDL.ServerNotRegistered
  12. {
  13. org.omg.CORBA.portable.InputStream $in = null;
  14. try {
  15. org.omg.CORBA.portable.OutputStream $out = _request ("active", true);
  16. com.sun.corba.se.ActivationIDL.ServerIdHelper.write ($out, serverId);
  17. com.sun.corba.se.ActivationIDL.ServerHelper.write ($out, serverObj);
  18. $in = _invoke ($out);
  19. return;
  20. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  21. $in = $ex.getInputStream ();
  22. String _id = $ex.getId ();
  23. if (_id.equals ("IDL:ActivationIDL/ServerNotRegistered:1.0"))
  24. throw com.sun.corba.se.ActivationIDL.ServerNotRegisteredHelper.read ($in);
  25. else
  26. throw new org.omg.CORBA.MARSHAL (_id);
  27. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  28. active (serverId, serverObj );
  29. } finally {
  30. _releaseReply ($in);
  31. }
  32. } // active
  33. // Install a particular kind of endpoint
  34. public void registerEndpoints (int serverId, String orbId, com.sun.corba.se.ActivationIDL.EndPointInfo[] endPointInfo) throws com.sun.corba.se.ActivationIDL.ServerNotRegistered, com.sun.corba.se.ActivationIDL.NoSuchEndPoint, com.sun.corba.se.ActivationIDL.ORBAlreadyRegistered
  35. {
  36. org.omg.CORBA.portable.InputStream $in = null;
  37. try {
  38. org.omg.CORBA.portable.OutputStream $out = _request ("registerEndpoints", true);
  39. com.sun.corba.se.ActivationIDL.ServerIdHelper.write ($out, serverId);
  40. com.sun.corba.se.ActivationIDL.ORBidHelper.write ($out, orbId);
  41. com.sun.corba.se.ActivationIDL.EndpointInfoListHelper.write ($out, endPointInfo);
  42. $in = _invoke ($out);
  43. return;
  44. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  45. $in = $ex.getInputStream ();
  46. String _id = $ex.getId ();
  47. if (_id.equals ("IDL:ActivationIDL/ServerNotRegistered:1.0"))
  48. throw com.sun.corba.se.ActivationIDL.ServerNotRegisteredHelper.read ($in);
  49. else if (_id.equals ("IDL:ActivationIDL/NoSuchEndPoint:1.0"))
  50. throw com.sun.corba.se.ActivationIDL.NoSuchEndPointHelper.read ($in);
  51. else if (_id.equals ("IDL:ActivationIDL/ORBAlreadyRegistered:1.0"))
  52. throw com.sun.corba.se.ActivationIDL.ORBAlreadyRegisteredHelper.read ($in);
  53. else
  54. throw new org.omg.CORBA.MARSHAL (_id);
  55. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  56. registerEndpoints (serverId, orbId, endPointInfo );
  57. } finally {
  58. _releaseReply ($in);
  59. }
  60. } // registerEndpoints
  61. // list active servers
  62. public int[] getActiveServers ()
  63. {
  64. org.omg.CORBA.portable.InputStream $in = null;
  65. try {
  66. org.omg.CORBA.portable.OutputStream $out = _request ("getActiveServers", true);
  67. $in = _invoke ($out);
  68. int $result[] = com.sun.corba.se.ActivationIDL.ServerIdsHelper.read ($in);
  69. return $result;
  70. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  71. $in = $ex.getInputStream ();
  72. String _id = $ex.getId ();
  73. throw new org.omg.CORBA.MARSHAL (_id);
  74. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  75. return getActiveServers ( );
  76. } finally {
  77. _releaseReply ($in);
  78. }
  79. } // getActiveServers
  80. // If the server is not running, start it up.
  81. public void activate (int serverId) throws com.sun.corba.se.ActivationIDL.ServerAlreadyActive, com.sun.corba.se.ActivationIDL.ServerNotRegistered, com.sun.corba.se.ActivationIDL.ServerHeldDown
  82. {
  83. org.omg.CORBA.portable.InputStream $in = null;
  84. try {
  85. org.omg.CORBA.portable.OutputStream $out = _request ("activate", true);
  86. com.sun.corba.se.ActivationIDL.ServerIdHelper.write ($out, serverId);
  87. $in = _invoke ($out);
  88. return;
  89. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  90. $in = $ex.getInputStream ();
  91. String _id = $ex.getId ();
  92. if (_id.equals ("IDL:ActivationIDL/ServerAlreadyActive:1.0"))
  93. throw com.sun.corba.se.ActivationIDL.ServerAlreadyActiveHelper.read ($in);
  94. else if (_id.equals ("IDL:ActivationIDL/ServerNotRegistered:1.0"))
  95. throw com.sun.corba.se.ActivationIDL.ServerNotRegisteredHelper.read ($in);
  96. else if (_id.equals ("IDL:ActivationIDL/ServerHeldDown:1.0"))
  97. throw com.sun.corba.se.ActivationIDL.ServerHeldDownHelper.read ($in);
  98. else
  99. throw new org.omg.CORBA.MARSHAL (_id);
  100. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  101. activate (serverId );
  102. } finally {
  103. _releaseReply ($in);
  104. }
  105. } // activate
  106. // If the server is running, shut it down
  107. public void shutdown (int serverId) throws com.sun.corba.se.ActivationIDL.ServerNotActive, com.sun.corba.se.ActivationIDL.ServerNotRegistered
  108. {
  109. org.omg.CORBA.portable.InputStream $in = null;
  110. try {
  111. org.omg.CORBA.portable.OutputStream $out = _request ("shutdown", true);
  112. com.sun.corba.se.ActivationIDL.ServerIdHelper.write ($out, serverId);
  113. $in = _invoke ($out);
  114. return;
  115. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  116. $in = $ex.getInputStream ();
  117. String _id = $ex.getId ();
  118. if (_id.equals ("IDL:ActivationIDL/ServerNotActive:1.0"))
  119. throw com.sun.corba.se.ActivationIDL.ServerNotActiveHelper.read ($in);
  120. else if (_id.equals ("IDL:ActivationIDL/ServerNotRegistered:1.0"))
  121. throw com.sun.corba.se.ActivationIDL.ServerNotRegisteredHelper.read ($in);
  122. else
  123. throw new org.omg.CORBA.MARSHAL (_id);
  124. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  125. shutdown (serverId );
  126. } finally {
  127. _releaseReply ($in);
  128. }
  129. } // shutdown
  130. // currently running, this method will activate it.
  131. public void install (int serverId) throws com.sun.corba.se.ActivationIDL.ServerNotRegistered, com.sun.corba.se.ActivationIDL.ServerHeldDown, com.sun.corba.se.ActivationIDL.ServerAlreadyInstalled
  132. {
  133. org.omg.CORBA.portable.InputStream $in = null;
  134. try {
  135. org.omg.CORBA.portable.OutputStream $out = _request ("install", true);
  136. com.sun.corba.se.ActivationIDL.ServerIdHelper.write ($out, serverId);
  137. $in = _invoke ($out);
  138. return;
  139. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  140. $in = $ex.getInputStream ();
  141. String _id = $ex.getId ();
  142. if (_id.equals ("IDL:ActivationIDL/ServerNotRegistered:1.0"))
  143. throw com.sun.corba.se.ActivationIDL.ServerNotRegisteredHelper.read ($in);
  144. else if (_id.equals ("IDL:ActivationIDL/ServerHeldDown:1.0"))
  145. throw com.sun.corba.se.ActivationIDL.ServerHeldDownHelper.read ($in);
  146. else if (_id.equals ("IDL:ActivationIDL/ServerAlreadyInstalled:1.0"))
  147. throw com.sun.corba.se.ActivationIDL.ServerAlreadyInstalledHelper.read ($in);
  148. else
  149. throw new org.omg.CORBA.MARSHAL (_id);
  150. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  151. install (serverId );
  152. } finally {
  153. _releaseReply ($in);
  154. }
  155. } // install
  156. // list all registered ORBs for a server
  157. public String[] getORBNames (int serverId) throws com.sun.corba.se.ActivationIDL.ServerNotRegistered
  158. {
  159. org.omg.CORBA.portable.InputStream $in = null;
  160. try {
  161. org.omg.CORBA.portable.OutputStream $out = _request ("getORBNames", true);
  162. com.sun.corba.se.ActivationIDL.ServerIdHelper.write ($out, serverId);
  163. $in = _invoke ($out);
  164. String $result[] = com.sun.corba.se.ActivationIDL.ORBidListHelper.read ($in);
  165. return $result;
  166. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  167. $in = $ex.getInputStream ();
  168. String _id = $ex.getId ();
  169. if (_id.equals ("IDL:ActivationIDL/ServerNotRegistered:1.0"))
  170. throw com.sun.corba.se.ActivationIDL.ServerNotRegisteredHelper.read ($in);
  171. else
  172. throw new org.omg.CORBA.MARSHAL (_id);
  173. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  174. return getORBNames (serverId );
  175. } finally {
  176. _releaseReply ($in);
  177. }
  178. } // getORBNames
  179. // After this hook completes, the server may still be running.
  180. public void uninstall (int serverId) throws com.sun.corba.se.ActivationIDL.ServerNotRegistered, com.sun.corba.se.ActivationIDL.ServerHeldDown, com.sun.corba.se.ActivationIDL.ServerAlreadyUninstalled
  181. {
  182. org.omg.CORBA.portable.InputStream $in = null;
  183. try {
  184. org.omg.CORBA.portable.OutputStream $out = _request ("uninstall", true);
  185. com.sun.corba.se.ActivationIDL.ServerIdHelper.write ($out, serverId);
  186. $in = _invoke ($out);
  187. return;
  188. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  189. $in = $ex.getInputStream ();
  190. String _id = $ex.getId ();
  191. if (_id.equals ("IDL:ActivationIDL/ServerNotRegistered:1.0"))
  192. throw com.sun.corba.se.ActivationIDL.ServerNotRegisteredHelper.read ($in);
  193. else if (_id.equals ("IDL:ActivationIDL/ServerHeldDown:1.0"))
  194. throw com.sun.corba.se.ActivationIDL.ServerHeldDownHelper.read ($in);
  195. else if (_id.equals ("IDL:ActivationIDL/ServerAlreadyUninstalled:1.0"))
  196. throw com.sun.corba.se.ActivationIDL.ServerAlreadyUninstalledHelper.read ($in);
  197. else
  198. throw new org.omg.CORBA.MARSHAL (_id);
  199. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  200. uninstall (serverId );
  201. } finally {
  202. _releaseReply ($in);
  203. }
  204. } // uninstall
  205. // Type-specific CORBA::Object operations
  206. private static String[] __ids = {
  207. "IDL:ActivationIDL/Activator:1.0"};
  208. public String[] _ids ()
  209. {
  210. return (String[])__ids.clone ();
  211. }
  212. private void readObject (java.io.ObjectInputStream s) throws java.io.IOException
  213. {
  214. String str = s.readUTF ();
  215. String[] args = null;
  216. java.util.Properties props = null;
  217. org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init (args, props).string_to_object (str);
  218. org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate ();
  219. _set_delegate (delegate);
  220. }
  221. private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException
  222. {
  223. String[] args = null;
  224. java.util.Properties props = null;
  225. String str = org.omg.CORBA.ORB.init (args, props).object_to_string (this);
  226. s.writeUTF (str);
  227. }
  228. } // class _ActivatorStub