summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/NotifyExt.idl
blob: 5e0d9ca9b69fc61d135bd3885611411ba2894892 (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
/**
 * @file NotifyExt.idl
 *
 * @brief Additional interfaces for QoS properties to Notify.
 *
 * $Id$
 *
 * @author Pradeep Gore <pradeep@oomworks.com>
 */

#ifndef _NOTIFY_EXT_IDL_
#define _NOTIFY_EXT_IDL_

#include "CosNotifyChannelAdmin.idl"

#pragma prefix ""

/**
 * @namespace NotifyExt
 *
 * @brief Notify Extensions.
 */
module NotifyExt
{
  // Priority defs. same as RTCORBA
  typedef short Priority;
  const Priority minPriority = 0;
  const Priority maxPriority = 32767;

  enum PriorityModel
  {
    CLIENT_PROPAGATED,
    SERVER_DECLARED
  };

  /*
   * ThreadPool QoS property,
   */
  const string ThreadPool = "ThreadPool";

  // ThreadPoolParams : same as RTCORBA::create_threadpool
  struct ThreadPoolParams
  {
    PriorityModel priority_model;
    Priority server_priority;

    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;
  };

  /*
   * ThreadPoolLanes QoS property,
   */
  const string ThreadPoolLanes = "ThreadPoolLanes";

  struct ThreadPoolLane
  {
    PriorityModel priority_model;
    Priority server_priority;

    Priority lane_priority;
    unsigned long static_threads;
    unsigned long dynamic_threads;
  };

  typedef sequence <ThreadPoolLane> ThreadPoolLanes_List;

  struct ThreadPoolLanesParams
    {
      PriorityModel priority_model;
      Priority server_priority;

      unsigned long stacksize;
      ThreadPoolLanes_List lanes;
      boolean allow_borrowing;
      boolean allow_request_buffering;
      unsigned long max_buffered_requests;
      unsigned long max_request_buffer_size;
  };

  /**
   * \brief An interface which gets registered with a ReconnectionRegistry.
   *
   * A supplier or consumer must implement this interface in order to
   * allow the Notification Service to attempt to reconnect to it after
   * a failure.  The supplier or consumer must register its instance of
   * this interface with the ReconnectionRegistry.
   */
  interface ReconnectionCallback
  {
    /// Perform operations to reconnect to the Notification Service
    /// after a failure.
    void reconnect (in Object new_connection);

    /// Check to see if the ReconnectionCallba ck is alive
    boolean is_alive ();
  };

  /**
   * \brief An interface that handles registration of suppliers and consumers.
   *
   * This registry should be implemented by an EventChannelFactory and
   * will call the appropriate reconnect methods for all ReconnectionCallback
   * objects registered with it.
   */
  interface ReconnectionRegistry
  {
    typedef long ReconnectionID;
    ReconnectionID register_callback(in ReconnectionCallback reconection);

    void unregister_callback (in ReconnectionID id);

    /// Check to see if the ReconnectionRegistry is alive
    boolean is_alive ();
  };

  /**
   * Extend the EventChannelFactory to have a shutdown method
   * and a Reconnection Registry
   */
  interface EventChannelFactory
    : CosNotifyChannelAdmin::EventChannelFactory
    , ReconnectionRegistry
  {
    void destroy ();
    /// save topology: for diagnostic and testing purposes
    /// Normal topology save is automatic when connectivity persistence
    /// is configured.
    void save_topology();
  };

  interface ConsumerAdmin : CosNotifyChannelAdmin::ConsumerAdmin
  {
    // Create a new push-style proxy supplier
    /**
     * @param ctype The event format that the ProxyConsumer should
     *   support
     * @param proxy_id The ID assigned to the new proxy supplier
     * @param initial_qos Configure the initial QoS properties of the
     *   new Proxy.
     * @return The new ProxySupplier
     * @throws AdminLimitExceeded if a limit in this admin is reached,
     *   such as the maximum number of proxies.
     * @throws CosNotification::UnsupportedQoS if the requested QoS
     *   properties cannot be satisfied or are invalid
     */
    CosNotifyChannelAdmin::ProxySupplier obtain_notification_push_supplier_with_qos (in CosNotifyChannelAdmin::ClientType ctype,
                                                                                     out CosNotifyChannelAdmin::ProxyID proxy_id,
                                                                                     in CosNotification::QoSProperties initial_qos)
      raises ( CosNotifyChannelAdmin::AdminLimitExceeded,
               CosNotification::UnsupportedQoS
               );
  };

  interface SupplierAdmin : CosNotifyChannelAdmin::SupplierAdmin
  {
    // Create a new push-style proxy supplier
    /**
     * @param ctype The event format that the ProxyConsumer should
     *   support
     * @param proxy_id The ID assigned to the new proxy supplier
     * @param initial_qos Configure the initial QoS properties of the
     *   new Proxy.
     * @return The new ProxyConsumer
     * @throws AdminLimitExceeded if a limit in this admin is reached,
     *   such as the maximum number of proxies.
     * @throws CosNotification::UnsupportedQoS if the requested QoS
     *   properties cannot be satisfied or are invalid
     */
    CosNotifyChannelAdmin::ProxyConsumer obtain_notification_push_consumer_with_qos (in CosNotifyChannelAdmin::ClientType ctype,
                                                                                     out CosNotifyChannelAdmin::ProxyID proxy_id,
                                                                                     in CosNotification::QoSProperties initial_qos)
      raises ( CosNotifyChannelAdmin::AdminLimitExceeded,
               CosNotification::UnsupportedQoS
               );
  };
};

#endif /* _NOTIFY_EXT_IDL_ */