ClientRequestDispatcher.java revision 608:7e06bf1dcb09
1/*
2 * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.  Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26package com.sun.corba.se.pept.protocol;
27
28import com.sun.corba.se.pept.broker.Broker;
29import com.sun.corba.se.pept.encoding.InputObject;
30import com.sun.corba.se.pept.encoding.OutputObject;
31import com.sun.corba.se.pept.transport.ContactInfo;
32
33/**
34 * <code>ClientRequestDispatcher</code> coordinates the request (and possible
35 * response) processing for a specific <em>protocol</em>.
36 *
37 * @author Harold Carr
38 */
39public interface ClientRequestDispatcher
40{
41    /**
42     * At the beginning of a request the presentation block uses this
43     * to obtain an
44     * {@link com.sun.corba.se.pept.encoding.OutputObject OutputObject}
45     * to set data to be sent on a message.
46     *
47     * @param self -
48     * @param methodName - the remote method name
49     * @param isOneWay - <code>true</code> if the message is asynchronous
50     * @param contactInfo - the
51     * {@link com.sun.corba.se.pept.transport.ContactInfo ContactInfo}
52     * which which created/chose this <code>ClientRequestDispatcher</code>
53     *
54     * @return
55     * {@link com.sun.corba.se.pept.encoding.OutputObject OutputObject}
56     */
57    public OutputObject beginRequest(Object self,
58                                     String methodName,
59                                     boolean isOneWay,
60                                     ContactInfo contactInfo);
61
62    /**
63     * After the presentation block has set data on the
64     * {@link com.sun.corba.se.pept.encoding.OutputObject OutputObject}
65     * it signals the PEPt runtime to send the encoded data by calling this
66     * method.
67     *
68     * @param self -
69     * @param outputObject
70     *
71     * @return
72     * {@link com.sun.corba.se.pept.encoding.InputObject InputObject}
73     * if the message is synchronous.
74     *
75     * @throws
76     * {@link org.omg.CORBA.portable.ApplicationException ApplicationException}
77     * if the remote side raises an exception declared in the remote interface.
78     *
79     * @throws
80     * {@link org.omg.CORBA.portable.RemarshalException RemarshalException}
81     * if the PEPt runtime would like the presentation block to start over.
82     */
83    public InputObject marshalingComplete(java.lang.Object self,
84                                          OutputObject outputObject)
85    // REVISIT EXCEPTIONS
86        throws
87            org.omg.CORBA.portable.ApplicationException,
88            org.omg.CORBA.portable.RemarshalException;
89
90    /**
91     * After the presentation block completes a request it signals
92     * the PEPt runtime by calling this method.
93     *
94     * This method may release resources.  In some cases it may cause
95     * control or error messages to be sent.
96     *
97     * @param broker -
98     * @param inputObject -
99     */
100    public void endRequest(Broker broker,
101                           java.lang.Object self,
102                           InputObject inputObject);
103}
104
105// End of file.
106