2
// Options.h,v 4.14 2003/11/09 04:12:07 dhinton Exp
4
// ============================================================================
13
// Douglas C. Schmidt <schmidt@cs.wustl.edu>
15
// ============================================================================
20
#include "ace/config-all.h"
22
#if !defined (ACE_LACKS_PRAGMA_ONCE)
24
#endif /* ACE_LACKS_PRAGMA_ONCE */
26
#include "ace/svc_export.h"
27
#include "ace/Lock_Adapter_T.h"
28
#include "ace/Synch_Traits.h"
29
#include "ace/Thread_Mutex.h"
31
class ACE_Svc_Export Options
34
// Singleton that consolidates all Options for a gatewayd.
36
// = Options that can be enabled/disabled.
39
// = The types of threading strategies.
47
SUPPLIER_ACCEPTOR = 04,
48
CONSUMER_ACCEPTOR = 010,
49
SUPPLIER_CONNECTOR = 020,
50
CONSUMER_CONNECTOR = 040
53
static Options *instance (void);
59
int parse_args (int argc, char *argv[]);
60
// Parse the arguments and set the options.
62
void print_usage(void);
63
// Print the gateway supported parameters.
64
// = Accessor methods.
65
int enabled (int option) const;
66
// Determine if an option is enabled.
68
ACE_Lock_Adapter<ACE_SYNCH_MUTEX> *locking_strategy (void) const;
69
// Gets the locking strategy used for serializing access to the
70
// reference count in <ACE_Message_Block>. If it's 0, then there's
71
// no locking strategy and we're using a REACTIVE concurrency
74
void locking_strategy (ACE_Lock_Adapter<ACE_SYNCH_MUTEX> *);
75
// Set the locking strategy used for serializing access to the
76
// reference count in <ACE_Message_Block>.
78
int performance_window (void) const;
79
// Number of seconds after connection establishment to report
82
int blocking_semantics (void) const;
83
// 0 == blocking connects, ACE_NONBLOCK == non-blocking connects.
85
int socket_queue_size (void) const;
86
// Size of the socket queue (0 means "use default").
88
u_long threading_strategy (void) const;
89
// i.e., REACTIVE, OUTPUT_MT, and/or INPUT_MT.
91
u_short supplier_acceptor_port (void) const;
92
// Our acceptor port number, i.e., the one that we passively listen
93
// on for connections to arrive from a gatewayd and create a
96
u_short consumer_acceptor_port (void) const;
97
// Our acceptor port number, i.e., the one that we passively listen
98
// on for connections to arrive from a gatewayd and create a
101
u_short supplier_connector_port (void) const;
102
// The connector port number, i.e., the one that we use to actively
103
// establish connections with a gatewayd and create a Supplier.
105
u_short consumer_connector_port (void) const;
106
// The connector port number, i.e., the one that we use to actively
107
// establish connections with a gatewayd and create a Consumer.
109
const char *connector_host (void) const;
110
// Our connector port host, i.e., the host running the gatewayd
113
const char *connection_config_file (void) const;
114
// Name of the connection configuration file.
116
const char *consumer_config_file (void) const;
117
// Name of the consumer map configuration file.
119
long max_timeout (void) const;
120
// The maximum retry timeout delay.
122
long max_queue_size (void) const;
123
// The maximum size of the queue.
125
CONNECTION_ID &connection_id (void);
126
// Returns a reference to the next available connection id;
131
MAX_QUEUE_SIZE = 1024 * 1024 * 16,
132
// We'll allow up to 16 megabytes to be queued per-output proxy.
135
// The maximum timeout for trying to re-establish connections.
141
static Options *instance_;
142
// Options Singleton instance.
144
ACE_Lock_Adapter<ACE_SYNCH_MUTEX> *locking_strategy_;
145
// Points to the locking strategy used for serializing access to the
146
// reference count in <ACE_Message_Block>. If it's 0, then there's
147
// no locking strategy and we're using a REACTIVE concurrency
150
int performance_window_;
151
// Number of seconds after connection establishment to report
154
int blocking_semantics_;
155
// 0 == blocking connects, ACE_NONBLOCK == non-blocking connects.
157
int socket_queue_size_;
158
// Size of the socket queue (0 means "use default").
160
u_long threading_strategy_;
161
// i.e., REACTIVE, OUTPUT_MT, and/or INPUT_MT.
164
// Flag to indicate if we want verbose diagnostics.
166
u_short supplier_acceptor_port_;
167
// The acceptor port number, i.e., the one that we passively listen
168
// on for connections to arrive from a gatewayd and create a
171
u_short consumer_acceptor_port_;
172
// The acceptor port number, i.e., the one that we passively listen
173
// on for connections to arrive from a gatewayd and create a
176
u_short supplier_connector_port_;
177
// The connector port number, i.e., the one that we use to actively
178
// establish connections with a gatewayd and create a Supplier.
180
u_short consumer_connector_port_;
181
// The connector port number, i.e., the one that we use to actively
182
// establish connections with a gatewayd and create a Consumer.
185
// The maximum retry timeout delay.
187
long max_queue_size_;
188
// The maximum size of the queue.
190
CONNECTION_ID connection_id_;
191
// The next available connection id.
193
char connection_config_file_[MAXPATHLEN + 1];
194
// Name of the connection configuration file.
196
char consumer_config_file_[MAXPATHLEN + 1];
197
// Name of the consumer map configuration file.
200
#endif /* OPTIONS_H */