1. package com.sun.corba.se.spi.activation;
  2. /**
  3. * com/sun/corba/se/spi/activation/_LocatorImplBase.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 abstract class _LocatorImplBase extends org.omg.CORBA.portable.ObjectImpl
  9. implements com.sun.corba.se.spi.activation.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. // Starts the server if it is not already running.
  34. case 0: // activation/Locator/locateServer
  35. {
  36. try {
  37. int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in);
  38. String endPoint = in.read_string ();
  39. com.sun.corba.se.spi.activation.LocatorPackage.ServerLocation $result = null;
  40. $result = this.locateServer (serverId, endPoint);
  41. out = $rh.createReply();
  42. com.sun.corba.se.spi.activation.LocatorPackage.ServerLocationHelper.write (out, $result);
  43. } catch (com.sun.corba.se.spi.activation.NoSuchEndPoint $ex) {
  44. out = $rh.createExceptionReply ();
  45. com.sun.corba.se.spi.activation.NoSuchEndPointHelper.write (out, $ex);
  46. } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) {
  47. out = $rh.createExceptionReply ();
  48. com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex);
  49. } catch (com.sun.corba.se.spi.activation.ServerHeldDown $ex) {
  50. out = $rh.createExceptionReply ();
  51. com.sun.corba.se.spi.activation.ServerHeldDownHelper.write (out, $ex);
  52. }
  53. break;
  54. }
  55. // Starts the server if it is not already running.
  56. case 1: // activation/Locator/locateServerForORB
  57. {
  58. try {
  59. int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in);
  60. String orbId = com.sun.corba.se.spi.activation.ORBidHelper.read (in);
  61. com.sun.corba.se.spi.activation.LocatorPackage.ServerLocationPerORB $result = null;
  62. $result = this.locateServerForORB (serverId, orbId);
  63. out = $rh.createReply();
  64. com.sun.corba.se.spi.activation.LocatorPackage.ServerLocationPerORBHelper.write (out, $result);
  65. } catch (com.sun.corba.se.spi.activation.InvalidORBid $ex) {
  66. out = $rh.createExceptionReply ();
  67. com.sun.corba.se.spi.activation.InvalidORBidHelper.write (out, $ex);
  68. } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) {
  69. out = $rh.createExceptionReply ();
  70. com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex);
  71. } catch (com.sun.corba.se.spi.activation.ServerHeldDown $ex) {
  72. out = $rh.createExceptionReply ();
  73. com.sun.corba.se.spi.activation.ServerHeldDownHelper.write (out, $ex);
  74. }
  75. break;
  76. }
  77. // get the port for the endpoint of the locator
  78. case 2: // activation/Locator/getEndpoint
  79. {
  80. try {
  81. String endPointType = in.read_string ();
  82. int $result = (int)0;
  83. $result = this.getEndpoint (endPointType);
  84. out = $rh.createReply();
  85. out.write_long ($result);
  86. } catch (com.sun.corba.se.spi.activation.NoSuchEndPoint $ex) {
  87. out = $rh.createExceptionReply ();
  88. com.sun.corba.se.spi.activation.NoSuchEndPointHelper.write (out, $ex);
  89. }
  90. break;
  91. }
  92. // to pick a particular port type.
  93. case 3: // activation/Locator/getServerPortForType
  94. {
  95. try {
  96. com.sun.corba.se.spi.activation.LocatorPackage.ServerLocationPerORB location = com.sun.corba.se.spi.activation.LocatorPackage.ServerLocationPerORBHelper.read (in);
  97. String endPointType = in.read_string ();
  98. int $result = (int)0;
  99. $result = this.getServerPortForType (location, endPointType);
  100. out = $rh.createReply();
  101. out.write_long ($result);
  102. } catch (com.sun.corba.se.spi.activation.NoSuchEndPoint $ex) {
  103. out = $rh.createExceptionReply ();
  104. com.sun.corba.se.spi.activation.NoSuchEndPointHelper.write (out, $ex);
  105. }
  106. break;
  107. }
  108. default:
  109. throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
  110. }
  111. return out;
  112. } // _invoke
  113. // Type-specific CORBA::Object operations
  114. private static String[] __ids = {
  115. "IDL:activation/Locator:1.0"};
  116. public String[] _ids ()
  117. {
  118. return (String[])__ids.clone ();
  119. }
  120. } // class _LocatorImplBase