1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
|
// **********************************************************************
//
// Copyright (c) 2001
// MutableRealms, Inc.
// Huntsville, AL, USA
//
// All Rights Reserved
//
// **********************************************************************
#ifndef ICE_OBJECT_ADAPTER_ICE
#define ICE_OBJECT_ADAPTER_ICE
#include <Ice/CommunicatorF.ice>
#include <Ice/ServantLocatorF.ice>
module Ice
{
/**
*
* The Object Adapter, which is responsible for receiving requests
* from Endpoints, and for mapping between Servant, Identities, and
* Proxies.
*
* @see Communicator
* @see ServantLocator
*
**/
local interface ObjectAdapter
{
/**
*
* Get the name of this Object Adapter. The name is mainly used
* for configuration purposes with Properties.
*
* @return The name of this Object Adapter.
*
* @see Properties
*
**/
string getName();
/**
*
* Get the Communicator this Object Adapter belongs to.
*
* @return This Object Adapter's Communicator.
*
* @see Communicator
*
**/
Communicator getCommunicator();
/**
*
* Activate all Endpoints that belong to this Object
* Adapter. After activation, the Object Adapter can dispatch
* requests received through its Endpoints.
*
* @see hold
* @see deactivate
*
**/
void activate();
/**
*
* Temporarily hold receiving and dispatching requests. The Object
* Adapter can be reactivated with the [activate] operation.
*
* @see activate
* @see deactivate
*
**/
void hold();
/**
*
* Deactivate all Endpoints that belong to this Object
* Adapter. After deactivation, the Object Adapter stops receiving
* requests through its Endpoints. Object Adapter's that have been
* deactivated must not be reactivated again, i.e., the
* deactivation is permanent and [activate] or [hold] must not be
* called after calling [deactivate]. Attempting to do so results
* in an [ObjectAdapterDeactivatedException] being thrown. Calls
* to [deactivate] on an already deactivated Object Adapter are
* ignored.
*
* @see activate
* @see hold
* @see Communicator::shutdown
*
**/
void deactivate();
/**
*
* Add a Servant to this Object Adapter's Active Servant Map. Note
* that one Servant can implement several Ice Objects by
* registering the Servant with multiple identities.
*
* @param servant The Servant to add.
*
* @param identity The identity of the Ice Object that is
* implemented by the Servant.
*
* @return A Proxy that matches the given identity and this Object
* Adapter.
*
* @see addTemporary
* @see remove
*
**/
Object* add(Object servant, string identity);
/**
*
* Add a temporary Servant to this Object Adapter's Active Servant
* Map. "Temporary" means that the Ice Object implemented by the
* Servant does not have a fixed identity. Instead, a temporary
* identity is assigned by the Object Adapter. Such temporary
* identity is only valid for the lifetime of this Object Adapter,
* or until the Servant is removed with [remove].
*
* @param servant The Servant to add.
*
* @return A Proxy that matches the temporary identity and this
* Object Adapter.
*
* @see add
* @see remove
*
**/
Object* addTemporary(Object servant);
/**
*
* Remove a Servant from the Object Adapter's Active Servant Map.
*
* @param identity The identity of the Ice Object that is
* implemented by the Servant. If the Servant implements multiple
* Ice Objects, [remove] has to be called for all such Ice
* Objects.
*
* @see add
* @see addTemporary
*
**/
void remove(string identity);
/**
*
* Add a Servant Locator to this Object Adapter. If a locator has
* already been installed for the given prefix, the current
* locator for this prefix is replaced by the new one. To dispatch
* operation calls on Servants, the Object Adapter tries to find a
* Servant for a given Ice Object identity in the following order:
*
* <orderedlist>
*
* <listitem><para>The Object Adapter tries to find a Servant for
* the identity in the Active Servant Map.</para></listitem>
*
* <listitem><para>If no Servant has been found in the Active
* Servant Map, and the identity has the format
* "<replaceable>prefix</replaceable><literal>#</literal>", the
* Object Adapter tries to find a locator for this prefix. If a
* locator is found, the Object Adapter tries to find a Servant
* using this locator.</para></listitem>
*
* <listitem><para>If no Servant has been found by any of the
* preceding steps, the Object Adapter tries to find a locator
* with an empty prefix, regardless of the format of the identity,
* i.e., even if the identity contains a
* '<literal>#</literal>'. If a locator is found, the Object
* Adapter tries to find a Servant using this
* locator</para></listitem>
*
* <listitem><para>If no Servant has been found with any of the
* preceding steps, the Object Adapter gives up and the caller
* will receive an [ObjectNotExistException].</para></listitem>
*
* </orderedlist>
*
* <note><para>Only one locator for an empty prefix can be
* installed.</para></note>
*
* @param locator The locator to add.
*
* @param prefix The Ice Object identity prefix for which the
* Servant Locator can locate Servants.
*
* @see removeServantLocator
* @see findServantLocator
* @see ServantLocator
*
**/
void addServantLocator(ServantLocator locator, string prefix);
/**
*
* Remove a Servant locator from this Object Adapter. This
* operation does nothing if no locator for the given prefix has
* been installed.
*
* @param prefix The Ice Object identity prefix for which the
* Servant Locator can locate Servants.
*
* @see addServantLocator
* @see findServantLocator
* @see ServantLocator
*
**/
void removeServantLocator(string prefix);
/**
*
* Find a Servant Locator installed with this Object Adapter.
*
* @param prefix The Ice Object identity prefix for which the
* Servant Locator can locate Servants.
*
* @return The Servant Locator, or null if no Servant Locator was
* found for the given prefix.
*
* @see addServantLocator
* @see removeServantLocator
* @see ServantLocator
*
**/
ServantLocator findServantLocator(string prefix);
/**
*
* Look up a Servant in this Object Adapter's Active Servant Map
* by the identity of the Ice Object it implements.
*
* <note><para>This operation does only try to lookup a Servant in
* the Active Servant Map. It does not attempt to find a Servant
* by using any installed [ServantLocator].</para></note>
*
* @param identity The identity of the Ice Object for which the
* Servant should be returned.
*
* @return The Servant that implements the Ice Object with the
* given identity, or null if no such Servant has been found.
*
* see proxyToServant
*
**/
Object identityToServant(string identity);
/**
*
* Look up a Servant in this Object Adapter's Active Servant Map,
* given a Proxy.
*
* <note><para>This operation does only try to lookup a Servant in
* the Active Servant Map. It does not attempt to find a Servant
* via any installed [ServantLocator]s.</para></note>
*
* @param Proxy The proxy for which the Servant should be returned.
*
* @return The Servant that matches the Proxy, or null if no such
* Servant has been found.
*
* see identityToServant
*
**/
Object proxyToServant(Object* proxy);
/**
*
* Create a Proxy that matches this Object Adapter and the given
* identity.
*
* @param identity The identity for which a Proxy is to be created.
*
* @return A Proxy that matches the given identity and this Object
* Adapter.
*
**/
Object* createProxy(string identity);
};
};
#endif
|