1. package com.sun.corba.se.PortableActivationIDL;
  2. /**
  3. * com/sun/corba/se/PortableActivationIDL/_LocatorStub.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 _LocatorStub extends org.omg.CORBA.portable.ObjectImpl implements com.sun.corba.se.PortableActivationIDL.Locator
  9. {
  10. /** locate server - returns the port with a specific type for all registered
  11. * ORBs of an active server.
  12. * Starts the server if it is not already running.
  13. */
  14. public com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerType locateServer (String serverId, String endPoint) throws com.sun.corba.se.PortableActivationIDL.NoSuchEndPoint, com.sun.corba.se.PortableActivationIDL.ServerNotRegistered, com.sun.corba.se.PortableActivationIDL.ServerHeldDown
  15. {
  16. org.omg.CORBA.portable.InputStream $in = null;
  17. try {
  18. org.omg.CORBA.portable.OutputStream $out = _request ("locateServer", true);
  19. org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId);
  20. $out.write_string (endPoint);
  21. $in = _invoke ($out);
  22. com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerType $result = com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerTypeHelper.read ($in);
  23. return $result;
  24. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  25. $in = $ex.getInputStream ();
  26. String _id = $ex.getId ();
  27. if (_id.equals ("IDL:PortableActivationIDL/NoSuchEndPoint:1.0"))
  28. throw com.sun.corba.se.PortableActivationIDL.NoSuchEndPointHelper.read ($in);
  29. else if (_id.equals ("IDL:PortableActivationIDL/ServerNotRegistered:1.0"))
  30. throw com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.read ($in);
  31. else if (_id.equals ("IDL:PortableActivationIDL/ServerHeldDown:1.0"))
  32. throw com.sun.corba.se.PortableActivationIDL.ServerHeldDownHelper.read ($in);
  33. else
  34. throw new org.omg.CORBA.MARSHAL (_id);
  35. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  36. return locateServer (serverId, endPoint );
  37. } finally {
  38. _releaseReply ($in);
  39. }
  40. } // locateServer
  41. /** locate server - returns all ports registered with a specified ORB for
  42. * an active server
  43. * Starts the server if it is not already running.
  44. */
  45. public com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORB locateServerForORB (String serverId, String orbId) throws com.sun.corba.se.PortableActivationIDL.InvalidORBid, com.sun.corba.se.PortableActivationIDL.ServerNotRegistered, com.sun.corba.se.PortableActivationIDL.ServerHeldDown
  46. {
  47. org.omg.CORBA.portable.InputStream $in = null;
  48. try {
  49. org.omg.CORBA.portable.OutputStream $out = _request ("locateServerForORB", true);
  50. org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId);
  51. org.omg.PortableInterceptor.ORBIdHelper.write ($out, orbId);
  52. $in = _invoke ($out);
  53. com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORB $result = com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORBHelper.read ($in);
  54. return $result;
  55. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  56. $in = $ex.getInputStream ();
  57. String _id = $ex.getId ();
  58. if (_id.equals ("IDL:PortableActivationIDL/InvalidORBid:1.0"))
  59. throw com.sun.corba.se.PortableActivationIDL.InvalidORBidHelper.read ($in);
  60. else if (_id.equals ("IDL:PortableActivationIDL/ServerNotRegistered:1.0"))
  61. throw com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.read ($in);
  62. else if (_id.equals ("IDL:PortableActivationIDL/ServerHeldDown:1.0"))
  63. throw com.sun.corba.se.PortableActivationIDL.ServerHeldDownHelper.read ($in);
  64. else
  65. throw new org.omg.CORBA.MARSHAL (_id);
  66. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  67. return locateServerForORB (serverId, orbId );
  68. } finally {
  69. _releaseReply ($in);
  70. }
  71. } // locateServerForORB
  72. /** get the port for the endpoint of the locator
  73. */
  74. public int getEndpoint (String endPointType) throws com.sun.corba.se.PortableActivationIDL.NoSuchEndPoint
  75. {
  76. org.omg.CORBA.portable.InputStream $in = null;
  77. try {
  78. org.omg.CORBA.portable.OutputStream $out = _request ("getEndpoint", true);
  79. $out.write_string (endPointType);
  80. $in = _invoke ($out);
  81. int $result = com.sun.corba.se.PortableActivationIDL.TCPPortHelper.read ($in);
  82. return $result;
  83. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  84. $in = $ex.getInputStream ();
  85. String _id = $ex.getId ();
  86. if (_id.equals ("IDL:PortableActivationIDL/NoSuchEndPoint:1.0"))
  87. throw com.sun.corba.se.PortableActivationIDL.NoSuchEndPointHelper.read ($in);
  88. else
  89. throw new org.omg.CORBA.MARSHAL (_id);
  90. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  91. return getEndpoint (endPointType );
  92. } finally {
  93. _releaseReply ($in);
  94. }
  95. } // getEndpoint
  96. /** Useful from external BadServerIdHandlers which need
  97. * to pick a particular port type.
  98. */
  99. public int getServerPortForType (com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORB location, String endPointType) throws com.sun.corba.se.PortableActivationIDL.NoSuchEndPoint
  100. {
  101. org.omg.CORBA.portable.InputStream $in = null;
  102. try {
  103. org.omg.CORBA.portable.OutputStream $out = _request ("getServerPortForType", true);
  104. com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORBHelper.write ($out, location);
  105. $out.write_string (endPointType);
  106. $in = _invoke ($out);
  107. int $result = com.sun.corba.se.PortableActivationIDL.TCPPortHelper.read ($in);
  108. return $result;
  109. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  110. $in = $ex.getInputStream ();
  111. String _id = $ex.getId ();
  112. if (_id.equals ("IDL:PortableActivationIDL/NoSuchEndPoint:1.0"))
  113. throw com.sun.corba.se.PortableActivationIDL.NoSuchEndPointHelper.read ($in);
  114. else
  115. throw new org.omg.CORBA.MARSHAL (_id);
  116. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  117. return getServerPortForType (location, endPointType );
  118. } finally {
  119. _releaseReply ($in);
  120. }
  121. } // getServerPortForType
  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. private void readObject (java.io.ObjectInputStream s) throws java.io.IOException
  130. {
  131. String str = s.readUTF ();
  132. String[] args = null;
  133. java.util.Properties props = null;
  134. org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init (args, props).string_to_object (str);
  135. org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate ();
  136. _set_delegate (delegate);
  137. }
  138. private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException
  139. {
  140. String[] args = null;
  141. java.util.Properties props = null;
  142. String str = org.omg.CORBA.ORB.init (args, props).object_to_string (this);
  143. s.writeUTF (str);
  144. }
  145. } // class _LocatorStub