1. package org.omg.PortableServer;
  2. /**
  3. * org/omg/PortableServer/_ServantLocatorStub.java .
  4. * Generated by the IDL-to-Java compiler (portable), version "3.2"
  5. * from ../../../../src/share/classes/org/omg/PortableServer/poa.idl
  6. * Wednesday, September 15, 2004 10:28:41 AM GMT
  7. */
  8. /**
  9. * When the POA has the NON_RETAIN policy it uses servant
  10. * managers that are ServantLocators. Because the POA
  11. * knows that the servant returned by this servant
  12. * manager will be used only for a single request,
  13. * it can supply extra information to the servant
  14. * manager's operations and the servant manager's pair
  15. * of operations may be able to cooperate to do
  16. * something different than a ServantActivator.
  17. * When the POA uses the ServantLocator interface,
  18. * immediately after performing the operation invocation
  19. * on the servant returned by preinvoke, the POA will
  20. * invoke postinvoke on the servant manager, passing the
  21. * ObjectId value and the Servant value as parameters
  22. * (among others). This feature may be used to force
  23. * every request for objects associated with a POA to
  24. * be mediated by the servant manager.
  25. */
  26. public class _ServantLocatorStub extends org.omg.CORBA.portable.ObjectImpl implements org.omg.PortableServer.ServantLocator
  27. {
  28. final public static java.lang.Class _opsClass = ServantLocatorOperations.class;
  29. /**
  30. * This operations is used to get a servant that will be
  31. * used to process the request that caused preinvoke to
  32. * be called.
  33. * @param oid the object id associated with object on
  34. * which the request was made.
  35. * @param adapter the reference for POA in which the
  36. * object is being activated.
  37. * @param operation the operation name.
  38. * @param the_cookie an opaque value that can be set
  39. * by the servant manager to be used
  40. * during postinvoke.
  41. * @return Servant used to process incoming request.
  42. * @exception ForwardRequest to indicate to the ORB
  43. * that it is responsible for delivering
  44. * the current request and subsequent
  45. * requests to the object denoted in the
  46. * forward_reference member of the exception.
  47. */
  48. public org.omg.PortableServer.Servant preinvoke (byte[] oid, org.omg.PortableServer.POA adapter, String operation, org.omg.PortableServer.ServantLocatorPackage.CookieHolder the_cookie) throws org.omg.PortableServer.ForwardRequest
  49. {
  50. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("preinvoke", _opsClass);
  51. ServantLocatorOperations $self = (ServantLocatorOperations) $so.servant;
  52. try {
  53. return $self.preinvoke (oid, adapter, operation, the_cookie);
  54. } finally {
  55. _servant_postinvoke ($so);
  56. }
  57. } // preinvoke
  58. /**
  59. * This operation is invoked whenener a servant completes
  60. * a request.
  61. * @param oid the object id ssociated with object on which
  62. * the request was made.
  63. * @param adapter the reference for POA in which the
  64. * object was active.
  65. * @param the_cookie an opaque value that contains
  66. * the data set by preinvoke.
  67. * @param the_servant reference to the servant that is
  68. * associated with the object.
  69. */
  70. public void postinvoke (byte[] oid, org.omg.PortableServer.POA adapter, String operation, java.lang.Object the_cookie, org.omg.PortableServer.Servant the_servant)
  71. {
  72. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("postinvoke", _opsClass);
  73. ServantLocatorOperations $self = (ServantLocatorOperations) $so.servant;
  74. try {
  75. $self.postinvoke (oid, adapter, operation, the_cookie, the_servant);
  76. } finally {
  77. _servant_postinvoke ($so);
  78. }
  79. } // postinvoke
  80. // Type-specific CORBA::Object operations
  81. private static String[] __ids = {
  82. "IDL:omg.org/PortableServer/ServantLocator:1.0",
  83. "IDL:omg.org/PortableServer/ServantManager:1.0"};
  84. public String[] _ids ()
  85. {
  86. return (String[])__ids.clone ();
  87. }
  88. private void readObject (java.io.ObjectInputStream s) throws java.io.IOException
  89. {
  90. String str = s.readUTF ();
  91. String[] args = null;
  92. java.util.Properties props = null;
  93. org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init (args, props).string_to_object (str);
  94. org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate ();
  95. _set_delegate (delegate);
  96. }
  97. private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException
  98. {
  99. String[] args = null;
  100. java.util.Properties props = null;
  101. String str = org.omg.CORBA.ORB.init (args, props).object_to_string (this);
  102. s.writeUTF (str);
  103. }
  104. } // class _ServantLocatorStub