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