1. package com.sun.corba.se.spi.activation;
  2. /**
  3. * com/sun/corba/se/spi/activation/_RepositoryStub.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 class _RepositoryStub extends org.omg.CORBA.portable.ObjectImpl implements com.sun.corba.se.spi.activation.Repository
  9. {
  10. // always uninstalled.
  11. public int registerServer (com.sun.corba.se.spi.activation.RepositoryPackage.ServerDef serverDef) throws com.sun.corba.se.spi.activation.ServerAlreadyRegistered, com.sun.corba.se.spi.activation.BadServerDefinition
  12. {
  13. org.omg.CORBA.portable.InputStream $in = null;
  14. try {
  15. org.omg.CORBA.portable.OutputStream $out = _request ("registerServer", true);
  16. com.sun.corba.se.spi.activation.RepositoryPackage.ServerDefHelper.write ($out, serverDef);
  17. $in = _invoke ($out);
  18. int $result = com.sun.corba.se.spi.activation.ServerIdHelper.read ($in);
  19. return $result;
  20. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  21. $in = $ex.getInputStream ();
  22. String _id = $ex.getId ();
  23. if (_id.equals ("IDL:activation/ServerAlreadyRegistered:1.0"))
  24. throw com.sun.corba.se.spi.activation.ServerAlreadyRegisteredHelper.read ($in);
  25. else if (_id.equals ("IDL:activation/BadServerDefinition:1.0"))
  26. throw com.sun.corba.se.spi.activation.BadServerDefinitionHelper.read ($in);
  27. else
  28. throw new org.omg.CORBA.MARSHAL (_id);
  29. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  30. return registerServer (serverDef );
  31. } finally {
  32. _releaseReply ($in);
  33. }
  34. } // registerServer
  35. // unregister server definition
  36. public void unregisterServer (int serverId) throws com.sun.corba.se.spi.activation.ServerNotRegistered
  37. {
  38. org.omg.CORBA.portable.InputStream $in = null;
  39. try {
  40. org.omg.CORBA.portable.OutputStream $out = _request ("unregisterServer", true);
  41. com.sun.corba.se.spi.activation.ServerIdHelper.write ($out, serverId);
  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:activation/ServerNotRegistered:1.0"))
  48. throw com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.read ($in);
  49. else
  50. throw new org.omg.CORBA.MARSHAL (_id);
  51. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  52. unregisterServer (serverId );
  53. } finally {
  54. _releaseReply ($in);
  55. }
  56. } // unregisterServer
  57. // get server definition
  58. public com.sun.corba.se.spi.activation.RepositoryPackage.ServerDef getServer (int serverId) throws com.sun.corba.se.spi.activation.ServerNotRegistered
  59. {
  60. org.omg.CORBA.portable.InputStream $in = null;
  61. try {
  62. org.omg.CORBA.portable.OutputStream $out = _request ("getServer", true);
  63. com.sun.corba.se.spi.activation.ServerIdHelper.write ($out, serverId);
  64. $in = _invoke ($out);
  65. com.sun.corba.se.spi.activation.RepositoryPackage.ServerDef $result = com.sun.corba.se.spi.activation.RepositoryPackage.ServerDefHelper.read ($in);
  66. return $result;
  67. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  68. $in = $ex.getInputStream ();
  69. String _id = $ex.getId ();
  70. if (_id.equals ("IDL:activation/ServerNotRegistered:1.0"))
  71. throw com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.read ($in);
  72. else
  73. throw new org.omg.CORBA.MARSHAL (_id);
  74. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  75. return getServer (serverId );
  76. } finally {
  77. _releaseReply ($in);
  78. }
  79. } // getServer
  80. // Return whether the server has been installed
  81. public boolean isInstalled (int serverId) throws com.sun.corba.se.spi.activation.ServerNotRegistered
  82. {
  83. org.omg.CORBA.portable.InputStream $in = null;
  84. try {
  85. org.omg.CORBA.portable.OutputStream $out = _request ("isInstalled", true);
  86. com.sun.corba.se.spi.activation.ServerIdHelper.write ($out, serverId);
  87. $in = _invoke ($out);
  88. boolean $result = $in.read_boolean ();
  89. return $result;
  90. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  91. $in = $ex.getInputStream ();
  92. String _id = $ex.getId ();
  93. if (_id.equals ("IDL:activation/ServerNotRegistered:1.0"))
  94. throw com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.read ($in);
  95. else
  96. throw new org.omg.CORBA.MARSHAL (_id);
  97. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  98. return isInstalled (serverId );
  99. } finally {
  100. _releaseReply ($in);
  101. }
  102. } // isInstalled
  103. // if the server is currently marked as installed.
  104. public void install (int serverId) throws com.sun.corba.se.spi.activation.ServerNotRegistered, com.sun.corba.se.spi.activation.ServerAlreadyInstalled
  105. {
  106. org.omg.CORBA.portable.InputStream $in = null;
  107. try {
  108. org.omg.CORBA.portable.OutputStream $out = _request ("install", true);
  109. com.sun.corba.se.spi.activation.ServerIdHelper.write ($out, serverId);
  110. $in = _invoke ($out);
  111. return;
  112. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  113. $in = $ex.getInputStream ();
  114. String _id = $ex.getId ();
  115. if (_id.equals ("IDL:activation/ServerNotRegistered:1.0"))
  116. throw com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.read ($in);
  117. else if (_id.equals ("IDL:activation/ServerAlreadyInstalled:1.0"))
  118. throw com.sun.corba.se.spi.activation.ServerAlreadyInstalledHelper.read ($in);
  119. else
  120. throw new org.omg.CORBA.MARSHAL (_id);
  121. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  122. install (serverId );
  123. } finally {
  124. _releaseReply ($in);
  125. }
  126. } // install
  127. // if the server is currently marked as uninstalled.
  128. public void uninstall (int serverId) throws com.sun.corba.se.spi.activation.ServerNotRegistered, com.sun.corba.se.spi.activation.ServerAlreadyUninstalled
  129. {
  130. org.omg.CORBA.portable.InputStream $in = null;
  131. try {
  132. org.omg.CORBA.portable.OutputStream $out = _request ("uninstall", true);
  133. com.sun.corba.se.spi.activation.ServerIdHelper.write ($out, serverId);
  134. $in = _invoke ($out);
  135. return;
  136. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  137. $in = $ex.getInputStream ();
  138. String _id = $ex.getId ();
  139. if (_id.equals ("IDL:activation/ServerNotRegistered:1.0"))
  140. throw com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.read ($in);
  141. else if (_id.equals ("IDL:activation/ServerAlreadyUninstalled:1.0"))
  142. throw com.sun.corba.se.spi.activation.ServerAlreadyUninstalledHelper.read ($in);
  143. else
  144. throw new org.omg.CORBA.MARSHAL (_id);
  145. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  146. uninstall (serverId );
  147. } finally {
  148. _releaseReply ($in);
  149. }
  150. } // uninstall
  151. // list registered servers
  152. public int[] listRegisteredServers ()
  153. {
  154. org.omg.CORBA.portable.InputStream $in = null;
  155. try {
  156. org.omg.CORBA.portable.OutputStream $out = _request ("listRegisteredServers", true);
  157. $in = _invoke ($out);
  158. int $result[] = com.sun.corba.se.spi.activation.ServerIdsHelper.read ($in);
  159. return $result;
  160. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  161. $in = $ex.getInputStream ();
  162. String _id = $ex.getId ();
  163. throw new org.omg.CORBA.MARSHAL (_id);
  164. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  165. return listRegisteredServers ( );
  166. } finally {
  167. _releaseReply ($in);
  168. }
  169. } // listRegisteredServers
  170. // servers.
  171. public String[] getApplicationNames ()
  172. {
  173. org.omg.CORBA.portable.InputStream $in = null;
  174. try {
  175. org.omg.CORBA.portable.OutputStream $out = _request ("getApplicationNames", true);
  176. $in = _invoke ($out);
  177. String $result[] = com.sun.corba.se.spi.activation.RepositoryPackage.StringSeqHelper.read ($in);
  178. return $result;
  179. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  180. $in = $ex.getInputStream ();
  181. String _id = $ex.getId ();
  182. throw new org.omg.CORBA.MARSHAL (_id);
  183. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  184. return getApplicationNames ( );
  185. } finally {
  186. _releaseReply ($in);
  187. }
  188. } // getApplicationNames
  189. // Find the ServerID associated with the given application name.
  190. public int getServerID (String applicationName) throws com.sun.corba.se.spi.activation.ServerNotRegistered
  191. {
  192. org.omg.CORBA.portable.InputStream $in = null;
  193. try {
  194. org.omg.CORBA.portable.OutputStream $out = _request ("getServerID", true);
  195. $out.write_string (applicationName);
  196. $in = _invoke ($out);
  197. int $result = com.sun.corba.se.spi.activation.ServerIdHelper.read ($in);
  198. return $result;
  199. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  200. $in = $ex.getInputStream ();
  201. String _id = $ex.getId ();
  202. if (_id.equals ("IDL:activation/ServerNotRegistered:1.0"))
  203. throw com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.read ($in);
  204. else
  205. throw new org.omg.CORBA.MARSHAL (_id);
  206. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  207. return getServerID (applicationName );
  208. } finally {
  209. _releaseReply ($in);
  210. }
  211. } // getServerID
  212. // Type-specific CORBA::Object operations
  213. private static String[] __ids = {
  214. "IDL:activation/Repository:1.0"};
  215. public String[] _ids ()
  216. {
  217. return (String[])__ids.clone ();
  218. }
  219. private void readObject (java.io.ObjectInputStream s) throws java.io.IOException
  220. {
  221. String str = s.readUTF ();
  222. String[] args = null;
  223. java.util.Properties props = null;
  224. org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init (args, props).string_to_object (str);
  225. org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate ();
  226. _set_delegate (delegate);
  227. }
  228. private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException
  229. {
  230. String[] args = null;
  231. java.util.Properties props = null;
  232. String str = org.omg.CORBA.ORB.init (args, props).object_to_string (this);
  233. s.writeUTF (str);
  234. }
  235. } // class _RepositoryStub