summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_IIOP_Factory.h
blob: 1fbd4a03b2c43c4956e152035a33142bac494c1c (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
// -*- C++ -*-

/**
 *  @file   EC_Gateway_IIOP_Factory.h
 *
 *  $Id$
 *
 *  @author Johnny Willemsen  (jwillemsen@remedy.nl)
 *
 */

#ifndef TAO_EC_GATEWAY_IIOP_FACTORY_H
#define TAO_EC_GATEWAY_IIOP_FACTORY_H

#include /**/ "ace/pre.h"
#include "ace/Service_Config.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "ace/Time_Value.h"
#include "ace/Service_Object.h"
#include "ace/SString.h"

#include /**/ "orbsvcs/Event/event_serv_export.h"

#include "tao/Versioned_Namespace.h"

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

class TAO_ECG_ConsumerEC_Control;
class TAO_EC_Gateway_IIOP;

/**
 * @class TAO_EC_Gateway_IIOP_Factory
 *
 * @brief Factory for the EC_Gateway_IIOP settings
 *
 * Default configuration values can be found in ECG_Defaults.h
 */
class TAO_RTEvent_Serv_Export TAO_EC_Gateway_IIOP_Factory
  : public ACE_Service_Object
{
public:
  TAO_EC_Gateway_IIOP_Factory (void);
  virtual ~TAO_EC_Gateway_IIOP_Factory (void);

  /// The Service_Object entry points.
  //@{
  virtual int init (int argc, ACE_TCHAR* argv[]);
  virtual int fini (void);
  //@}

  /// Helper function to register the Gateway into the service
  /// configurator.
  static int init_svcs (void);

  /// Create the consumer event channel control.
  TAO_ECG_ConsumerEC_Control *
      create_consumerec_control (TAO_EC_Gateway_IIOP* gateway);

  /// Destroy consumer event channel control.
  void destroy_consumerec_control (TAO_ECG_ConsumerEC_Control* x);

  /// Accessors to use_ttl flag
  int use_ttl (void) const;

  /// Accessors to use_consumer_proxy_map flag
  int use_consumer_proxy_map (void) const;

private:
  /// Helper for agrument parsing.  Prints out an error message about
  /// unsupported option value.
  void unsupported_option_value (const char * option_name,
                                 const char * option_value);

protected:
  /// Use this ORB to locate global resources.
  ACE_CString orbid_;

  /// The control policy for the consumer event channel
  int consumer_ec_control_;

  /// The consumer event channel control periods in usecs
  int consumer_ec_control_period_;

  /// The control timeout in usecs for the consumer event channel
  ACE_Time_Value consumer_ec_control_timeout_;

  /// If 1, we use the TTL flags, if 0, we just ignore TTL.
  /// @note When this flag is set to 0, make sure that no recursive structures
  /// exists in the gateway setup for the same source/type combination, else
  /// one event will flow continuosly through all gateways.
  int use_ttl_;

  /// The flag for using the consumer proxy map. With 1 the consumer proxy map
  /// is used, meaning that for each unique source id we use a different
  /// proxy push consumer, if 0, we only use one proxy push consumer for all
  /// source ids.
  int use_consumer_proxy_map_;
};

TAO_END_VERSIONED_NAMESPACE_DECL

ACE_STATIC_SVC_DECLARE (TAO_EC_Gateway_IIOP_Factory)
ACE_FACTORY_DECLARE (TAO_RTEvent_Serv, TAO_EC_Gateway_IIOP_Factory)

#if defined (__ACE_INLINE__)
#include "orbsvcs/Event/EC_Gateway_IIOP_Factory.i"
#endif /* __ACE_INLINE__ */

#include /**/ "ace/post.h"

#endif /* TAO_EC_GATEWAY_IIOP_FACTORY_H */