Server_Strategy_Factory.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file     Server_Strategy_Factory.h
00006  *
00007  *  Server_Strategy_Factory.h,v 1.31 2006/03/10 07:19:06 jtc Exp
00008  *
00009  *  @author  Chris Cleeland
00010  */
00011 //=============================================================================
00012 
00013 #ifndef TAO_SERVER_STRATEGY_FACTORY_H
00014 #define TAO_SERVER_STRATEGY_FACTORY_H
00015 
00016 #include /**/ "ace/pre.h"
00017 
00018 #include "ace/Service_Object.h"
00019 
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif /* ACE_LACKS_PRAGMA_ONCE */
00023 
00024 #include "tao/TAO_Export.h"
00025 #include "tao/Basic_Types.h"
00026 
00027 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00028 
00029 class TAO_ORB_Core;
00030 
00031 enum TAO_Demux_Strategy
00032 {
00033   TAO_LINEAR,
00034   TAO_DYNAMIC_HASH,
00035   TAO_ACTIVE_DEMUX,
00036   TAO_USER_DEFINED
00037 };
00038 
00039 /**
00040  * @class TAO_Server_Strategy_Factory
00041  *
00042  * @brief Base class for the server's abstract factory that manufactures
00043  * various strategies of special utility to it.  This simply
00044  * serves as an interface to a subclass that REALLY gets
00045  * specified and loaded by the Service Configurator.
00046  */
00047 class TAO_Export TAO_Server_Strategy_Factory : public ACE_Service_Object
00048 {
00049 public:
00050 
00051   struct Active_Object_Map_Creation_Parameters
00052   {
00053     /// Constructor.
00054     Active_Object_Map_Creation_Parameters (void);
00055 
00056     /// Default size of object lookup table.
00057     CORBA::ULong active_object_map_size_;
00058 
00059     /// The type of lookup/demultiplexing strategy being used for user
00060     /// id policy
00061     TAO_Demux_Strategy object_lookup_strategy_for_user_id_policy_;
00062 
00063     /// The type of lookup/demultiplexing strategy being used for
00064     /// system id policy
00065     TAO_Demux_Strategy object_lookup_strategy_for_system_id_policy_;
00066 
00067     /// The type of reverse lookup/demultiplexing strategy being used
00068     /// for the UNIQUE_ID policy
00069     TAO_Demux_Strategy reverse_object_lookup_strategy_for_unique_id_policy_;
00070 
00071     /// Flag to indicate whether the active hint should be used with
00072     /// the IOR.
00073     int use_active_hint_in_ids_;
00074 
00075     /// Flag to indicate whether reactivations of servants was required
00076     /// (under the system id policy).  If not, certain resources may
00077     /// not be required.
00078     int allow_reactivation_of_system_ids_;
00079 
00080     CORBA::ULong poa_map_size_;
00081 
00082     TAO_Demux_Strategy poa_lookup_strategy_for_transient_id_policy_;
00083 
00084     TAO_Demux_Strategy poa_lookup_strategy_for_persistent_id_policy_;
00085 
00086     int use_active_hint_in_poa_names_;
00087   };
00088 
00089   // = Initialization and termination methods.
00090   /// Constructor.
00091   TAO_Server_Strategy_Factory (void);
00092 
00093   /// Destructor.
00094   virtual ~TAO_Server_Strategy_Factory(void);
00095 
00096   /**
00097    * Call <open> on various strategies.  This is not performed in
00098    * <init> so that the other portions of the ORB have a chance to
00099    * "settle" in their initialization since the streategies herein
00100    * might need some of that information.
00101    */
00102   virtual int open (TAO_ORB_Core* orb_core);
00103 
00104   /// Enable POA locking?
00105   virtual int enable_poa_locking (void);
00106 
00107   /// Are server connections active (i.e. run in their own thread)
00108   virtual int activate_server_connections (void);
00109 
00110   /**
00111    * Obtain the timeout value used by the thread-per-connection server
00112    * threads to poll the shutdown flag in the ORB.
00113    * Return -1 if the ORB should use the compile-time defaults.
00114    * If the return value is zero then the threads block without
00115    * timeouts.
00116    */
00117   virtual int thread_per_connection_timeout (ACE_Time_Value &timeout);
00118 
00119   /// The thread activation parameters
00120   virtual int server_connection_thread_flags (void);
00121   virtual int server_connection_thread_count (void);
00122 
00123   /// Return the active object map creation parameters.
00124   virtual
00125   const Active_Object_Map_Creation_Parameters &
00126   active_object_map_creation_parameters (void) const;
00127 
00128 protected:
00129   /// Active object map creation parameters.
00130   Active_Object_Map_Creation_Parameters active_object_map_creation_parameters_;
00131 };
00132 
00133 TAO_END_VERSIONED_NAMESPACE_DECL
00134 
00135 #include /**/ "ace/post.h"
00136 
00137 #endif /* TAO_SERVER_STRATEGY_FACTORY_H */

Generated on Thu Nov 9 11:54:21 2006 for TAO by doxygen 1.3.6