1. package com.sun.corba.se.ActivationIDL;
  2. /**
  3. * com/sun/corba/se/ActivationIDL/_ServerManagerStub.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 _ServerManagerStub extends org.omg.CORBA.portable.ObjectImpl implements com.sun.corba.se.ActivationIDL.ServerManager
  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. // Starts the server if it is not already running.
  206. public com.sun.corba.se.ActivationIDL.LocatorPackage.ServerLocation locateServer (int serverId, String endPoint) throws com.sun.corba.se.ActivationIDL.NoSuchEndPoint, com.sun.corba.se.ActivationIDL.ServerNotRegistered, com.sun.corba.se.ActivationIDL.ServerHeldDown
  207. {
  208. org.omg.CORBA.portable.InputStream $in = null;
  209. try {
  210. org.omg.CORBA.portable.OutputStream $out = _request ("locateServer", true);
  211. com.sun.corba.se.ActivationIDL.ServerIdHelper.write ($out, serverId);
  212. $out.write_string (endPoint);
  213. $in = _invoke ($out);
  214. com.sun.corba.se.ActivationIDL.LocatorPackage.ServerLocation $result = com.sun.corba.se.ActivationIDL.LocatorPackage.ServerLocationHelper.read ($in);
  215. return $result;
  216. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  217. $in = $ex.getInputStream ();
  218. String _id = $ex.getId ();
  219. if (_id.equals ("IDL:ActivationIDL/NoSuchEndPoint:1.0"))
  220. throw com.sun.corba.se.ActivationIDL.NoSuchEndPointHelper.read ($in);
  221. else if (_id.equals ("IDL:ActivationIDL/ServerNotRegistered:1.0"))
  222. throw com.sun.corba.se.ActivationIDL.ServerNotRegisteredHelper.read ($in);
  223. else if (_id.equals ("IDL:ActivationIDL/ServerHeldDown:1.0"))
  224. throw com.sun.corba.se.ActivationIDL.ServerHeldDownHelper.read ($in);
  225. else
  226. throw new org.omg.CORBA.MARSHAL (_id);
  227. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  228. return locateServer (serverId, endPoint );
  229. } finally {
  230. _releaseReply ($in);
  231. }
  232. } // locateServer
  233. // Starts the server if it is not already running.
  234. public com.sun.corba.se.ActivationIDL.LocatorPackage.ServerLocationPerORB locateServerForORB (int serverId, String orbId) throws com.sun.corba.se.ActivationIDL.InvalidORBid, com.sun.corba.se.ActivationIDL.ServerNotRegistered, com.sun.corba.se.ActivationIDL.ServerHeldDown
  235. {
  236. org.omg.CORBA.portable.InputStream $in = null;
  237. try {
  238. org.omg.CORBA.portable.OutputStream $out = _request ("locateServerForORB", true);
  239. com.sun.corba.se.ActivationIDL.ServerIdHelper.write ($out, serverId);
  240. com.sun.corba.se.ActivationIDL.ORBidHelper.write ($out, orbId);
  241. $in = _invoke ($out);
  242. com.sun.corba.se.ActivationIDL.LocatorPackage.ServerLocationPerORB $result = com.sun.corba.se.ActivationIDL.LocatorPackage.ServerLocationPerORBHelper.read ($in);
  243. return $result;
  244. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  245. $in = $ex.getInputStream ();
  246. String _id = $ex.getId ();
  247. if (_id.equals ("IDL:ActivationIDL/InvalidORBid:1.0"))
  248. throw com.sun.corba.se.ActivationIDL.InvalidORBidHelper.read ($in);
  249. else if (_id.equals ("IDL:ActivationIDL/ServerNotRegistered:1.0"))
  250. throw com.sun.corba.se.ActivationIDL.ServerNotRegisteredHelper.read ($in);
  251. else if (_id.equals ("IDL:ActivationIDL/ServerHeldDown:1.0"))
  252. throw com.sun.corba.se.ActivationIDL.ServerHeldDownHelper.read ($in);
  253. else
  254. throw new org.omg.CORBA.MARSHAL (_id);
  255. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  256. return locateServerForORB (serverId, orbId );
  257. } finally {
  258. _releaseReply ($in);
  259. }
  260. } // locateServerForORB
  261. // get the port for the endpoint of the locator
  262. public int getEndpoint (String endPointType) throws com.sun.corba.se.ActivationIDL.NoSuchEndPoint
  263. {
  264. org.omg.CORBA.portable.InputStream $in = null;
  265. try {
  266. org.omg.CORBA.portable.OutputStream $out = _request ("getEndpoint", true);
  267. $out.write_string (endPointType);
  268. $in = _invoke ($out);
  269. int $result = com.sun.corba.se.ActivationIDL.TCPPortHelper.read ($in);
  270. return $result;
  271. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  272. $in = $ex.getInputStream ();
  273. String _id = $ex.getId ();
  274. if (_id.equals ("IDL:ActivationIDL/NoSuchEndPoint:1.0"))
  275. throw com.sun.corba.se.ActivationIDL.NoSuchEndPointHelper.read ($in);
  276. else
  277. throw new org.omg.CORBA.MARSHAL (_id);
  278. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  279. return getEndpoint (endPointType );
  280. } finally {
  281. _releaseReply ($in);
  282. }
  283. } // getEndpoint
  284. // to pick a particular port type.
  285. public int getServerPortForType (com.sun.corba.se.ActivationIDL.LocatorPackage.ServerLocationPerORB location, String endPointType) throws com.sun.corba.se.ActivationIDL.NoSuchEndPoint
  286. {
  287. org.omg.CORBA.portable.InputStream $in = null;
  288. try {
  289. org.omg.CORBA.portable.OutputStream $out = _request ("getServerPortForType", true);
  290. com.sun.corba.se.ActivationIDL.LocatorPackage.ServerLocationPerORBHelper.write ($out, location);
  291. $out.write_string (endPointType);
  292. $in = _invoke ($out);
  293. int $result = com.sun.corba.se.ActivationIDL.TCPPortHelper.read ($in);
  294. return $result;
  295. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  296. $in = $ex.getInputStream ();
  297. String _id = $ex.getId ();
  298. if (_id.equals ("IDL:ActivationIDL/NoSuchEndPoint:1.0"))
  299. throw com.sun.corba.se.ActivationIDL.NoSuchEndPointHelper.read ($in);
  300. else
  301. throw new org.omg.CORBA.MARSHAL (_id);
  302. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  303. return getServerPortForType (location, endPointType );
  304. } finally {
  305. _releaseReply ($in);
  306. }
  307. } // getServerPortForType
  308. // Type-specific CORBA::Object operations
  309. private static String[] __ids = {
  310. "IDL:ActivationIDL/ServerManager:1.0",
  311. "IDL:ActivationIDL/Activator:1.0",
  312. "IDL:ActivationIDL/Locator:1.0"};
  313. public String[] _ids ()
  314. {
  315. return (String[])__ids.clone ();
  316. }
  317. private void readObject (java.io.ObjectInputStream s) throws java.io.IOException
  318. {
  319. String str = s.readUTF ();
  320. String[] args = null;
  321. java.util.Properties props = null;
  322. org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init (args, props).string_to_object (str);
  323. org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate ();
  324. _set_delegate (delegate);
  325. }
  326. private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException
  327. {
  328. String[] args = null;
  329. java.util.Properties props = null;
  330. String str = org.omg.CORBA.ORB.init (args, props).object_to_string (this);
  331. s.writeUTF (str);
  332. }
  333. } // class _ServerManagerStub