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