1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML//EN">
4 <title>COS Event Channel Configuration
</title>
10 <h1>COS Event Channel Configuration
</h1>
13 <H3>Run-time Configuration
</H3>
15 <P>The new implementation of the COS Event Service uses a
16 factory to build all the objects and strategies it requires.
17 The factory can be dynamically loaded using ACE Service
18 Configurator, this is extremely convenient because the factory
19 can also parse options in the Service Configurator script file.
22 <P>The current implementation provides a default implementation
23 for this Factory, this document describes the options used by
24 this default implementation.
25 Users can define their own implementation, with new ad-hoc
26 strategies or with pre-selected strategies.
29 <H3>The configuration file
</H3>
31 <P>The COS channel uses the same service configurator
32 file that the ORB uses, the default name for this file is
33 <CODE>svc.conf
</CODE>, but the ORB option
34 <CODE>-ORBSvcConf
</CODE> can be used to override this.
35 The format of the file is described in detail in
36 the service configurator documentation, but the relevant section
37 for the event channel looks like this:
42 # More comments if you want to...
43 static CEC_Factory
"-CECDispatching reactive ....."
46 <P>All the event service factory options start with
52 <P><TABLE BORDER=
"2" CELLSPACING=
"2" CELLPADDING=
"0">
57 <!-- <TR NAME="CECDispatching"> -->
59 <TD><CODE>-CECDispatching
</CODE>
60 <EM>dispatching_strategy
</EM>
62 <TD>Select the dispatching strategy used by the COS
63 event service. A
<EM>reactive
</EM> strategy will use the
64 same thread that received the event from the supplier to
65 push the event to all the consumers.
66 The
<EM>mt
</EM> strategy will also use a pool of threads,
67 but the thread to dispatch is randomly selected.
71 <!-- <TR NAME="CECDispatchingThreads"> -->
73 <TD><CODE>-CECDispatchingThreads
</CODE>
74 <EM>number_of_threads
</EM>
76 <TD>Select the number of threads used by the
<EM>mt
</EM>
81 <!-- <TR NAME="CECProxyConsumerLock"> -->
83 <TD><CODE>-CECProxyConsumerLock
</CODE>
86 <TD>Select the lock type (
<EM>null
</EM>,
<EM>thread
</EM> or
87 <EM>recursive
</EM>) to synchronize access to the
88 ProxyPushConsumer state.
92 <!-- <TR NAME="CECProxySupplierLock"> -->
94 <TD><CODE>-CECProxySupplierLock
</CODE>
97 <TD>Select the lock type (
<EM>null
</EM>,
<EM>thread
</EM> or
98 <EM>recursive
</EM>) to synchronize access to the
99 ProxyPushSupplier state.
103 <!-- <TR NAME="CECUseORBId"> -->
105 <TD><CODE>-CECUseORBId
</CODE>
108 <TD>Set the name of the ORB used by the event service, only
109 useful in applications that create multiple ORBs and
110 activate the event service in one of them.
114 <!-- <TR NAME="CECConsumerControl"> -->
116 <TD><CODE>-CECConsumerControl
</CODE>
119 <TD>Select the consumer control policy (
<EM>null
</EM> or
120 <EM>reactive
</EM>) to detect and discard broken consumers.
124 <!-- <TR NAME="CECSupplierControl"> -->
126 <TD><CODE>-CECSupplierControl
</CODE>
129 <TD>Select the supplier control policy (
<EM>null
</EM> or
130 <EM>reactive
</EM>) to detect and discard broken suppliers.
134 <!-- <TR NAME="CECConsumerControlPeriod"> -->
136 <TD><CODE>-CECConsumerControlPeriod
</CODE>
139 <TD>Set the period (in microseconds) used by the reactive
140 consumer control policy to poll the state of the
145 <!-- <TR NAME="CECSupplierControlPeriod"> -->
147 <TD><CODE>-CECSupplierControlPeriod
</CODE>
150 <TD>Set the period (in microseconds) used by the reactive
151 supplier control policy to poll the state of the
156 <!-- <TR NAME="CECConsumerControlTimeout"> -->
158 <TD><CODE>-CECConsumerControlTimeout
</CODE>
161 <TD><P>Set the relative roundtrip timeout for push and pull
162 consumers. The default is
10000 microseconds.
163 This relative roundtrip timeout is utilized
164 when each consumer attached to the supplier is queried.
165 If querying any one of the consumers times out, it may
166 be disconnected depending on the
167 -CECProxyDisconnectRetries setting.
169 <P>This option can also be referenced as
170 -CECConsumerControlRoundtripTimeout.
175 <!-- <TR NAME="CECSupplierControlTimeout"> -->
177 <TD><CODE>-CECSupplierControlTimeout
</CODE>
180 <TD><P>Set the relative roundtrip timeout for push or pull
181 suppliers. The default is
10000 microseconds.
182 This relative roundtrip timeout is utilized
183 when each supplier attached to the consumer is queried.
184 If querying any one of the suppliers times out, it may
185 be disconnected depending on the
186 -CECProxyDisconnectRetries setting.
188 <P>This option can also be referenced as
189 -CECSupplierControlRoundtripTimeout.
194 <!-- <TR NAME="CECReactivePullingPeriod"> -->
196 <TD><CODE>-CECReactivePullingPeriod
</CODE>
199 <TD>Set the period (in microseconds) used by the reactive
200 pulling strategy to poll all the PullSuppliers for an
205 <!-- <TR NAME="CECConsumerOperationTimeout"> -->
207 <TD><CODE>-CECConsumerOperationTimeout
</CODE>
210 <TD>Set the relative roundtrip timeout for all operations (except
211 "pings
" due to reactive consumer control) on consumers.
212 Reactive consumer control must be enabled for this option to take
213 effect. The units for
<EM>timeout
</EM> are microseconds.
214 If a remote operation invoked on the consumer exceeds the timeout,
215 then that consumer will be considered
"bad
" and will be
216 disconnected from the event channel.
220 <!-- <TR NAME="CECSupplierOperationTimeout"> -->
222 <TD><CODE>-CECSupplierOperationTimeout
</CODE>
225 <TD>Set the relative roundtrip timeout for all operations (except
226 "pings
" due to reactive supplier control) on suppliers.
227 Reactive supplier control must be enabled for this option to take
228 effect. The units for
<EM>timeout
</EM> are microseconds.
229 If a remote operation invoked on the supplier exceeds the timeout
230 then that supplier will be considered
"bad
" and will be
231 disconnected from the event channel.
235 <!-- <TR NAME="CECProxyConsumerCollection"> -->
237 <TD><CODE>-CECProxyConsumerCollection
</CODE>
238 <EM>flag[:flags]
</EM>
240 <TD><P>Configure the data structure and strategies used to
241 implement collections of
242 <CODE>ProxyPushConsumers
</CODE> and
243 <CODE>ProxyPullConsumers
</CODE>.
244 The argument is a colon separated list of flags, with
245 the following semantics:
246 <TABLE BORDER=
"1" CELLSPACING=
"2" CELLPADDING=
"0">
247 <TR><TH>Flag
</TH><TH>Description
</TH>
251 <TD>Use regular mutexes and/or condition
252 variables for serialization.
257 <TD>Use null mutexes and/or condition
258 variables for serialization.
263 <TD>Implement the collection using an ordered list,
264 fast for iteration (i.e. during event dispatching),
265 but slow for insertion and removal (i.e. when
266 clients connect and disconnect from the EC).
271 <TD>Implement the collection using a Red-Black tree,
272 slow for iteration (i.e. during event dispatching),
273 but fast for insertion and removal (i.e. when
274 clients connect and disconnect from the EC).
279 <TD>Threads block until they can execute a change on
280 the data structure, the system must use other
281 approaches to guarantee that the iterators are not
282 invalidated during event dispatching. For example,
283 use a separate dispatching thread. Using this option
284 with the reactive values for any of the
285 -CECSupplierControl, -CECConsumerControl, or
286 -CECDispatching options may cause deadlocks.
290 <TD>COPY_ON_READ
</TD>
291 <TD>Before initiating an iteration to dispatch events
292 (or similar tasks) a copy of the complete collection
294 This solves most of the synchronization problems,
295 but introduces a significant source of overhead and
296 priority inversions on the critical path.
300 <TD>COPY_ON_WRITE
</TD>
301 <TD>Similar to the previous one, but the copy is only
302 performed when needed.
307 <TD>Threads that need to change the collection can
308 detect if that change will invalidate iterators used
310 If so, the thread posts the change on a queue that
311 is executed once the collection is no longer in
320 <!-- <TR NAME="CECProxySupplierCollection"> -->
322 <TD><CODE>-CECProxySupplierCollection
</CODE>
323 <EM>flag[:flags]
</EM>
325 <TD><P>Configure the data structure and strategies used to
326 implement collections of
<CODE>ProxyPushSupplier
</CODE>
327 and
<CODE>ProxyPullSupplier
</CODE> objects.
328 Use the same arguments as with the
329 <CODE>CECProxyConsumerCollection
</CODE> option.
334 <!-- <TR NAME="CECProxyDisconnectRetries"> -->
336 <TD><CODE>-CECProxyDisconnectRetries
</CODE>
337 <EM>number of retries
</EM>
339 <TD><P>This determines the number of times a consumer or
340 supplier can be
"unresponsive" before the supplier or
341 consumer control will disconnect it. The default is zero
349 <H3>The constructor
</H3>
351 <P>The
<CODE>TAO_CEC_EventChannel
</CODE> class implements the
352 <CODE>CosEventChannelAdmin::EventChannel
</CODE> interface;
353 this class takes one mandatory and two optional parameters in
358 TAO_CEC_EventChannel (const TAO_CEC_EventChannel_Attributes& attributes,
359 TAO_CEC_Factory* factory =
0,
360 int own_factory =
0);
363 <P>The
<CODE>factory
</CODE> is an optional parameter to override
364 the default strategy factory used by the event channel,
365 the event channel will destroy the factory if the
366 <CODE>own_factory
</CODE> argument is true.
369 <P>The
<CODE>attributes
</CODE> parameter can be used to fine tune
370 some of the algorithms and strategies used by the event channel,
371 the default values are probably OK for most applications.
372 Notice that the attributes include the POA used to activate the
373 ConsumerAdmin, SupplierAdmin, ProxyPushConsumer,
374 ProxyPushSupplier, ProxyPullConsumer and the ProxyPullSupplier
376 these POAs must have the
<CODE>IMPLICIT_ACTIVATION
</CODE> and the
377 <CODE>SYSTEM_ID
</CODE> policies (as the RootPOA does).
380 <P><TABLE BORDER=
"2" CELLSPACING=
"2" CELLPADDING=
"0">
381 <TR><TH>Attribute
</TH><TH>Description
</TH></TR>
383 <TR><TD><CODE>consumer_reconnect
</CODE></TD>
384 <TD>If the attribute is not zero then the same consumer can
385 call
<CODE>connect_push_consumer
</CODE> on its
386 ProxyPushSupplier multiple times to change its
388 this is usually more efficient that disconnecting and
393 <TR><TD><CODE>supplier_reconnect
</CODE></TD>
394 <TD>If the attribute is not zero then the same supplier can
395 call
<CODE>connect_push_supplier
</CODE> on its
396 ProxyPushConsumer multiple times to change its
398 this is usually more efficient that disconnecting and
403 <TR><TD><CODE>disconnect_callbacks
</CODE></TD>
404 <TD>It not zero the event channel will send disconnect
405 callbacks when a disconnect method is called on a Proxy.
406 In other words, if a consumer calls
407 <CODE>disconnect_push_supplier()
</CODE> on its proxy the
408 EC will invoke
<CODE>disconnect_push_consumer()
</CODE>
409 on the consumer. A similar thing is done for suppliers.
410 It is a matter of debate what the spec requires for the
411 regular event service.
415 <TR><TD><CODE>busy_hwm
</CODE></TD>
416 <TD>When the delayed flag is set on proxy collections,
417 this flag controls the maximum
418 number of threads that can simultaneously iterate over the
419 collection before blocking.
420 It can be used to avoid starvation in delayed updates on
425 <TR><TD><CODE>max_write_delay
</CODE></TD>
426 <TD>When the delayed flag is set on proxy collections,
427 this flag controls the maximum
428 number of threads that will initiate dispatching
429 <B>after
</B> a change has been posted.
430 Any thread after that is blocked until the operations are
432 It can be used to completely stop starvation of delayed
433 updates on the collection.
437 <TR><TD><CODE>supplier_poa
</CODE></TD>
438 <TD>The POA used by the event channel to activate SupplierAdmin
439 and SupplierProxy objects.
443 <TR><TD><CODE>consumer_poa
</CODE></TD>
444 <TD>The POA used by the event channel to activate ConsumerAdmin
445 and ConsumerProxy objects.
454 Back to the TAO
<A HREF=
"index.html">components documentation
</A>.