View Javadoc
1   /*
2    * Copyright (c) 2001, 2004, 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  
26  package com.sun.corba.se.pept.protocol;
27  
28  import com.sun.corba.se.pept.broker.Broker;
29  import com.sun.corba.se.pept.encoding.InputObject;
30  import com.sun.corba.se.pept.encoding.OutputObject;
31  import com.sun.corba.se.pept.transport.Connection;
32  import com.sun.corba.se.pept.transport.ContactInfo;
33  
34  import java.io.IOException;
35  
36  /**
37   * <code>MessageMediator</code> is a central repository for artifacts
38   * associated with an individual message.
39   *
40   * @author Harold Carr
41   */
42  public interface MessageMediator
43  {
44      /**
45       * The {@link com.sun.corba.se.pept.broker.Broker Broker} associated
46       * with an invocation.
47       *
48       * @return {@link com.sun.corba.se.pept.broker.Broker Broker}
49       */
50      public Broker getBroker();
51  
52      /**
53       * Get the
54       * {@link com.sun.corba.se.pept.transport.ContactInfo ContactInfo}
55       * which created this <code>MessageMediator</code>.
56       *
57       * @return
58       * {@link com.sun.corba.se.pept.transport.ContactInfo ContactInfo}
59       */
60      public ContactInfo getContactInfo();
61  
62      /**
63       * Get the
64       * {@link com.sun.corba.se.pept.transport.Connection Connection}
65       * on which this message is sent or received.
66       */
67      public Connection getConnection();
68  
69      /**
70       * Used to initialize message headers.
71       *
72       * Note: this should be moved to a <code>RequestDispatcher</code>.
73       */
74      public void initializeMessage();
75  
76      /**
77       * Used to send the message (or its last fragment).
78       *
79       * Note: this should be moved to a <code>RequestDispatcher</code>.
80       */
81      public void finishSendingRequest();
82  
83      /**
84       * Used to wait for a response for synchronous messages.
85       *
86       * @deprecated
87       */
88      @Deprecated
89      public InputObject waitForResponse();
90  
91      /**
92       * Used to set the
93       * {@link com.sun.corba.se.pept.encoding.OutputObject OutputObject}
94       * used for the message.
95       *
96       * @param outputObject
97       */
98      public void setOutputObject(OutputObject outputObject);
99  
100     /**
101      * Used to get the
102      * {@link com.sun.corba.se.pept.encoding.OutputObject OutputObject}
103      * used for the message.
104      *
105      * @return
106      * {@link com.sun.corba.se.pept.encoding.OutputObject OutputObject}
107      */
108     public OutputObject getOutputObject();
109 
110     /**
111      * Used to set the
112      * {@link com.sun.corba.se.pept.encoding.InputObject InputObject}
113      * used for the message.
114      *
115      * @param inputObject
116      */
117     public void setInputObject(InputObject inputObject);
118 
119     /**
120      * Used to get the
121      * {@link com.sun.corba.se.pept.encoding.InputObject InputObject}
122      * used for the message.
123      *
124      * @return
125      * {@link com.sun.corba.se.pept.encoding.InputObject InputObject}
126      */
127     public InputObject getInputObject();
128 }
129 
130 // End of file.