1. package com.sun.corba.se.ActivationIDL;
  2. /**
  3. * com/sun/corba/se/ActivationIDL/_RepositoryImplBase.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 abstract class _RepositoryImplBase extends org.omg.CORBA.portable.ObjectImpl
  9. implements com.sun.corba.se.ActivationIDL.Repository, org.omg.CORBA.portable.InvokeHandler
  10. {
  11. // Constructors
  12. public _RepositoryImplBase ()
  13. {
  14. }
  15. private static java.util.Hashtable _methods = new java.util.Hashtable ();
  16. static
  17. {
  18. _methods.put ("registerServer", new java.lang.Integer (0));
  19. _methods.put ("unregisterServer", new java.lang.Integer (1));
  20. _methods.put ("getServer", new java.lang.Integer (2));
  21. _methods.put ("isInstalled", new java.lang.Integer (3));
  22. _methods.put ("install", new java.lang.Integer (4));
  23. _methods.put ("uninstall", new java.lang.Integer (5));
  24. _methods.put ("listRegisteredServers", new java.lang.Integer (6));
  25. _methods.put ("getApplicationNames", new java.lang.Integer (7));
  26. _methods.put ("getServerID", new java.lang.Integer (8));
  27. }
  28. public org.omg.CORBA.portable.OutputStream _invoke (String $method,
  29. org.omg.CORBA.portable.InputStream in,
  30. org.omg.CORBA.portable.ResponseHandler $rh)
  31. {
  32. org.omg.CORBA.portable.OutputStream out = null;
  33. java.lang.Integer __method = (java.lang.Integer)_methods.get ($method);
  34. if (__method == null)
  35. throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
  36. switch (__method.intValue ())
  37. {
  38. // always uninstalled.
  39. case 0: // ActivationIDL/Repository/registerServer
  40. {
  41. try {
  42. com.sun.corba.se.ActivationIDL.RepositoryPackage.ServerDef serverDef = com.sun.corba.se.ActivationIDL.RepositoryPackage.ServerDefHelper.read (in);
  43. int $result = (int)0;
  44. $result = this.registerServer (serverDef);
  45. out = $rh.createReply();
  46. out.write_long ($result);
  47. } catch (com.sun.corba.se.ActivationIDL.ServerAlreadyRegistered $ex) {
  48. out = $rh.createExceptionReply ();
  49. com.sun.corba.se.ActivationIDL.ServerAlreadyRegisteredHelper.write (out, $ex);
  50. } catch (com.sun.corba.se.ActivationIDL.BadServerDefinition $ex) {
  51. out = $rh.createExceptionReply ();
  52. com.sun.corba.se.ActivationIDL.BadServerDefinitionHelper.write (out, $ex);
  53. }
  54. break;
  55. }
  56. // unregister server definition
  57. case 1: // ActivationIDL/Repository/unregisterServer
  58. {
  59. try {
  60. int serverId = com.sun.corba.se.ActivationIDL.ServerIdHelper.read (in);
  61. this.unregisterServer (serverId);
  62. out = $rh.createReply();
  63. } catch (com.sun.corba.se.ActivationIDL.ServerNotRegistered $ex) {
  64. out = $rh.createExceptionReply ();
  65. com.sun.corba.se.ActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
  66. }
  67. break;
  68. }
  69. // get server definition
  70. case 2: // ActivationIDL/Repository/getServer
  71. {
  72. try {
  73. int serverId = com.sun.corba.se.ActivationIDL.ServerIdHelper.read (in);
  74. com.sun.corba.se.ActivationIDL.RepositoryPackage.ServerDef $result = null;
  75. $result = this.getServer (serverId);
  76. out = $rh.createReply();
  77. com.sun.corba.se.ActivationIDL.RepositoryPackage.ServerDefHelper.write (out, $result);
  78. } catch (com.sun.corba.se.ActivationIDL.ServerNotRegistered $ex) {
  79. out = $rh.createExceptionReply ();
  80. com.sun.corba.se.ActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
  81. }
  82. break;
  83. }
  84. // Return whether the server has been installed
  85. case 3: // ActivationIDL/Repository/isInstalled
  86. {
  87. try {
  88. int serverId = com.sun.corba.se.ActivationIDL.ServerIdHelper.read (in);
  89. boolean $result = false;
  90. $result = this.isInstalled (serverId);
  91. out = $rh.createReply();
  92. out.write_boolean ($result);
  93. } catch (com.sun.corba.se.ActivationIDL.ServerNotRegistered $ex) {
  94. out = $rh.createExceptionReply ();
  95. com.sun.corba.se.ActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
  96. }
  97. break;
  98. }
  99. // if the server is currently marked as installed.
  100. case 4: // ActivationIDL/Repository/install
  101. {
  102. try {
  103. int serverId = com.sun.corba.se.ActivationIDL.ServerIdHelper.read (in);
  104. this.install (serverId);
  105. out = $rh.createReply();
  106. } catch (com.sun.corba.se.ActivationIDL.ServerNotRegistered $ex) {
  107. out = $rh.createExceptionReply ();
  108. com.sun.corba.se.ActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
  109. } catch (com.sun.corba.se.ActivationIDL.ServerAlreadyInstalled $ex) {
  110. out = $rh.createExceptionReply ();
  111. com.sun.corba.se.ActivationIDL.ServerAlreadyInstalledHelper.write (out, $ex);
  112. }
  113. break;
  114. }
  115. // if the server is currently marked as uninstalled.
  116. case 5: // ActivationIDL/Repository/uninstall
  117. {
  118. try {
  119. int serverId = com.sun.corba.se.ActivationIDL.ServerIdHelper.read (in);
  120. this.uninstall (serverId);
  121. out = $rh.createReply();
  122. } catch (com.sun.corba.se.ActivationIDL.ServerNotRegistered $ex) {
  123. out = $rh.createExceptionReply ();
  124. com.sun.corba.se.ActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
  125. } catch (com.sun.corba.se.ActivationIDL.ServerAlreadyUninstalled $ex) {
  126. out = $rh.createExceptionReply ();
  127. com.sun.corba.se.ActivationIDL.ServerAlreadyUninstalledHelper.write (out, $ex);
  128. }
  129. break;
  130. }
  131. // list registered servers
  132. case 6: // ActivationIDL/Repository/listRegisteredServers
  133. {
  134. int $result[] = null;
  135. $result = this.listRegisteredServers ();
  136. out = $rh.createReply();
  137. com.sun.corba.se.ActivationIDL.ServerIdsHelper.write (out, $result);
  138. break;
  139. }
  140. // servers.
  141. case 7: // ActivationIDL/Repository/getApplicationNames
  142. {
  143. String $result[] = null;
  144. $result = this.getApplicationNames ();
  145. out = $rh.createReply();
  146. com.sun.corba.se.ActivationIDL.RepositoryPackage.StringSeqHelper.write (out, $result);
  147. break;
  148. }
  149. // Find the ServerID associated with the given application name.
  150. case 8: // ActivationIDL/Repository/getServerID
  151. {
  152. try {
  153. String applicationName = in.read_string ();
  154. int $result = (int)0;
  155. $result = this.getServerID (applicationName);
  156. out = $rh.createReply();
  157. out.write_long ($result);
  158. } catch (com.sun.corba.se.ActivationIDL.ServerNotRegistered $ex) {
  159. out = $rh.createExceptionReply ();
  160. com.sun.corba.se.ActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
  161. }
  162. break;
  163. }
  164. default:
  165. throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
  166. }
  167. return out;
  168. } // _invoke
  169. // Type-specific CORBA::Object operations
  170. private static String[] __ids = {
  171. "IDL:ActivationIDL/Repository:1.0"};
  172. public String[] _ids ()
  173. {
  174. return (String[])__ids.clone ();
  175. }
  176. } // class _RepositoryImplBase