1. package com.sun.corba.se.PortableActivationIDL;
  2. /**
  3. * com/sun/corba/se/PortableActivationIDL/_ActivatorStub.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 class _ActivatorStub extends org.omg.CORBA.portable.ObjectImpl implements com.sun.corba.se.PortableActivationIDL.Activator
  9. {
  10. /** A new ORB started server registers itself with the Activator
  11. */
  12. public void registerServer (String serverId, com.sun.corba.se.PortableActivationIDL.ServerProxy serverObj) throws com.sun.corba.se.PortableActivationIDL.ServerNotRegistered
  13. {
  14. org.omg.CORBA.portable.InputStream $in = null;
  15. try {
  16. org.omg.CORBA.portable.OutputStream $out = _request ("registerServer", true);
  17. org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId);
  18. com.sun.corba.se.PortableActivationIDL.ServerProxyHelper.write ($out, serverObj);
  19. $in = _invoke ($out);
  20. return;
  21. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  22. $in = $ex.getInputStream ();
  23. String _id = $ex.getId ();
  24. if (_id.equals ("IDL:PortableActivationIDL/ServerNotRegistered:1.0"))
  25. throw com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.read ($in);
  26. else
  27. throw new org.omg.CORBA.MARSHAL (_id);
  28. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  29. registerServer (serverId, serverObj );
  30. } finally {
  31. _releaseReply ($in);
  32. }
  33. } // registerServer
  34. /** A server is shutting down that was started by this activator.
  35. * Complete termination of the server is detected by the death of the
  36. * process implementing the server.
  37. */
  38. public void serverGoingDown (String serverId)
  39. {
  40. org.omg.CORBA.portable.InputStream $in = null;
  41. try {
  42. org.omg.CORBA.portable.OutputStream $out = _request ("serverGoingDown", true);
  43. org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId);
  44. $in = _invoke ($out);
  45. return;
  46. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  47. $in = $ex.getInputStream ();
  48. String _id = $ex.getId ();
  49. throw new org.omg.CORBA.MARSHAL (_id);
  50. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  51. serverGoingDown (serverId );
  52. } finally {
  53. _releaseReply ($in);
  54. }
  55. } // serverGoingDown
  56. /** Called whenever an ORB instance is created. This registers
  57. * the transport endpoints and the ORB proxy callback object.
  58. * Note that we cannot detect when an ORB shuts down, although
  59. * all of the POA shutdowns should still be reported.
  60. */
  61. public void registerORB (String serverId, String orbId, com.sun.corba.se.PortableActivationIDL.ORBProxy orb, com.sun.corba.se.PortableActivationIDL.EndPointInfo[] endPointInfo) throws com.sun.corba.se.PortableActivationIDL.ServerNotRegistered, com.sun.corba.se.PortableActivationIDL.NoSuchEndPoint, com.sun.corba.se.PortableActivationIDL.ORBAlreadyRegistered
  62. {
  63. org.omg.CORBA.portable.InputStream $in = null;
  64. try {
  65. org.omg.CORBA.portable.OutputStream $out = _request ("registerORB", true);
  66. org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId);
  67. org.omg.PortableInterceptor.ORBIdHelper.write ($out, orbId);
  68. com.sun.corba.se.PortableActivationIDL.ORBProxyHelper.write ($out, orb);
  69. com.sun.corba.se.PortableActivationIDL.EndpointInfoListHelper.write ($out, endPointInfo);
  70. $in = _invoke ($out);
  71. return;
  72. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  73. $in = $ex.getInputStream ();
  74. String _id = $ex.getId ();
  75. if (_id.equals ("IDL:PortableActivationIDL/ServerNotRegistered:1.0"))
  76. throw com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.read ($in);
  77. else if (_id.equals ("IDL:PortableActivationIDL/NoSuchEndPoint:1.0"))
  78. throw com.sun.corba.se.PortableActivationIDL.NoSuchEndPointHelper.read ($in);
  79. else if (_id.equals ("IDL:PortableActivationIDL/ORBAlreadyRegistered:1.0"))
  80. throw com.sun.corba.se.PortableActivationIDL.ORBAlreadyRegisteredHelper.read ($in);
  81. else
  82. throw new org.omg.CORBA.MARSHAL (_id);
  83. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  84. registerORB (serverId, orbId, orb, endPointInfo );
  85. } finally {
  86. _releaseReply ($in);
  87. }
  88. } // registerORB
  89. /** Construct or find an ORBD object template corresponding to the
  90. * server's object template and return it. Called whenever a
  91. * persistent POA is created.
  92. */
  93. public org.omg.PortableInterceptor.ObjectReferenceTemplate registerPOA (String serverId, String orbId, org.omg.PortableInterceptor.ObjectReferenceTemplate poaTemplate)
  94. {
  95. org.omg.CORBA.portable.InputStream $in = null;
  96. try {
  97. org.omg.CORBA.portable.OutputStream $out = _request ("registerPOA", true);
  98. org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId);
  99. org.omg.PortableInterceptor.ORBIdHelper.write ($out, orbId);
  100. org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.write ($out, poaTemplate);
  101. $in = _invoke ($out);
  102. org.omg.PortableInterceptor.ObjectReferenceTemplate $result = org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.read ($in);
  103. return $result;
  104. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  105. $in = $ex.getInputStream ();
  106. String _id = $ex.getId ();
  107. throw new org.omg.CORBA.MARSHAL (_id);
  108. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  109. return registerPOA (serverId, orbId, poaTemplate );
  110. } finally {
  111. _releaseReply ($in);
  112. }
  113. } // registerPOA
  114. /** Called whenever a POA is destroyed.
  115. */
  116. public void poaDestroyed (String serverId, String orbId, org.omg.PortableInterceptor.ObjectReferenceTemplate poaTemplate)
  117. {
  118. org.omg.CORBA.portable.InputStream $in = null;
  119. try {
  120. org.omg.CORBA.portable.OutputStream $out = _request ("poaDestroyed", true);
  121. org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId);
  122. org.omg.PortableInterceptor.ORBIdHelper.write ($out, orbId);
  123. org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.write ($out, poaTemplate);
  124. $in = _invoke ($out);
  125. return;
  126. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  127. $in = $ex.getInputStream ();
  128. String _id = $ex.getId ();
  129. throw new org.omg.CORBA.MARSHAL (_id);
  130. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  131. poaDestroyed (serverId, orbId, poaTemplate );
  132. } finally {
  133. _releaseReply ($in);
  134. }
  135. } // poaDestroyed
  136. /** If the server is not running, start it up. This is allowed
  137. * whether or not the server has been installed.
  138. */
  139. public void activate (String serverId) throws com.sun.corba.se.PortableActivationIDL.ServerAlreadyActive, com.sun.corba.se.PortableActivationIDL.ServerNotRegistered, com.sun.corba.se.PortableActivationIDL.ServerHeldDown
  140. {
  141. org.omg.CORBA.portable.InputStream $in = null;
  142. try {
  143. org.omg.CORBA.portable.OutputStream $out = _request ("activate", true);
  144. org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId);
  145. $in = _invoke ($out);
  146. return;
  147. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  148. $in = $ex.getInputStream ();
  149. String _id = $ex.getId ();
  150. if (_id.equals ("IDL:PortableActivationIDL/ServerAlreadyActive:1.0"))
  151. throw com.sun.corba.se.PortableActivationIDL.ServerAlreadyActiveHelper.read ($in);
  152. else if (_id.equals ("IDL:PortableActivationIDL/ServerNotRegistered:1.0"))
  153. throw com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.read ($in);
  154. else if (_id.equals ("IDL:PortableActivationIDL/ServerHeldDown:1.0"))
  155. throw com.sun.corba.se.PortableActivationIDL.ServerHeldDownHelper.read ($in);
  156. else
  157. throw new org.omg.CORBA.MARSHAL (_id);
  158. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  159. activate (serverId );
  160. } finally {
  161. _releaseReply ($in);
  162. }
  163. } // activate
  164. /** If the server is running, shut it down
  165. */
  166. public void shutdown (String serverId) throws com.sun.corba.se.PortableActivationIDL.ServerNotActive, com.sun.corba.se.PortableActivationIDL.ServerNotRegistered
  167. {
  168. org.omg.CORBA.portable.InputStream $in = null;
  169. try {
  170. org.omg.CORBA.portable.OutputStream $out = _request ("shutdown", true);
  171. org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId);
  172. $in = _invoke ($out);
  173. return;
  174. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  175. $in = $ex.getInputStream ();
  176. String _id = $ex.getId ();
  177. if (_id.equals ("IDL:PortableActivationIDL/ServerNotActive:1.0"))
  178. throw com.sun.corba.se.PortableActivationIDL.ServerNotActiveHelper.read ($in);
  179. else if (_id.equals ("IDL:PortableActivationIDL/ServerNotRegistered:1.0"))
  180. throw com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.read ($in);
  181. else
  182. throw new org.omg.CORBA.MARSHAL (_id);
  183. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  184. shutdown (serverId );
  185. } finally {
  186. _releaseReply ($in);
  187. }
  188. } // shutdown
  189. /** Invoke the server install hook. If the server is not
  190. * currently running, this method will activate it.
  191. */
  192. public void install (String serverId) throws com.sun.corba.se.PortableActivationIDL.ServerNotRegistered, com.sun.corba.se.PortableActivationIDL.ServerHeldDown, com.sun.corba.se.PortableActivationIDL.ServerAlreadyInstalled
  193. {
  194. org.omg.CORBA.portable.InputStream $in = null;
  195. try {
  196. org.omg.CORBA.portable.OutputStream $out = _request ("install", true);
  197. org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId);
  198. $in = _invoke ($out);
  199. return;
  200. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  201. $in = $ex.getInputStream ();
  202. String _id = $ex.getId ();
  203. if (_id.equals ("IDL:PortableActivationIDL/ServerNotRegistered:1.0"))
  204. throw com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.read ($in);
  205. else if (_id.equals ("IDL:PortableActivationIDL/ServerHeldDown:1.0"))
  206. throw com.sun.corba.se.PortableActivationIDL.ServerHeldDownHelper.read ($in);
  207. else if (_id.equals ("IDL:PortableActivationIDL/ServerAlreadyInstalled:1.0"))
  208. throw com.sun.corba.se.PortableActivationIDL.ServerAlreadyInstalledHelper.read ($in);
  209. else
  210. throw new org.omg.CORBA.MARSHAL (_id);
  211. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  212. install (serverId );
  213. } finally {
  214. _releaseReply ($in);
  215. }
  216. } // install
  217. /** Invoke the server uninstall hook. If the server is not
  218. * currently running, this method will activate it.
  219. * After this hook completes, the server may still be running.
  220. */
  221. public void uninstall (String serverId) throws com.sun.corba.se.PortableActivationIDL.ServerNotRegistered, com.sun.corba.se.PortableActivationIDL.ServerHeldDown, com.sun.corba.se.PortableActivationIDL.ServerAlreadyUninstalled
  222. {
  223. org.omg.CORBA.portable.InputStream $in = null;
  224. try {
  225. org.omg.CORBA.portable.OutputStream $out = _request ("uninstall", true);
  226. org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId);
  227. $in = _invoke ($out);
  228. return;
  229. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  230. $in = $ex.getInputStream ();
  231. String _id = $ex.getId ();
  232. if (_id.equals ("IDL:PortableActivationIDL/ServerNotRegistered:1.0"))
  233. throw com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.read ($in);
  234. else if (_id.equals ("IDL:PortableActivationIDL/ServerHeldDown:1.0"))
  235. throw com.sun.corba.se.PortableActivationIDL.ServerHeldDownHelper.read ($in);
  236. else if (_id.equals ("IDL:PortableActivationIDL/ServerAlreadyUninstalled:1.0"))
  237. throw com.sun.corba.se.PortableActivationIDL.ServerAlreadyUninstalledHelper.read ($in);
  238. else
  239. throw new org.omg.CORBA.MARSHAL (_id);
  240. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  241. uninstall (serverId );
  242. } finally {
  243. _releaseReply ($in);
  244. }
  245. } // uninstall
  246. /** list active servers
  247. */
  248. public String[] getActiveServers ()
  249. {
  250. org.omg.CORBA.portable.InputStream $in = null;
  251. try {
  252. org.omg.CORBA.portable.OutputStream $out = _request ("getActiveServers", true);
  253. $in = _invoke ($out);
  254. String $result[] = com.sun.corba.se.PortableActivationIDL.ServerIdsHelper.read ($in);
  255. return $result;
  256. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  257. $in = $ex.getInputStream ();
  258. String _id = $ex.getId ();
  259. throw new org.omg.CORBA.MARSHAL (_id);
  260. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  261. return getActiveServers ( );
  262. } finally {
  263. _releaseReply ($in);
  264. }
  265. } // getActiveServers
  266. /** list all registered ORBs for a server
  267. */
  268. public String[] getORBNames (String serverId) throws com.sun.corba.se.PortableActivationIDL.ServerNotRegistered
  269. {
  270. org.omg.CORBA.portable.InputStream $in = null;
  271. try {
  272. org.omg.CORBA.portable.OutputStream $out = _request ("getORBNames", true);
  273. org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId);
  274. $in = _invoke ($out);
  275. String $result[] = com.sun.corba.se.PortableActivationIDL.ORBidListHelper.read ($in);
  276. return $result;
  277. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  278. $in = $ex.getInputStream ();
  279. String _id = $ex.getId ();
  280. if (_id.equals ("IDL:PortableActivationIDL/ServerNotRegistered:1.0"))
  281. throw com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.read ($in);
  282. else
  283. throw new org.omg.CORBA.MARSHAL (_id);
  284. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  285. return getORBNames (serverId );
  286. } finally {
  287. _releaseReply ($in);
  288. }
  289. } // getORBNames
  290. /** Find the server template that corresponds to the ORBD's
  291. * adapter id.
  292. */
  293. public org.omg.PortableInterceptor.ObjectReferenceTemplate lookupPOATemplate (String serverId, String orbId, String[] orbAdapterName)
  294. {
  295. org.omg.CORBA.portable.InputStream $in = null;
  296. try {
  297. org.omg.CORBA.portable.OutputStream $out = _request ("lookupPOATemplate", true);
  298. org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId);
  299. org.omg.PortableInterceptor.ORBIdHelper.write ($out, orbId);
  300. org.omg.PortableInterceptor.AdapterNameHelper.write ($out, orbAdapterName);
  301. $in = _invoke ($out);
  302. org.omg.PortableInterceptor.ObjectReferenceTemplate $result = org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.read ($in);
  303. return $result;
  304. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  305. $in = $ex.getInputStream ();
  306. String _id = $ex.getId ();
  307. throw new org.omg.CORBA.MARSHAL (_id);
  308. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  309. return lookupPOATemplate (serverId, orbId, orbAdapterName );
  310. } finally {
  311. _releaseReply ($in);
  312. }
  313. } // lookupPOATemplate
  314. // Type-specific CORBA::Object operations
  315. private static String[] __ids = {
  316. "IDL:PortableActivationIDL/Activator:1.0"};
  317. public String[] _ids ()
  318. {
  319. return (String[])__ids.clone ();
  320. }
  321. private void readObject (java.io.ObjectInputStream s) throws java.io.IOException
  322. {
  323. String str = s.readUTF ();
  324. String[] args = null;
  325. java.util.Properties props = null;
  326. org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init (args, props).string_to_object (str);
  327. org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate ();
  328. _set_delegate (delegate);
  329. }
  330. private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException
  331. {
  332. String[] args = null;
  333. java.util.Properties props = null;
  334. String str = org.omg.CORBA.ORB.init (args, props).object_to_string (this);
  335. s.writeUTF (str);
  336. }
  337. } // class _ActivatorStub