01: /*
02: * Copyright 1998-1999 Sun Microsystems, Inc. All Rights Reserved.
03: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
04: *
05: * This code is free software; you can redistribute it and/or modify it
06: * under the terms of the GNU General Public License version 2 only, as
07: * published by the Free Software Foundation. Sun designates this
08: * particular file as subject to the "Classpath" exception as provided
09: * by Sun in the LICENSE file that accompanied this code.
10: *
11: * This code is distributed in the hope that it will be useful, but WITHOUT
12: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14: * version 2 for more details (a copy is included in the LICENSE file that
15: * accompanied this code).
16: *
17: * You should have received a copy of the GNU General Public License version
18: * 2 along with this work; if not, write to the Free Software Foundation,
19: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20: *
21: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22: * CA 95054 USA or visit www.sun.com if you need additional information or
23: * have any questions.
24: */
25: package org.omg.CORBA.portable;
26:
27: /**
28: This interface provides a dispatching mechanism for an incoming call.
29: It is invoked by the ORB to dispatch a request to a servant.
30: */
31:
32: public interface InvokeHandler {
33: /**
34: * Invoked by the ORB to dispatch a request to the servant.
35: *
36: * ORB passes the method name, an InputStream containing the
37: * marshalled arguments, and a ResponseHandler which the servant
38: * uses to construct a proper reply.
39: *
40: * Only CORBA SystemException may be thrown by this method.
41: *
42: * The method must return an OutputStream created by the
43: * ResponseHandler which contains the marshalled reply.
44: *
45: * A servant must not retain a reference to the ResponseHandler
46: * beyond the lifetime of a method invocation.
47: *
48: * Servant behaviour is defined as follows:
49: * <p>1. Determine correct method, and unmarshal parameters from
50: * InputStream.
51: * <p>2. Invoke method implementation.
52: * <p>3. If no user exception, create a normal reply using
53: * ResponseHandler.
54: * <p>4. If user exception occurred, create exception reply using
55: * ResponseHandler.
56: * <p>5. Marshal reply into OutputStream returned by
57: * ResponseHandler.
58: * <p>6. Return OutputStream to ORB.
59: * <p>
60: * @param method The method name.
61: * @param input The <code>InputStream</code> containing the marshalled arguments.
62: * @param handler The <code>ResponseHandler</code> which the servant uses
63: * to construct a proper reply
64: * @return The <code>OutputStream</code> created by the
65: * ResponseHandler which contains the marshalled reply
66: * @throws SystemException is thrown when invocation fails due to a CORBA system exception.
67: */
68:
69: OutputStream _invoke(String method, InputStream input,
70: ResponseHandler handler)
71: throws org.omg.CORBA.SystemException;
72: }
|