KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > pept > transport > ContactInfo


1 /*
2  * @(#)ContactInfo.java 1.23 04/06/21
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package com.sun.corba.se.pept.transport;
9
10 import com.sun.corba.se.pept.broker.Broker;
11 import com.sun.corba.se.pept.encoding.InputObject;
12 import com.sun.corba.se.pept.encoding.OutputObject;
13 import com.sun.corba.se.pept.protocol.MessageMediator;
14 import com.sun.corba.se.pept.protocol.ClientRequestDispatcher;
15 import com.sun.corba.se.pept.transport.ConnectionCache;
16
17 /**
18  * <p>The <b><em>primary</em></b> PEPt client-side plug-in point and enabler
19  * for <b><em>altenate encodings, protocols and transports</em></b>.</p>
20  *
21  * <p><code>ContactInfo</code> is a <em>factory</em> for client-side
22  * artifacts used
23  * to construct and send a message (and possibly receive and process a
24  * response).</p>
25  *
26  * @author Harold Carr
27  */

28 public interface ContactInfo
29 {
30     /**
31      * The {@link com.sun.corba.se.pept.broker.Broker Broker} associated
32      * with an invocation.
33      *
34      * @return {@link com.sun.corba.se.pept.broker.Broker Broker}
35      */

36     public Broker getBroker();
37
38     /**
39      * The parent
40      * {@link com.sun.corba.se.pept.broker.ContactInfoList ContactInfoList}
41      * for this <code>ContactInfo</code>.
42      *
43      * @return
44      * {@link com.sun.corba.se.pept.broker.ContactInfoList ContactInfoList}
45      */

46     public ContactInfoList getContactInfoList();
47
48     /**
49      * Used to get a
50      * {@link com.sun.corba.se.pept.protocol.ClientRequestDispatcher
51      * ClientRequestDispatcher}
52      * used to handle the specific <em>protocol</em> represented by this
53      * <code>ContactInfo</code>.
54      *
55      * @return
56      * {@link com.sun.corba.se.pept.protocol.ClientRequestDispatcher
57      * ClientRequestDispatcher} */

58     public ClientRequestDispatcher getClientRequestDispatcher();
59
60     /**
61      * Used to determine if a
62      * {@link com.sun.corba.se.pept.transport.Connection Connection}
63      * will be present in an invocation.
64      *
65      * For example, it may be
66      * <code>false</code> in the case of shared-memory
67      * <code>Input/OutputObjects</code>.
68      *
69      * @return <code>true</code> if a
70      * {@link com.sun.corba.se.pept.transport.Connection Connection}
71      * will be used for an invocation.
72      */

73     public boolean isConnectionBased();
74
75     /**
76      * Used to determine if the
77      * {@link com.sun.corba.se.pept.transport.Connection Connection}
78      * used for a request should be cached.
79      *
80      * If <code>true</code> then PEPt will attempt to reuse an existing
81      * {@link com.sun.corba.se.pept.transport.Connection Connection}. If
82      * one is not found it will create a new one and cache it for future use.
83      *
84      *
85      * @return <code>true</code> if
86      * {@link com.sun.corba.se.pept.transport.Connection Connection}s
87      * created by this <code>ContactInfo</code> should be cached.
88      */

89     public boolean shouldCacheConnection();
90
91     /**
92      * PEPt uses separate caches for each type of <code>ContactInfo</code>
93      * as given by <code>getConnectionCacheType</code>.
94      *
95      * @return {@link java.lang.String}
96      */

97     public String JavaDoc getConnectionCacheType();
98
99     /**
100      * Set the
101      * {@link com.sun.corba.se.pept.transport.Outbound.ConnectionCache OutboundConnectionCache}
102      * to be used by this <code>ContactInfo</code>.
103      *
104      * PEPt uses separate caches for each type of <code>ContactInfo</code>
105      * as given by {@link #getConnectionCacheType}.
106      * {@link #setConnectionCache} and {@link #getConnectionCache} support
107      * an optimzation to avoid hashing to find that cache.
108      *
109      * @param connectionCache.
110      */

111     public void setConnectionCache(OutboundConnectionCache connectionCache);
112
113     /**
114      * Get the
115      * {@link com.sun.corba.se.pept.transport.Outbound.ConnectionCache OutboundConnectionCache}
116      * used by this <code>ContactInfo</code>
117      *
118      * PEPt uses separate caches for each type of <code>ContactInfo</code>
119      * as given by {@link #getConnectionCacheType}.
120      * {@link #setConnectionCache} and {@link #getConnectionCache} support
121      * an optimzation to avoid hashing to find that cache.
122      *
123      * @return
124      * {@link com.sun.corba.se.pept.transport.ConnectionCache ConnectionCache}
125      */

126     public OutboundConnectionCache getConnectionCache();
127
128     /**
129      * Used to get a
130      * {@link com.sun.corba.se.pept.transport.Connection Connection}
131      * to send and receive messages on the specific <em>transport</em>
132      * represented by this <code>ContactInfo</code>.
133      *
134      * @return
135      * {@link com.sun.corba.se.pept.transport.Connection Connection}
136      */

137     public Connection createConnection();
138
139     /**
140      * Used to get a
141      * {@link com.sun.corba.se.pept.protocol.MessageMeidator MessageMediator}
142      * to hold internal data for a message to be sent using the specific
143      * encoding, protocol, transport combination represented by this
144      * <code>ContactInfo</code>.
145      *
146      * @return
147      * {@link com.sun.corba.se.pept.protocol.MessageMediator MessageMediator}
148      */

149     public MessageMediator createMessageMediator(Broker broker,
150                          ContactInfo contactInfo,
151                          Connection connection,
152                          String JavaDoc methodName,
153                          boolean isOneWay);
154
155     /**
156      * Used to get a
157      * {@link com.sun.corba.se.pept.protocol.MessageMeidator MessageMediator}
158      * to hold internal data for a message received using the specific
159      * encoding, protocol, transport combination represented by this
160      * <code>ContactInfo</code>.
161      *
162      * @return
163      * {@link com.sun.corba.se.pept.protocol.MessageMeidator MessageMediator}
164      */

165     public MessageMediator createMessageMediator(Broker broker,
166                          Connection connection);
167
168     /**
169      * Used to finish creating a
170      * {@link com.sun.corba.se.pept.protocol.MessageMeidator MessageMediator}
171      * with internal data for a message received using the specific
172      * encoding, protocol, transport combination represented by this
173      * <code>ContactInfo</code>.
174      *
175      * @return
176      * {@link com.sun.corba.se.pept.protocol.MessageMediator MessageMediator}
177      */

178     public MessageMediator finishCreatingMessageMediator(Broker broker,
179                                                          Connection connection,
180                                  MessageMediator messageMediator);
181
182     /**
183      * Used to get a
184      * {@link com.sun.corba.se.pept.encoding.InputObject InputObject}
185      * for the specific <em>encoding</em> represented by this
186      * <code>ContactInfo</code>.
187      *
188      * @return
189      * {@link com.sun.corba.se.pept.encoding.InputObject InputObject}
190      */

191     public InputObject createInputObject(Broker broker,
192                      MessageMediator messageMediator);
193
194     /**
195      * Used to get a
196      * {@link com.sun.corba.se.pept.encoding.OutputObject OutputObject}
197      * for the specific <em>encoding</em> represented by this
198      * <code>ContactInfo</code>.
199      *
200      * @return
201      * {@link com.sun.corba.se.pept.encoding.OutputObject OutputObject}
202      */

203     public OutputObject createOutputObject(MessageMediator messageMediator);
204
205     /**
206      * Used to lookup artifacts associated with this <code>ContactInfo</code>.
207      *
208      * @return the hash value.
209      */

210     public int hashCode();
211 }
212
213 // End of file.
214

215
216
Popular Tags