1. /*
  2. * @(#)InvokeHandler.java 1.11 00/02/02
  3. *
  4. * Copyright 1998-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package org.omg.CORBA.portable;
  11. /**
  12. This interface provides a dispatching mechanism for an incoming call.
  13. It is invoked by the ORB to dispatch a request to a servant.
  14. */
  15. public interface InvokeHandler {
  16. /**
  17. * Invoked by the ORB to dispatch a request to the servant.
  18. *
  19. * ORB passes the method name, an InputStream containing the
  20. * marshalled arguments, and a ResponseHandler which the servant
  21. * uses to construct a proper reply.
  22. *
  23. * Only CORBA SystemException may be thrown by this method.
  24. *
  25. * The method must return an OutputStream created by the
  26. * ResponseHandler which contains the marshalled reply.
  27. *
  28. * A servant must not retain a reference to the ResponseHandler
  29. * beyond the lifetime of a method invocation.
  30. *
  31. * Servant behaviour is defined as follows:
  32. * <p>1. Determine correct method, and unmarshal parameters from
  33. * InputStream.
  34. * <p>2. Invoke method implementation.
  35. * <p>3. If no user exception, create a normal reply using
  36. * ResponseHandler.
  37. * <p>4. If user exception occurred, create exception reply using
  38. * ResponseHandler.
  39. * <p>5. Marshal reply into OutputStream returned by
  40. * ResponseHandler.
  41. * <p>6. Return OutputStream to ORB.
  42. * <p>
  43. * @param method The method name.
  44. * @param input The <code>InputStream</code> containing the marshalled arguments.
  45. * @param handler The <code>ResponseHandler</code> which the servant uses
  46. * to construct a proper reply
  47. * @return The <code>OutputStream</code> created by the
  48. * ResponseHandler which contains the marshalled reply
  49. * @throws SystemException is thrown when invocation fails due to a CORBA system exception.
  50. */
  51. OutputStream _invoke(String method, InputStream input,
  52. ResponseHandler handler)
  53. throws org.omg.CORBA.SystemException;
  54. }