summaryrefslogtreecommitdiff
path: root/CIAO/ciao/CIAO_ServerResources.idl
blob: de14402f835692677378f09a195abfc7c0500721 (plain)
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
// $Id$

/**
 * @file CIAO_ServerResources.idl
 *
 * @brief A collection of IDL data types for
 *
 * @author Nanbor Wang
 */

#if !defined (CIAO_SERVERRESOURCES_IDL)
#define CIAO_SERVERRESOURCES_IDL

#include <orb.idl>

module CIAO
{
  module DAnCE
  {
    /**
     * @brief A single command line argument corresponds to a string as
     * in the case of "argv".
     */
    typedef string CommandlineArg;
    /**
     * @brief A list of command line arguments which a
     * NodeApplicationManager will use to start up the NodeApplication
     * this list is associated to.  The command line arguments will be
     * appended to the command line in order.
     */
    typedef sequence<CommandlineArg> CommandlineArgs;

    /**
     * @brief A string containing the filename of the svc.conf file the
     * NodeApplication uses.  The current approach of specifying
     * svc.conf filename directly some harder problems such as
     * distribution of svc.conf files and the relative/absolute path to
     * the svc.conf file (the ServerResrouces xml document will have to
     * assume the svc.conf file will be available at specific location.)
     */
    typedef string SvcconfURI;

    /**
     * @brief enumeration of ORB Resource Types (ORT) supported in RT
     * extension.
     */
    enum ORBResourceType
      {
        ORT_THREADPOOL,
        ORT_THREADPOOLWITHLANES,
        ORT_CONNECTIONBANDS
      };

    typedef short Priority;

    /**
     * @brief Define a threadpool resource that an ORB must provide
     */
    struct ORS_Threadpool
    {
      string Id;
      unsigned long stacksize;
      unsigned long static_threads;
      unsigned long dynamic_threads;
      Priority default_priority;
      boolean allow_request_buffering;
      unsigned long max_buffered_requests;
      unsigned long max_request_buffer_size;
    };

    typedef sequence<ORS_Threadpool> ORS_ThreadpoolSeq;

    /**
     * @brief Defines the configuration of a threadpool lane.  We need
     * to redefine it here to avoid dependency to RTCORBA library.
     */
    struct ORS_ThreadpoolLane
    {
      Priority lane_priority;
      unsigned long static_threads;
      unsigned long dynamic_threads;
    };

    /**
     * @brief Defines a set of threadpool lanes.  We need
     * to redefine it here to avoid dependency to RTCORBA library.
     */
    typedef sequence<ORS_ThreadpoolLane> ORS_ThreadpoolLanes;

    /**
     * @brief Defines a Threadpool with Lanes resource that an ORB
     * must provide.
     */
    struct ORS_ThreadpoolWithLanes
    {
      string Id;
      unsigned long stacksize;
      ORS_ThreadpoolLanes threadpool_lanes;
      boolean allow_borrowing;
      boolean allow_request_buffering;
      unsigned long max_buffered_requests;
      unsigned long max_request_buffer_size;
    };

    typedef sequence<ORS_ThreadpoolWithLanes> ORS_ThreadpoolWithLanesSeq;

    /**
     * @brief Define a priority band for BandedConnection policies.
     */
    struct ORS_PriorityBand
    {
      Priority low;
      Priority high;
    };
    /**
     * @brief Define a list of priority bands for BandedConnection
     * policies.
     */
    typedef sequence<ORS_PriorityBand> ORS_PriorityBands;

    /**
     * @brief Define the information needed to create a
     * BandedConnection policy.  This info can be referred to via its
     * name (Id).
     */
    struct ORS_ConnectionBands
    {
      string Id;
      ORS_PriorityBands bands;
    };

    typedef sequence<ORS_ConnectionBands> ORS_ConnectionBandsSeq;

    /**
     * @brief Collection of resources managed by the NodeApplication
     * ORB.
     */
    struct ORBResource
    {
      ORS_ThreadpoolSeq threadpool_list;

      ORS_ThreadpoolWithLanesSeq threadpool_with_lanes_list;

      ORS_ConnectionBandsSeq connection_bands_list;
    };

    typedef sequence<ORBResource, 1> ORBResources;

    // =================================================================

    /**
     * @brief PolicyType supported by DAnCE extension.  Again, we are
     * redefining these value to avoid dependencies to various ORB
     * modules such as RTCORBA.
     */
    const CORBA::PolicyType PRIORITY_MODEL_POLICY_TYPE = 40;
    const CORBA::PolicyType THREADPOOL_POLICY_TYPE = 41;
    const CORBA::PolicyType PRIORITY_BANDED_CONNECTION_POLICY_TYPE = 45;

    enum PriorityModel
      {
        CLIENT_PROPAGATED,
        SERVER_DECLARED
      };

    /**
     * @brief Defines data required for creating a PriorityModel Policy
     */
    struct PriorityModelPolicyDef
    {
      PriorityModel priority_model;
      Priority server_priority;
    };

    /**
     * @brief Define data required for creating a Threadpool policy
     */
    struct ThreadpoolPolicyDef
    {
      string Id;                // Threadpool name defined in
                                // ORBResource
    };

    /**
     * @brief Define data required for creating a PriorityBandedConnection
     * policy
     */
    struct PriorityBandedConnectionPolicyDef
    {
      string Id;                // PriorityBands name defined in
                                // ORBResource
    };

    union PolicyDef switch (CORBA::PolicyType)
    {
    case 40: PriorityModelPolicyDef PriorityModelDef;
    case 41: ThreadpoolPolicyDef    ThreadpoolDef;
    case 45: PriorityBandedConnectionPolicyDef PriorityBandedConnectionDef;
    };

    /**
     * @brief Define a set of policy definitions.
     */
    typedef sequence<PolicyDef> PolicyDefs;

    /**
     * @brief A policy set is named.
     */
    struct PolicySet
    {
      string Id;                // Name of this policy set
      PolicyDefs policies;
    };

    /**
     * @brief A list of all policy sets.
     */
    typedef sequence<PolicySet> PolicySets;

    struct ORBConfigs
    {
      ORBResources orb_resources;
      PolicySets policy_set;
    };

    struct ServerResource
    {
      string Id;

      CommandlineArgs args;
      SvcconfURI svcconf;
      ORBConfigs orb_config;
    };
  };
};

#endif /* CIAO_SERVERRESOURCES_IDL */