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
290
291
292
293
294
295
296
297
298
299
|
// **********************************************************************
//
// 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>
#include <Ice/Identity.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 Identity
* @see addTemporary
* @see remove
*
**/
Object* add(Object servant, Identity 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 Identity
* @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 Identity
* @see add
* @see addTemporary
*
**/
void remove(Identity identity);
/**
*
* Add a Servant Locator to this Object Adapter. If a locator has
* already been installed for the given category, the current
* locator for this category 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, the Object Adapter tries to find a locator for the
* category component of the identity. 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 for
* an empty category, regardless of the category contained in the
* identity. 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 category can be
* installed.</para></note>
*
* @param locator The locator to add.
*
* @param category The category for which the Servant Locator can
* locate Servants, or an empty string if the Servant Locator does
* not belong to any category.
*
* @see Identity
* @see removeServantLocator
* @see findServantLocator
* @see ServantLocator
*
**/
void addServantLocator(ServantLocator locator, string category);
/**
*
* Remove a Servant locator from this Object Adapter. This
* operation does nothing if no locator for the given category has
* been installed.
*
* @param category The category for which the Servant Locator can
* locate Servants, or an empty string if the Servant Locator does
* not belong to any category.
*
* @see Identity
* @see addServantLocator
* @see findServantLocator
* @see ServantLocator
*
**/
void removeServantLocator(string category);
/**
*
* Find a Servant Locator installed with this Object Adapter.
*
* @param category The category for which the Servant Locator can
* locate Servants, or an empty string if the Servant Locator does
* not belong to any category.
*
* @return The Servant Locator, or null if no Servant Locator was
* found for the given category.
*
* @see Identity
* @see addServantLocator
* @see removeServantLocator
* @see ServantLocator
*
**/
ServantLocator findServantLocator(string category);
/**
*
* 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 only tries 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 Identity
* @see proxyToServant
*
**/
Object identityToServant(Identity identity);
/**
*
* Look up a Servant in this Object Adapter's Active Servant Map,
* given a Proxy.
*
* <note><para>This operation only tries 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.
*
* @see Identity
*
**/
Object* createProxy(Identity identity);
};
};
#endif
|