Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tao / Server_Strategy_Factory.h
blobe2ada048d39b447325cc30dcd57a36e9fb5f0c49
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Server_Strategy_Factory.h
7 * @author Chris Cleeland
8 */
9 //=============================================================================
11 #ifndef TAO_SERVER_STRATEGY_FACTORY_H
12 #define TAO_SERVER_STRATEGY_FACTORY_H
14 #include /**/ "ace/pre.h"
16 #include "ace/Service_Object.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include /**/ "tao/TAO_Export.h"
23 #include "tao/Basic_Types.h"
25 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
27 class TAO_ORB_Core;
29 enum TAO_Demux_Strategy
31 TAO_LINEAR,
32 TAO_DYNAMIC_HASH,
33 TAO_ACTIVE_DEMUX,
34 TAO_USER_DEFINED
37 /**
38 * @class TAO_Server_Strategy_Factory
40 * @brief Base class for the server's abstract factory that manufactures
41 * various strategies of special utility to it. This simply
42 * serves as an interface to a subclass that REALLY gets
43 * specified and loaded by the Service Configurator.
45 class TAO_Export TAO_Server_Strategy_Factory : public ACE_Service_Object
47 public:
48 struct Active_Object_Map_Creation_Parameters
50 /// Constructor.
51 Active_Object_Map_Creation_Parameters ();
53 /// Default size of object lookup table.
54 CORBA::ULong active_object_map_size_;
56 /// The type of lookup/demultiplexing strategy being used for user
57 /// id policy
58 TAO_Demux_Strategy object_lookup_strategy_for_user_id_policy_;
60 /// The type of lookup/demultiplexing strategy being used for
61 /// system id policy
62 TAO_Demux_Strategy object_lookup_strategy_for_system_id_policy_;
64 /// The type of reverse lookup/demultiplexing strategy being used
65 /// for the UNIQUE_ID policy
66 TAO_Demux_Strategy reverse_object_lookup_strategy_for_unique_id_policy_;
68 /// Flag to indicate whether the active hint should be used with
69 /// the IOR.
70 int use_active_hint_in_ids_;
72 /// Flag to indicate whether reactivations of servants was required
73 /// (under the system id policy). If not, certain resources may
74 /// not be required.
75 int allow_reactivation_of_system_ids_;
77 CORBA::ULong poa_map_size_;
79 TAO_Demux_Strategy poa_lookup_strategy_for_transient_id_policy_;
81 TAO_Demux_Strategy poa_lookup_strategy_for_persistent_id_policy_;
83 int use_active_hint_in_poa_names_;
86 /// Constructor.
87 TAO_Server_Strategy_Factory ();
89 /// Destructor.
90 virtual ~TAO_Server_Strategy_Factory();
92 /**
93 * Call <open> on various strategies. This is not performed in
94 * <init> so that the other portions of the ORB have a chance to
95 * "settle" in their initialization since the strategies herein
96 * might need some of that information.
98 virtual int open (TAO_ORB_Core* orb_core) = 0;
100 /// Are server connections active (i.e. run in their own thread)
101 virtual int activate_server_connections () = 0;
104 * Obtain the timeout value used by the thread-per-connection server
105 * threads to poll the shutdown flag in the ORB.
106 * Return -1 if the ORB should use the compile-time defaults.
107 * If the return value is zero then the threads block without
108 * timeouts.
110 virtual int thread_per_connection_timeout (ACE_Time_Value &timeout) = 0;
112 /// The thread activation parameters
113 virtual int server_connection_thread_flags () = 0;
114 virtual int server_connection_thread_count () = 0;
116 /// Return the active object map creation parameters.
117 virtual
118 const Active_Object_Map_Creation_Parameters &
119 active_object_map_creation_parameters () const;
121 protected:
122 /// Active object map creation parameters.
123 Active_Object_Map_Creation_Parameters active_object_map_creation_parameters_;
126 TAO_END_VERSIONED_NAMESPACE_DECL
128 #include /**/ "ace/post.h"
130 #endif /* TAO_SERVER_STRATEGY_FACTORY_H */