~ubuntu-branches/debian/squeeze/erlang/squeeze

« back to all changes in this revision

Viewing changes to lib/cosEventDomain/src/CosEventDomainAdmin_EventDomain_impl.erl

  • Committer: Bazaar Package Importer
  • Author(s): Erlang Packagers, Sergei Golovan
  • Date: 2006-12-03 17:07:44 UTC
  • mfrom: (2.1.11 feisty)
  • Revision ID: james.westby@ubuntu.com-20061203170744-rghjwupacqlzs6kv
Tags: 1:11.b.2-4
[ Sergei Golovan ]
Fixed erlang-base and erlang-base-hipe prerm scripts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
123
123
%%              {stop, Reason}
124
124
%% Description: Initiates the server
125
125
%%----------------------------------------------------------------------
126
 
init([ParentPid, MyId, QoS, Admin]) ->
 
126
init([ParentPid, MyId, QoS, _Admin]) ->
127
127
    process_flag(trap_exit, true),
128
128
    Diamonds = case lists:keysearch(?DiamondDetection, 1, QoS) of
129
129
                   false ->
147
147
%% Returns    : any (ignored by gen_server)
148
148
%% Description: Shutdown the server
149
149
%%----------------------------------------------------------------------
150
 
terminate(Reason, #state{graph = DG} = State) ->
 
150
terminate(_Reason, #state{graph = DG} = _State) ->
151
151
    Connections = digraph:edges(DG),
152
152
    close_connections(DG, Connections),
153
153
    digraph:delete(DG),
158
158
%% Returns    : {ok, NewState}
159
159
%% Description: Convert process state when code is changed
160
160
%%----------------------------------------------------------------------
161
 
code_change(OldVsn, State, Extra) ->
 
161
code_change(_OldVsn, State, _Extra) ->
162
162
    {ok, State}.
163
163
 
164
164
%%----------------------------------------------------------------------
169
169
%%----------------------------------------------------------------------
170
170
handle_info({'EXIT', Pid, Reason}, #state{parent_pid = Pid} = State) ->
171
171
    {stop, Reason, State};
172
 
handle_info(Info, State) ->
 
172
handle_info(_Info, State) ->
173
173
    {noreply, State}.
174
174
 
175
175
%%----------------------------------------------------------------------
180
180
%% Returns    : MemberId - long()
181
181
%% Description: 
182
182
%%----------------------------------------------------------------------
183
 
add_channel(OE_This, #state{ch_counter=C, graph = DG} = State, Channel) ->
 
183
add_channel(_OE_This, #state{ch_counter=C, graph = DG} = State, Channel) ->
184
184
    type_check(Channel, 'CosNotifyChannelAdmin_EventChannel'),
185
185
    Id = cosEventDomainApp:create_id(C),
186
186
    digraph:add_vertex(DG, Id, Channel),
192
192
%% Returns    : CosEventDomainAdmin::MemberIDSeq ([long()])
193
193
%% Description: 
194
194
%%----------------------------------------------------------------------
195
 
get_all_channels(OE_This, #state{graph = DG} = State) ->
 
195
get_all_channels(_OE_This, #state{graph = DG} = State) ->
196
196
    {reply, digraph:vertices(DG), State}.
197
197
 
198
198
%%---------------------------------------------------------------------%
202
202
%%              {'EXCEPTION', #'CosNotifyChannelAdmin_ChannelNotFound'{}}
203
203
%% Description: 
204
204
%%----------------------------------------------------------------------
205
 
get_channel(OE_This, #state{graph = DG} = State, Id) ->
 
205
get_channel(_OE_This, #state{graph = DG} = State, Id) ->
206
206
    {reply, lookup_channel(DG, Id), State}.
207
207
 
208
208
%%---------------------------------------------------------------------%
212
212
%%              {'EXCEPTION', #'CosNotifyChannelAdmin_ChannelNotFound'{}}
213
213
%% Description: 
214
214
%%----------------------------------------------------------------------
215
 
remove_channel(OE_This, #state{graph = DG} = State, Id) ->
 
215
remove_channel(_OE_This, #state{graph = DG} = State, Id) ->
216
216
    lookup_channel(DG, Id),
217
217
    close_connections(DG, digraph:edges(DG, Id)),
218
218
    digraph:del_vertex(DG, Id),
229
229
%%              {'EXCEPTION', #'CosEventDomainAdmin_DiamondCreationForbidden'{diam}}
230
230
%% Description: 
231
231
%%----------------------------------------------------------------------
232
 
add_connection(OE_This, #state{graph = DG, co_counter = C} = State, 
 
232
add_connection(_OE_This, #state{graph = DG, co_counter = C} = State, 
233
233
               Connection) when record(Connection, 
234
234
                                       'CosEventDomainAdmin_Connection') ->
235
235
    SId = Connection#'CosEventDomainAdmin_Connection'.supplier_id,
257
257
                            corba:raise(E);
258
258
                        What ->
259
259
                            digraph:del_edge(DG, Id),
260
 
                            orber:debug_level_print("[~p] CosEventDomainAdmin_EventDomain:add_connection(~p);
261
 
Failed setting up connection due to: ~p", [?LINE, Connection, What], ?DEBUG_LEVEL),
 
260
                            orber:dbg("[~p] CosEventDomainAdmin_EventDomain:"
 
261
                                      "add_connection(~p);~nFailed setting up"
 
262
                                      " connection due to: ~p", 
 
263
                                      [?LINE, Connection, What], ?DEBUG_LEVEL),
262
264
                            corba:raise(#'INTERNAL'{completion_status=?COMPLETED_MAYBE})
263
265
                    end;
264
266
                Id ->
276
278
                                    corba:raise(E);
277
279
                                What ->
278
280
                                    digraph:del_edge(DG, Id),
279
 
                                    orber:debug_level_print("[~p] CosEventDomainAdmin_EventDomain:add_connection(~p);
280
 
Failed setting up connection due to: ~p", [?LINE, Connection, What], ?DEBUG_LEVEL),
 
281
                                    orber:dbg("[~p] CosEventDomainAdmin_EventDomain:"
 
282
                                              "add_connection(~p);~nFailed setting"
 
283
                                              " up connection due to: ~p", 
 
284
                                              [?LINE, Connection, What], 
 
285
                                              ?DEBUG_LEVEL),
281
286
                                    corba:raise(#'INTERNAL'{completion_status=?COMPLETED_MAYBE})
282
287
                            end;
283
288
                        Diamond ->
299
304
%% Returns    : CosEventDomainAdmin::ConnectionIDSeq - [long()]
300
305
%% Description: 
301
306
%%----------------------------------------------------------------------
302
 
get_all_connections(OE_This, #state{graph = DG} = State) ->
 
307
get_all_connections(_OE_This, #state{graph = DG} = State) ->
303
308
    {reply, digraph:edges(DG), State}.
304
309
 
305
310
%%---------------------------------------------------------------------%
309
314
%%              {'EXCEPTION', #'CosEventDomainAdmin_ConnectionNotFound'{}} |
310
315
%% Description: 
311
316
%%----------------------------------------------------------------------
312
 
get_connection(OE_This, #state{graph = DG} = State, Id) ->
 
317
get_connection(_OE_This, #state{graph = DG} = State, Id) ->
313
318
    {reply, lookup_connection_data(DG, Id), State}.
314
319
 
315
320
%%---------------------------------------------------------------------%
319
324
%%              {'EXCEPTION', #'CosEventDomainAdmin_ConnectionNotFound'{}} |
320
325
%% Description: 
321
326
%%----------------------------------------------------------------------
322
 
remove_connection(OE_This, #state{graph = DG} = State, Id) ->
 
327
remove_connection(_OE_This, #state{graph = DG} = State, Id) ->
323
328
    #connection{supplier=S, consumer=C, data=Connection} = 
324
329
        lookup_connection(DG, Id),
325
330
    close_connection(Connection, S, C),
334
339
%%              {'EXCEPTION', #'CosNotifyChannelAdmin_ChannelNotFound'{}} |
335
340
%% Description: 
336
341
%%----------------------------------------------------------------------
337
 
get_offer_channels(OE_This, #state{graph = DG, cyclic = Cyclic} = State, Id) ->
 
342
get_offer_channels(_OE_This, #state{graph = DG, cyclic = Cyclic} = State, Id) ->
338
343
    lookup_channel(DG, Id),
339
344
    case digraph:vertex(DG, Id) of
340
 
        {Id, Channel} when Cyclic == ?ForbidCycles ->
 
345
        {Id, _Channel} when Cyclic == ?ForbidCycles ->
341
346
            {reply, digraph_utils:reaching_neighbours([Id], DG), State};
342
 
        {Id, Channel} ->
 
347
        {Id, _Channel} ->
343
348
            %% If cyclic graphs is allowed 'Id' will appear in the returned list.
344
349
            %% Hence, we must delete it.
345
350
            {reply,lists:delete(Id, digraph_utils:reaching_neighbours([Id], DG)), 
355
360
%%              {'EXCEPTION', #'CosNotifyChannelAdmin_ChannelNotFound'{}} |
356
361
%% Description: 
357
362
%%----------------------------------------------------------------------
358
 
get_subscription_channels(OE_This, #state{graph = DG, cyclic = Cyclic} = State, Id) ->
 
363
get_subscription_channels(_OE_This, #state{graph = DG, cyclic = Cyclic} = State, Id) ->
359
364
    lookup_channel(DG, Id),
360
365
    case digraph:vertex(DG, Id) of
361
 
        {Id, Channel} when Cyclic == ?ForbidCycles ->
 
366
        {Id, _Channel} when Cyclic == ?ForbidCycles ->
362
367
            {reply, digraph_utils:reachable_neighbours([Id], DG), State};
363
 
        {Id, Channel} ->
 
368
        {Id, _Channel} ->
364
369
            %% If cyclic graphs is allowed 'Id' will appear in the returned list.
365
370
            %% Hence, we must delete it.
366
371
            {reply, lists:delete(Id, digraph_utils:reachable_neighbours([Id], DG)), 
375
380
%% Returns    : ok
376
381
%% Description: 
377
382
%%----------------------------------------------------------------------
378
 
destroy(OE_This, #state{graph = DG} = State) ->
 
383
destroy(_OE_This, #state{graph = _DG} = State) ->
379
384
    {stop, normal, ok, State}.
380
385
 
381
386
%%---------------------------------------------------------------------%
384
389
%% Returns    : CosEventDomainAdmin::CycleSeq
385
390
%% Description: 
386
391
%%----------------------------------------------------------------------
387
 
get_cycles(OE_This, #state{cyclic = ?ForbidCycles} = State) ->
 
392
get_cycles(_OE_This, #state{cyclic = ?ForbidCycles} = State) ->
388
393
    {reply, [], State};
389
 
get_cycles(OE_This, #state{graph = DG} = State) ->
 
394
get_cycles(_OE_This, #state{graph = DG} = State) ->
390
395
    {reply, digraph_utils:cyclic_strong_components(DG), State}.
391
396
 
392
397
%%----------------------------------------------------------------------
395
400
%% Returns    : CosEventDomainAdmin::DiamondSeq
396
401
%% Description: 
397
402
%%----------------------------------------------------------------------
398
 
get_diamonds(OE_This, #state{diamonds = ?ForbidDiamonds} = State) ->
 
403
get_diamonds(_OE_This, #state{diamonds = ?ForbidDiamonds} = State) ->
399
404
    {reply, [], State};
400
 
get_diamonds(OE_This, State) ->
 
405
get_diamonds(_OE_This, State) ->
401
406
    {reply, get_diamonds_helper(State, true), State}.
402
407
 
403
 
get_diamonds_helper(#state{graph = DG} = State, FindAll) ->
 
408
get_diamonds_helper(#state{graph = DG} = _State, FindAll) ->
404
409
     case find_candidates(DG) of
405
410
        {[], _, _} ->
406
411
            [];
412
417
            evaluate_candidates(DG, COut, CIn, [], Max, FindAll)
413
418
    end.
414
419
 
415
 
get_diamonds_helper(#state{graph = DG} = State, FindAll, Vertex) ->
 
420
get_diamonds_helper(#state{graph = DG} = _State, FindAll, Vertex) ->
416
421
    case find_candidates(DG, Vertex) of
417
422
        {[], _, _} ->
418
423
            [];
431
436
%%              {'EXCEPTION', #'CosNotifyChannelAdmin_ChannelNotFound'{}} |
432
437
%% Description: 
433
438
%%----------------------------------------------------------------------
434
 
set_default_consumer_channel(OE_This, #state{graph = DG} = State, Id) ->
 
439
set_default_consumer_channel(_OE_This, #state{graph = DG} = State, Id) ->
435
440
    lookup_channel(DG, Id),
436
441
    {reply, ok, State#state{def_consumer=Id}}.
437
442
 
442
447
%%              {'EXCEPTION', #'CosNotifyChannelAdmin_ChannelNotFound'{}} |
443
448
%% Description: 
444
449
%%----------------------------------------------------------------------
445
 
set_default_supplier_channel(OE_This, #state{graph = DG} = State, Id) ->
 
450
set_default_supplier_channel(_OE_This, #state{graph = DG} = State, Id) ->
446
451
    lookup_channel(DG, Id),
447
452
    {reply, ok, State#state{def_supplier=Id}}.
448
453
 
453
458
%%              {'EXCEPTION', #'CosNotifyChannelAdmin_ChannelNotFound'{}} |
454
459
%% Description: 
455
460
%%----------------------------------------------------------------------
456
 
connect_push_consumer(OE_This, #state{def_supplier = Ch} = State, PC) ->
 
461
connect_push_consumer(_OE_This, #state{def_supplier = Ch} = State, PC) ->
457
462
    type_check(PC, 'CosEventComm_PushConsumer'),
458
463
    Proxy = connect_a_push_consumer(Ch, PC, 'ANY_EVENT'),
459
464
    {reply, Proxy, State}.
465
470
%%              {'EXCEPTION', #'CosNotifyChannelAdmin_ChannelNotFound'{}} |
466
471
%% Description: 
467
472
%%----------------------------------------------------------------------
468
 
connect_pull_consumer(OE_This, #state{def_consumer = Ch} = State, PC) ->
 
473
connect_pull_consumer(_OE_This, #state{def_consumer = Ch} = State, PC) ->
469
474
    Proxy = connect_a_pull_consumer(Ch, PC, 'ANY_EVENT'),
470
475
    {reply, Proxy, State}.
471
476
 
476
481
%%              {'EXCEPTION', #'CosNotifyChannelAdmin_ChannelNotFound'{}} |
477
482
%% Description: 
478
483
%%----------------------------------------------------------------------
479
 
connect_push_supplier(OE_This, #state{def_supplier = Ch} = State, PS) ->
 
484
connect_push_supplier(_OE_This, #state{def_supplier = Ch} = State, PS) ->
480
485
    Proxy = connect_a_push_supplier(Ch, PS, 'ANY_EVENT'),
481
486
    {reply, Proxy, State}.
482
487
 
487
492
%%              {'EXCEPTION', #'CosNotifyChannelAdmin_ChannelNotFound'{}} |
488
493
%% Description: 
489
494
%%----------------------------------------------------------------------
490
 
connect_pull_supplier(OE_This, #state{def_consumer = Ch} = State, PS) ->
 
495
connect_pull_supplier(_OE_This, #state{def_consumer = Ch} = State, PS) ->
491
496
    type_check(PS, 'CosEventComm_PullSupplier'),
492
497
    Proxy = connect_a_pull_supplier(Ch, PS, 'ANY_EVENT'),
493
498
    {reply, Proxy, State}.
499
504
%%              {'EXCEPTION', #'CosNotifyChannelAdmin_ChannelNotFound'{}} |
500
505
%% Description: 
501
506
%%----------------------------------------------------------------------
502
 
connect_structured_push_consumer(OE_This, #state{def_supplier = Ch} = State, PC) ->
 
507
connect_structured_push_consumer(_OE_This, #state{def_supplier = Ch} = State, PC) ->
503
508
    type_check(PC, 'CosNotifyComm_StructuredPushConsumer'),
504
509
    Proxy = connect_a_push_consumer(Ch, PC, 'STRUCTURED_EVENT'),
505
510
    {reply, Proxy, State}.
511
516
%%              {'EXCEPTION', #'CosNotifyChannelAdmin_ChannelNotFound'{}} |
512
517
%% Description: 
513
518
%%----------------------------------------------------------------------
514
 
connect_structured_pull_consumer(OE_This, #state{def_supplier = Ch} = State, PC) ->
 
519
connect_structured_pull_consumer(_OE_This, #state{def_supplier = Ch} = State, PC) ->
515
520
    Proxy = connect_a_pull_consumer(Ch, PC, 'STRUCTURED_EVENT'),
516
521
    {reply, Proxy, State}.
517
522
 
522
527
%%              {'EXCEPTION', #'CosNotifyChannelAdmin_ChannelNotFound'{}} |
523
528
%% Description: 
524
529
%%----------------------------------------------------------------------
525
 
connect_structured_push_supplier(OE_This, #state{def_consumer = Ch} = State, PS) ->
 
530
connect_structured_push_supplier(_OE_This, #state{def_consumer = Ch} = State, PS) ->
526
531
    Proxy = connect_a_push_supplier(Ch, PS, 'STRUCTURED_EVENT'),
527
532
    {reply, Proxy, State}.
528
533
 
533
538
%%              {'EXCEPTION', #'CosNotifyChannelAdmin_ChannelNotFound'{}} |
534
539
%% Description: 
535
540
%%----------------------------------------------------------------------
536
 
connect_structured_pull_supplier(OE_This, #state{def_consumer = Ch} = State, PS) ->
 
541
connect_structured_pull_supplier(_OE_This, #state{def_consumer = Ch} = State, PS) ->
537
542
    type_check(PS, 'CosNotifyComm_StructuredPullSupplier'),
538
543
    Proxy = connect_a_pull_supplier(Ch, PS, 'STRUCTURED_EVENT'),
539
544
    {reply, Proxy, State}.
545
550
%%              {'EXCEPTION', #'CosNotifyChannelAdmin_ChannelNotFound'{}} |
546
551
%% Description: 
547
552
%%----------------------------------------------------------------------
548
 
connect_sequence_push_consumer(OE_This, #state{def_supplier = Ch} = State, PC) ->
 
553
connect_sequence_push_consumer(_OE_This, #state{def_supplier = Ch} = State, PC) ->
549
554
    type_check(PC, 'CosNotifyComm_SequencePushConsumer'),
550
555
    Proxy = connect_a_push_consumer(Ch, PC, 'SEQUENCE_EVENT'),
551
556
    {reply, Proxy, State}.
557
562
%%              {'EXCEPTION', #'CosNotifyChannelAdmin_ChannelNotFound'{}} |
558
563
%% Description: 
559
564
%%----------------------------------------------------------------------
560
 
connect_sequence_pull_consumer(OE_This, #state{def_supplier = Ch} = State, PC) ->
 
565
connect_sequence_pull_consumer(_OE_This, #state{def_supplier = Ch} = State, PC) ->
561
566
    Proxy = connect_a_pull_consumer(Ch, PC, 'SEQUENCE_EVENT'),
562
567
    {reply, Proxy, State}.
563
568
 
568
573
%%              {'EXCEPTION', #'CosNotifyChannelAdmin_ChannelNotFound'{}} |
569
574
%% Description: 
570
575
%%----------------------------------------------------------------------
571
 
connect_sequence_push_supplier(OE_This, #state{def_consumer = Ch} = State, PS) ->
 
576
connect_sequence_push_supplier(_OE_This, #state{def_consumer = Ch} = State, PS) ->
572
577
    Proxy = connect_a_push_supplier(Ch, PS, 'SEQUENCE_EVENT'),
573
578
    {reply, Proxy, State}.
574
579
 
579
584
%%              {'EXCEPTION', #'CosNotifyChannelAdmin_ChannelNotFound'{}} |
580
585
%% Description: 
581
586
%%----------------------------------------------------------------------
582
 
connect_sequence_pull_supplier(OE_This, #state{def_consumer = Ch} = State, PS) ->
 
587
connect_sequence_pull_supplier(_OE_This, #state{def_consumer = Ch} = State, PS) ->
583
588
    type_check(PS, 'CosNotifyComm_SequencePullSupplier'),
584
589
    Proxy = connect_a_pull_supplier(Ch, PS, 'SEQUENCE_EVENT'),
585
590
    {reply, Proxy, State}.
592
597
%%              {'EXCEPTION', #'CosNotifyChannelAdmin_ChannelNotFound'{}} |
593
598
%% Description: 
594
599
%%----------------------------------------------------------------------
595
 
connect_push_consumer_with_id(OE_This, #state{graph = DG} = State, PC, Id) ->
 
600
connect_push_consumer_with_id(_OE_This, #state{graph = DG} = State, PC, Id) ->
596
601
    type_check(PC, 'CosEventComm_PushConsumer'),
597
602
    Channel = lookup_channel(DG, Id),
598
603
    Proxy = connect_a_push_consumer(Channel, PC, 'ANY_EVENT'),
606
611
%%              {'EXCEPTION', #'CosNotifyChannelAdmin_ChannelNotFound'{}} |
607
612
%% Description: 
608
613
%%----------------------------------------------------------------------
609
 
connect_pull_consumer_with_id(OE_This, #state{graph = DG} = State, PC, Id) ->
 
614
connect_pull_consumer_with_id(_OE_This, #state{graph = DG} = State, PC, Id) ->
610
615
    Channel = lookup_channel(DG, Id),
611
616
    Proxy = connect_a_pull_consumer(Channel, PC, 'ANY_EVENT'),
612
617
    {reply, Proxy, State}.
619
624
%%              {'EXCEPTION', #'CosNotifyChannelAdmin_ChannelNotFound'{}} |
620
625
%% Description: 
621
626
%%----------------------------------------------------------------------
622
 
connect_push_supplier_with_id(OE_This, #state{graph = DG} = State, PS, Id) ->
 
627
connect_push_supplier_with_id(_OE_This, #state{graph = DG} = State, PS, Id) ->
623
628
    Channel = lookup_channel(DG, Id),
624
629
    Proxy = connect_a_push_supplier(Channel, PS, 'ANY_EVENT'),
625
630
    {reply, Proxy, State}.
632
637
%%              {'EXCEPTION', #'CosNotifyChannelAdmin_ChannelNotFound'{}} |
633
638
%% Description: 
634
639
%%----------------------------------------------------------------------
635
 
connect_pull_supplier_with_id(OE_This, #state{graph = DG} = State, PS, Id) ->
 
640
connect_pull_supplier_with_id(_OE_This, #state{graph = DG} = State, PS, Id) ->
636
641
    type_check(PS, 'CosEventComm_PullSupplier'),
637
642
    Channel = lookup_channel(DG, Id),
638
643
    Proxy = connect_a_pull_supplier(Channel, PS, 'ANY_EVENT'),
646
651
%%              {'EXCEPTION', #'CosNotifyChannelAdmin_ChannelNotFound'{}} |
647
652
%% Description: 
648
653
%%----------------------------------------------------------------------
649
 
connect_structured_push_consumer_with_id(OE_This, #state{graph = DG} = State, PC, Id) ->
 
654
connect_structured_push_consumer_with_id(_OE_This, #state{graph = DG} = State, PC, Id) ->
650
655
    type_check(PC, 'CosNotifyComm_StructuredPushConsumer'),
651
656
    Channel = lookup_channel(DG, Id),
652
657
    Proxy = connect_a_push_consumer(Channel, PC, 'STRUCTURED_EVENT'),
660
665
%%              {'EXCEPTION', #'CosNotifyChannelAdmin_ChannelNotFound'{}} |
661
666
%% Description: 
662
667
%%----------------------------------------------------------------------
663
 
connect_structured_pull_consumer_with_id(OE_This, #state{graph = DG} = State, PC, Id) ->
 
668
connect_structured_pull_consumer_with_id(_OE_This, #state{graph = DG} = State, PC, Id) ->
664
669
    Channel = lookup_channel(DG, Id),
665
670
    Proxy = connect_a_pull_consumer(Channel, PC, 'STRUCTURED_EVENT'),
666
671
    {reply, Proxy, State}.
673
678
%%              {'EXCEPTION', #'CosNotifyChannelAdmin_ChannelNotFound'{}} |
674
679
%% Description: 
675
680
%%----------------------------------------------------------------------
676
 
connect_structured_push_supplier_with_id(OE_This, #state{graph = DG} = State, PS, Id) ->
 
681
connect_structured_push_supplier_with_id(_OE_This, #state{graph = DG} = State, PS, Id) ->
677
682
    Channel = lookup_channel(DG, Id),
678
683
    Proxy = connect_a_push_supplier(Channel, PS, 'STRUCTURED_EVENT'),
679
684
    {reply, Proxy, State}.
686
691
%%              {'EXCEPTION', #'CosNotifyChannelAdmin_ChannelNotFound'{}} |
687
692
%% Description: 
688
693
%%----------------------------------------------------------------------
689
 
connect_structured_pull_supplier_with_id(OE_This, #state{graph = DG} = State, PS, Id) ->
 
694
connect_structured_pull_supplier_with_id(_OE_This, #state{graph = DG} = State, PS, Id) ->
690
695
    type_check(PS, 'CosNotifyComm_StructuredPullSupplier'),
691
696
    Channel = lookup_channel(DG, Id),
692
697
    Proxy = connect_a_pull_supplier(Channel, PS, 'STRUCTURED_EVENT'),
700
705
%%              {'EXCEPTION', #'CosNotifyChannelAdmin_ChannelNotFound'{}} |
701
706
%% Description: 
702
707
%%----------------------------------------------------------------------
703
 
connect_sequence_push_consumer_with_id(OE_This, #state{graph = DG} = State, PC, Id) ->
 
708
connect_sequence_push_consumer_with_id(_OE_This, #state{graph = DG} = State, PC, Id) ->
704
709
    type_check(PC, 'CosNotifyComm_SequencePushConsumer'),
705
710
    Channel = lookup_channel(DG, Id),
706
711
    Proxy = connect_a_push_consumer(Channel, PC, 'SEQUENCE_EVENT'),
714
719
%%              {'EXCEPTION', #'CosNotifyChannelAdmin_ChannelNotFound'{}} |
715
720
%% Description: 
716
721
%%----------------------------------------------------------------------
717
 
connect_sequence_pull_consumer_with_id(OE_This, #state{graph = DG} = State, PC, Id) ->
 
722
connect_sequence_pull_consumer_with_id(_OE_This, #state{graph = DG} = State, PC, Id) ->
718
723
    Channel = lookup_channel(DG, Id),
719
724
    Proxy = connect_a_pull_consumer(Channel, PC, 'SEQUENCE_EVENT'),
720
725
    {reply, Proxy, State}.
727
732
%%              {'EXCEPTION', #'CosNotifyChannelAdmin_ChannelNotFound'{}} |
728
733
%% Description: 
729
734
%%----------------------------------------------------------------------
730
 
connect_sequence_push_supplier_with_id(OE_This, #state{graph = DG} = State, PS, Id) ->
 
735
connect_sequence_push_supplier_with_id(_OE_This, #state{graph = DG} = State, PS, Id) ->
731
736
    Channel = lookup_channel(DG, Id),
732
737
    Proxy = connect_a_push_supplier(Channel, PS, 'SEQUENCE_EVENT'),
733
738
    {reply, Proxy, State}.
740
745
%%              {'EXCEPTION', #'CosNotifyChannelAdmin_ChannelNotFound'{}} |
741
746
%% Description: 
742
747
%%----------------------------------------------------------------------
743
 
connect_sequence_pull_supplier_with_id(OE_This, #state{graph = DG} = State, PS, Id) ->
 
748
connect_sequence_pull_supplier_with_id(_OE_This, #state{graph = DG} = State, PS, Id) ->
744
749
    type_check(PS, 'CosNotifyComm_SequencePullSupplier'),
745
750
    Channel = lookup_channel(DG, Id),
746
751
    Proxy = connect_a_pull_supplier(Channel, PS, 'SEQUENCE_EVENT'),
755
760
%% Returns    : CosNotification::QoSProperties
756
761
%% Description: 
757
762
%%----------------------------------------------------------------------
758
 
get_qos(OE_This, #state{cyclic = Cyclic, diamonds = Diamonds} = State) ->
 
763
get_qos(_OE_This, #state{cyclic = Cyclic, diamonds = Diamonds} = State) ->
759
764
    {reply, [#'CosNotification_Property'
760
765
             {name = ?DiamondDetection, 
761
766
              value = any:create(orber_tc:short(), Diamonds)}, 
770
775
%%              {'EXCEPTION', #'CosNotification_UnsupportedQoS{}}
771
776
%% Description: 
772
777
%%----------------------------------------------------------------------
773
 
set_qos(OE_This, State, NewQoS) ->
 
778
set_qos(_OE_This, State, NewQoS) ->
774
779
    QoS = cosEventDomainApp:get_qos(NewQoS),
775
780
    set_qos_helper(QoS, State, []).
776
781
    
820
825
%%              {'EXCEPTION', #'CosNotification_UnsupportedQoS{}}
821
826
%% Description: NamedPropertyRangeSeq is of out-type
822
827
%%----------------------------------------------------------------------
823
 
validate_qos(OE_This, State, WantedQoS) ->
 
828
validate_qos(_OE_This, State, WantedQoS) ->
824
829
    QoS = cosEventDomainApp:get_qos(WantedQoS),
825
830
    {reply, {ok, validate_qos_helper(QoS, State, [], [])}, State}.
826
831
 
881
886
%% Returns    : CosNotification::AdminProperties
882
887
%% Description: No Admins currently supported
883
888
%%----------------------------------------------------------------------
884
 
get_admin(OE_This, State) ->
 
889
get_admin(_OE_This, State) ->
885
890
    {reply, [], State}.
886
891
 
887
892
%%---------------------------------------------------------------------%
891
896
%%              {'EXCEPTION', #'CosNotification_UnsupportedAdmin{}}
892
897
%% Description: No Admins currently supported
893
898
%%----------------------------------------------------------------------
894
 
set_admin(OE_This, State, NewAdmins) ->
 
899
set_admin(_OE_This, State, NewAdmins) ->
895
900
    cosEventDomainApp:get_admin(NewAdmins),
896
901
    {reply, ok, State}.
897
902
 
927
932
    {filter_candidates(COut), filter_candidates(CIn), Max}.
928
933
 
929
934
 
930
 
find_candidates(DG, Vertex) ->
 
935
find_candidates(DG, _Vertex) ->
931
936
    %% We should use the fact that we know one of the vertices.
932
937
    Edges = digraph:edges(DG),
933
938
    {COut, CIn, Max} = find_candidates_helper(Edges, [], [], DG, 0),
936
941
find_candidates_helper([], AccOut, AccIn, _, Counter) ->
937
942
    {lists:sort(AccOut), lists:sort(AccIn), Counter};
938
943
find_candidates_helper([H|T], AccOut, AccIn, DG, Counter) ->
939
 
    {H, V1, V2, Label} = digraph:edge(DG, H),
 
944
    {H, V1, V2, _Label} = digraph:edge(DG, H),
940
945
    find_candidates_helper(T, [{V1, V2}|AccOut], [{V2,V1}|AccIn], DG, Counter+1).
941
946
 
942
947
filter_candidates([]) ->
943
948
    [];
944
949
filter_candidates([{V1, V2}|T]) ->
945
950
    filter_candidates([{V1, V2}|T], V1, [], []).
946
 
filter_candidates([], V, [Acc1], Acc2) ->
 
951
filter_candidates([], _V, [_Acc1], Acc2) ->
947
952
    %% Only one in/out connection. Hence, cannot be start- or end-point
948
953
    %% of a diamond.
949
954
    lists:reverse(Acc2);
951
956
    lists:reverse([{V, lists:reverse(Acc1)}|Acc2]);
952
957
filter_candidates([{V1, V2}|T], V1, Acc1, Acc2) ->
953
958
    filter_candidates(T, V1, [V2|Acc1], Acc2);
954
 
filter_candidates([{V1, V2}|T], V, [Acc1], Acc2) ->
 
959
filter_candidates([{V1, V2}|T], _V, [_Acc1], Acc2) ->
955
960
    %% Only one in/out connection. Hence, cannot be start- or end-point
956
961
    %% of a diamond.
957
962
    filter_candidates(T, V1, [V2], Acc2);
975
980
%%              duplicates may be generated. For example, #2/#3 is a sub-set of #1
976
981
%%              but they are as well diamonds.
977
982
%%----------------------------------------------------------------------
978
 
evaluate_candidates(DG, [], _, Acc, Max, _) ->
 
983
evaluate_candidates(_DG, [], _, Acc, _Max, _) ->
979
984
    Acc;
980
985
evaluate_candidates(DG, [{V, OutV}|T], CIn, Acc, Max, FindAll) ->
981
986
    case evaluate_candidates_helper(DG, V, OutV, CIn, [], FindAll) of
992
997
    Diamond;
993
998
evaluate_candidates_helper(_, _, _, [], Diamonds, _) ->
994
999
    Diamonds;
995
 
evaluate_candidates_helper(DG, V1, OutV, [{V1, InV}|T], Diamonds, FindAll) ->
 
1000
evaluate_candidates_helper(DG, V1, OutV, [{V1, _InV}|T], Diamonds, FindAll) ->
996
1001
    evaluate_candidates_helper(DG, V1, OutV, T, Diamonds, FindAll);
997
1002
evaluate_candidates_helper(DG, V1, OutV, [{V2, InV}|T], Diamonds, FindAll) ->
998
1003
    case double_match(OutV, InV, [], V1, V2) of
1057
1062
is_member([_|T], H) ->
1058
1063
    is_member(T, H).
1059
1064
 
1060
 
double_match([], _, [Matched], _, _) ->
 
1065
double_match([], _, [_Matched], _, _) ->
1061
1066
    [];
1062
1067
double_match([], _, Matched, _, _) ->
1063
1068
    Matched;
1064
 
double_match(_, [], [Matched], _, _) ->
 
1069
double_match(_, [], [_Matched], _, _) ->
1065
1070
    [];
1066
1071
double_match(_, [], Matched, _, _) ->
1067
1072
    Matched;
1069
1074
    double_match(T1, T2, [[V1,H,V2] | Matched], V1, V2);
1070
1075
double_match([H1|T1], [H2|T2], Matched, V1, V2) when H1 > H2 ->
1071
1076
    double_match([H1|T1], T2, Matched, V1, V2);
1072
 
double_match([H1|T1], [H2|T2], Matched, V1, V2) ->
 
1077
double_match([_H1|T1], [H2|T2], Matched, V1, V2) ->
1073
1078
    double_match(T1, [H2|T2], Matched, V1, V2).
1074
1079
 
1075
1080
double_match_exclude([], _, Matched, _, _) ->
1087
1092
    double_match_exclude(T1, T2, [[V1,H,V2] | Matched], V1, V2);
1088
1093
double_match_exclude([H1|T1], [H2|T2], Matched, V1, V2) when H1 > H2 ->
1089
1094
    double_match_exclude([H1|T1], T2, Matched, V1, V2);
1090
 
double_match_exclude([H1|T1], [H2|T2], Matched, V1, V2) ->
 
1095
double_match_exclude([_H1|T1], [H2|T2], Matched, V1, V2) ->
1091
1096
    double_match_exclude(T1, [H2|T2], Matched, V1, V2).
1092
1097
 
1093
1098
 
1116
1121
get_path(G, V1, V2, E1, E2) ->
1117
1122
    one_path(digraph:out_neighbours(G, V1), V2, [], [V1], [V1], G, E1, E2).
1118
1123
 
1119
 
one_path([E1|Vs], W, Cont, Xs, Ps, G, E1, E2) ->
1120
 
    one_path([], W, Cont, Xs, Ps, G, E1, E2);
1121
 
one_path([E2|Vs], W, Cont, Xs, Ps, G, E1, E2) ->
1122
 
    one_path([], W, Cont, Xs, Ps, G, E1, E2);
1123
 
one_path([W|Ws], W, Cont, Xs, Ps, G, E1, E2) ->
 
1124
one_path([E1|_Vs], W, Cont, Xs, Ps, G, E1, E2) ->
 
1125
    one_path([], W, Cont, Xs, Ps, G, E1, E2);
 
1126
one_path([E2|_Vs], W, Cont, Xs, Ps, G, E1, E2) ->
 
1127
    one_path([], W, Cont, Xs, Ps, G, E1, E2);
 
1128
one_path([W|_Ws], W, _Cont, _Xs, Ps, _G, _E1, _E2) ->
1124
1129
    [W|Ps];
1125
1130
one_path([V|Vs], W, Cont, Xs, Ps, G, E1, E2) ->
1126
1131
    case lists:member(V, Xs) of
1144
1149
        true ->
1145
1150
            ok;
1146
1151
        What ->
1147
 
            orber:debug_level_print("[~p] CosEventDomainAdmin:type_check(); 
1148
 
Object of incorrect type supplied; should be: ~p
1149
 
Failed due to: ~p", [?LINE, Mod, What], ?DEBUG_LEVEL),
 
1152
            orber:dbg("[~p] CosEventDomainAdmin:type_check();~n"
 
1153
                      "Object of incorrect type supplied; should be: ~p~n"
 
1154
                      "Failed due to: ~p", [?LINE, Mod, What], ?DEBUG_LEVEL),
1150
1155
            corba:raise(#'BAD_PARAM'{minor=507, completion_status=?COMPLETED_NO})
1151
1156
    end.
1152
1157
 
1177
1182
%%----------------------------------------------------------------------
1178
1183
lookup_connection(DG, Id) ->
1179
1184
    case digraph:edge(DG, Id) of
1180
 
        {Id, SId, CId, Connection} ->
 
1185
        {Id, _SId, _CId, Connection} ->
1181
1186
            Connection;
1182
1187
        false ->
1183
1188
            corba:raise(#'CosEventDomainAdmin_ConnectionNotFound'{})
1193
1198
%%----------------------------------------------------------------------
1194
1199
lookup_connection_data(DG, Id) ->
1195
1200
    case digraph:edge(DG, Id) of
1196
 
        {Id, SId, CId, #connection{data = Connection}} ->
 
1201
        {Id, _SId, _CId, #connection{data = Connection}} ->
1197
1202
            Connection;
1198
1203
        false ->
1199
1204
            corba:raise(#'CosEventDomainAdmin_ConnectionNotFound'{})
1206
1211
%% Returns  : ok
1207
1212
%% Effect   : 
1208
1213
%%----------------------------------------------------------------------
1209
 
close_connections(DG, []) ->
 
1214
close_connections(_DG, []) ->
1210
1215
    ok;
1211
1216
close_connections(DG, [H|T]) ->
1212
1217
    #connection{supplier=S, consumer=C, data=Connection} = 
1263
1268
        'CosNotifyChannelAdmin_EventChannel':'_get_default_consumer_admin'(S),
1264
1269
    case Style of
1265
1270
        'Push' ->
1266
 
            {Proxy, Id} = 
 
1271
            {Proxy, _Id} = 
1267
1272
                'CosNotifyChannelAdmin_ConsumerAdmin':
1268
1273
                obtain_notification_push_supplier(Admin, Type),
1269
1274
            CProxy = connect_a_push_supplier(C, Proxy, Type),
1280
1285
            end,
1281
1286
            {ok, Proxy, CProxy};
1282
1287
        'Pull' ->
1283
 
            {Proxy, Id} = 
 
1288
            {Proxy, _Id} = 
1284
1289
                'CosNotifyChannelAdmin_ConsumerAdmin':
1285
1290
                obtain_notification_pull_supplier(Admin, Type),
1286
1291
            CProxy = connect_a_pull_supplier(C, Proxy, Type),
1311
1316
connect_a_pull_consumer(Channel, PC, Type) ->
1312
1317
    Admin = 
1313
1318
        'CosNotifyChannelAdmin_EventChannel':'_get_default_consumer_admin'(Channel),
1314
 
    {Proxy, Id} = 
 
1319
    {Proxy, _Id} = 
1315
1320
        'CosNotifyChannelAdmin_ConsumerAdmin':obtain_notification_pull_supplier(Admin, 
1316
1321
                                                                                Type),
1317
1322
    case Type of
1337
1342
connect_a_push_consumer(Channel, PC, Type) ->
1338
1343
    Admin = 
1339
1344
        'CosNotifyChannelAdmin_EventChannel':'_get_default_consumer_admin'(Channel),
1340
 
    {Proxy, Id} = 
 
1345
    {Proxy, _Id} = 
1341
1346
        'CosNotifyChannelAdmin_ConsumerAdmin':obtain_notification_push_supplier(Admin, 
1342
1347
                                                                                Type),
1343
1348
    case Type of
1363
1368
connect_a_pull_supplier(Channel, PS, Type) ->
1364
1369
    Admin = 
1365
1370
        'CosNotifyChannelAdmin_EventChannel':'_get_default_supplier_admin'(Channel),
1366
 
    {Proxy, Id} = 
 
1371
    {Proxy, _Id} = 
1367
1372
        'CosNotifyChannelAdmin_SupplierAdmin':obtain_notification_pull_consumer(Admin, 
1368
1373
                                                                                Type),
1369
1374
    case Type of
1389
1394
connect_a_push_supplier(Channel, PS, Type) ->
1390
1395
    Admin = 
1391
1396
        'CosNotifyChannelAdmin_EventChannel':'_get_default_supplier_admin'(Channel),
1392
 
    {Proxy, Id} = 
 
1397
    {Proxy, _Id} = 
1393
1398
        'CosNotifyChannelAdmin_SupplierAdmin':obtain_notification_push_consumer(Admin, 
1394
1399
                                                                                Type),
1395
1400
    case Type of