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