Added AsyncEvenBus and EventBus configuration modules implementations. Added EventBus...
[controller.git] / opendaylight / config / threadpool-config-impl / src / main / yang / threadpool-impl.yang
1 // vi: set smarttab et sw=4 tabstop=4:
2 module threadpool-impl {
3     yang-version 1;
4     namespace "urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl";
5     prefix "th-java";
6
7     import threadpool { prefix th; revision-date 2013-04-09; }
8     import config { prefix config; revision-date 2013-04-05; }
9     import rpc-context { prefix rpcx; revision-date 2013-06-17; }
10
11     organization "Cisco Systems, Inc.";
12
13     contact "Robert Varga <rovarga@cisco.com>";
14
15     description
16         "This module contains the base YANG definitions for
17          thread services pure Java implementation.
18
19         Copyright (c)2013 Cisco Systems, Inc. All rights reserved.;
20         
21         This program and the accompanying materials are made available
22                 under the terms of the Eclipse Public License v1.0 which
23                 accompanies this distribution, and is available at
24                 http://www.eclipse.org/legal/epl-v10.html";
25
26     revision "2013-04-05" {
27         description
28             "Updated to work with new anchors.";
29     }
30
31     revision "2013-04-03" {
32         description
33             "Initial revision by Anton Tkacik, Tomas Olvecky and
34              Robert Varga.";
35     }
36
37     identity eventbus {
38         base config:module-type;
39         config:provided-service th:eventbus;
40         config:java-name-prefix EventBus;
41     }
42
43         augment "/config:modules/config:module/config:configuration" {
44                 case eventbus {
45                         when "/config:modules/config:module/config:type = 'eventbus'";
46                         // No real configuration
47         }
48     }
49
50         augment "/config:modules/config:module/config:state" {
51                 case eventbus {
52                         when "/config:modules/config:module/config:type = 'eventbus'";
53                         rpcx:rpc-context-instance "event-bus-rpc";
54         }
55     }
56
57         identity event-bus-rpc;
58
59     identity async-eventbus {
60         base config:module-type;
61         config:provided-service th:eventbus;
62         config:java-name-prefix AsyncEventBus;
63     }
64
65         augment "/config:modules/config:module/config:configuration" {
66                 case async-eventbus {
67                         when "/config:modules/config:module/config:type = 'async-eventbus'";
68                         container threadpool {
69                                 uses config:service-ref {
70                                         refine type {
71                                                 //mandatory true;
72                                                 config:required-identity th:threadpool;
73                                         }
74                                 }
75                         }
76                 }
77         }
78
79         augment "/config:modules/config:module/config:state" {
80                 case async-eventbus {
81                         when "/config:modules/config:module/config:type = 'async-eventbus'";
82                         rpcx:rpc-context-instance "event-bus-rpc";
83         }
84     }
85
86
87
88         rpc get-dead-events-count {
89                 config:java-name-prefix countDeadEvents;
90                 input {
91                         uses rpcx:rpc-context-ref {
92                                 refine context-instance {
93                                         rpcx:rpc-context-instance event-bus-rpc;
94                                 }
95                         }
96                 }
97                 output {
98                         leaf result {
99                                 type uint32;
100                         }
101                 }
102         }
103 }
104