1. package com.sun.corba.se.PortableActivationIDL;
  2. /**
  3. * com/sun/corba/se/PortableActivationIDL/_LocatorImplBase.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 abstract class _LocatorImplBase extends org.omg.CORBA.portable.ObjectImpl
  9. implements com.sun.corba.se.PortableActivationIDL.Locator, org.omg.CORBA.portable.InvokeHandler
  10. {
  11. // Constructors
  12. public _LocatorImplBase ()
  13. {
  14. }
  15. private static java.util.Hashtable _methods = new java.util.Hashtable ();
  16. static
  17. {
  18. _methods.put ("locateServer", new java.lang.Integer (0));
  19. _methods.put ("locateServerForORB", new java.lang.Integer (1));
  20. _methods.put ("getEndpoint", new java.lang.Integer (2));
  21. _methods.put ("getServerPortForType", new java.lang.Integer (3));
  22. }
  23. public org.omg.CORBA.portable.OutputStream _invoke (String $method,
  24. org.omg.CORBA.portable.InputStream in,
  25. org.omg.CORBA.portable.ResponseHandler $rh)
  26. {
  27. org.omg.CORBA.portable.OutputStream out = null;
  28. java.lang.Integer __method = (java.lang.Integer)_methods.get ($method);
  29. if (__method == null)
  30. throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
  31. switch (__method.intValue ())
  32. {
  33. /** locate server - returns the port with a specific type for all registered
  34. * ORBs of an active server.
  35. * Starts the server if it is not already running.
  36. */
  37. case 0: // PortableActivationIDL/Locator/locateServer
  38. {
  39. try {
  40. String serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
  41. String endPoint = in.read_string ();
  42. com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerType $result = null;
  43. $result = this.locateServer (serverId, endPoint);
  44. out = $rh.createReply();
  45. com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerTypeHelper.write (out, $result);
  46. } catch (com.sun.corba.se.PortableActivationIDL.NoSuchEndPoint $ex) {
  47. out = $rh.createExceptionReply ();
  48. com.sun.corba.se.PortableActivationIDL.NoSuchEndPointHelper.write (out, $ex);
  49. } catch (com.sun.corba.se.PortableActivationIDL.ServerNotRegistered $ex) {
  50. out = $rh.createExceptionReply ();
  51. com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
  52. } catch (com.sun.corba.se.PortableActivationIDL.ServerHeldDown $ex) {
  53. out = $rh.createExceptionReply ();
  54. com.sun.corba.se.PortableActivationIDL.ServerHeldDownHelper.write (out, $ex);
  55. }
  56. break;
  57. }
  58. /** locate server - returns all ports registered with a specified ORB for
  59. * an active server
  60. * Starts the server if it is not already running.
  61. */
  62. case 1: // PortableActivationIDL/Locator/locateServerForORB
  63. {
  64. try {
  65. String serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
  66. String orbId = org.omg.PortableInterceptor.ORBIdHelper.read (in);
  67. com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORB $result = null;
  68. $result = this.locateServerForORB (serverId, orbId);
  69. out = $rh.createReply();
  70. com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORBHelper.write (out, $result);
  71. } catch (com.sun.corba.se.PortableActivationIDL.InvalidORBid $ex) {
  72. out = $rh.createExceptionReply ();
  73. com.sun.corba.se.PortableActivationIDL.InvalidORBidHelper.write (out, $ex);
  74. } catch (com.sun.corba.se.PortableActivationIDL.ServerNotRegistered $ex) {
  75. out = $rh.createExceptionReply ();
  76. com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
  77. } catch (com.sun.corba.se.PortableActivationIDL.ServerHeldDown $ex) {
  78. out = $rh.createExceptionReply ();
  79. com.sun.corba.se.PortableActivationIDL.ServerHeldDownHelper.write (out, $ex);
  80. }
  81. break;
  82. }
  83. /** get the port for the endpoint of the locator
  84. */
  85. case 2: // PortableActivationIDL/Locator/getEndpoint
  86. {
  87. try {
  88. String endPointType = in.read_string ();
  89. int $result = (int)0;
  90. $result = this.getEndpoint (endPointType);
  91. out = $rh.createReply();
  92. out.write_long ($result);
  93. } catch (com.sun.corba.se.PortableActivationIDL.NoSuchEndPoint $ex) {
  94. out = $rh.createExceptionReply ();
  95. com.sun.corba.se.PortableActivationIDL.NoSuchEndPointHelper.write (out, $ex);
  96. }
  97. break;
  98. }
  99. /** Useful from external BadServerIdHandlers which need
  100. * to pick a particular port type.
  101. */
  102. case 3: // PortableActivationIDL/Locator/getServerPortForType
  103. {
  104. try {
  105. com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORB location = com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORBHelper.read (in);
  106. String endPointType = in.read_string ();
  107. int $result = (int)0;
  108. $result = this.getServerPortForType (location, endPointType);
  109. out = $rh.createReply();
  110. out.write_long ($result);
  111. } catch (com.sun.corba.se.PortableActivationIDL.NoSuchEndPoint $ex) {
  112. out = $rh.createExceptionReply ();
  113. com.sun.corba.se.PortableActivationIDL.NoSuchEndPointHelper.write (out, $ex);
  114. }
  115. break;
  116. }
  117. default:
  118. throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
  119. }
  120. return out;
  121. } // _invoke
  122. // Type-specific CORBA::Object operations
  123. private static String[] __ids = {
  124. "IDL:PortableActivationIDL/Locator:1.0"};
  125. public String[] _ids ()
  126. {
  127. return (String[])__ids.clone ();
  128. }
  129. } // class _LocatorImplBase