Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

default_server.h

Go to the documentation of this file.
00001 // This may look like C, but it's really -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file     default_server.h
00006  *
00007  *  $Id: default_server.h,v 1.1.1.4 2003/02/21 18:36:45 chad Exp $
00008  *
00009  *  @author  Chris Cleeland
00010  */
00011 //=============================================================================
00012 
00013 
00014 #ifndef TAO_DEFAULT_SERVER_FACTORY_H
00015 #define TAO_DEFAULT_SERVER_FACTORY_H
00016 #include "ace/pre.h"
00017 
00018 #include "tao/Server_Strategy_Factory.h"
00019 
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif /* ACE_LACKS_PRAGMA_ONCE */
00023 
00024 #include "ace/Service_Config.h"
00025 
00026 /**
00027  * @class TAO_Default_Server_Strategy_Factory
00028  *
00029  * @brief This is the default strategy factory for CORBA servers.  It
00030  * allows developers to choose strategies via argument flags.
00031  * This design gives substantial freedom for experimentation.
00032  *
00033  */
00034 class TAO_Export TAO_Default_Server_Strategy_Factory : public TAO_Server_Strategy_Factory
00035 {
00036 public:
00037   // = Initialization and termination methods.
00038   TAO_Default_Server_Strategy_Factory (void);
00039   virtual ~TAO_Default_Server_Strategy_Factory (void);
00040 
00041   // = Service Configurator hooks.
00042   virtual int init (int argc, ACE_TCHAR* argv[]);
00043 
00044   // = The TAO_Server_Strategy_Factory methods, please read the
00045   //   documentation in "tao/Server_Strategy_Factory.h"
00046   virtual int open (TAO_ORB_Core*);
00047   virtual int enable_poa_locking (void);
00048   virtual int activate_server_connections (void);
00049   virtual int thread_per_connection_timeout (ACE_Time_Value &timeout);
00050   virtual int server_connection_thread_flags (void);
00051   virtual int server_connection_thread_count (void);
00052 
00053   /// Parse the arguments, check the documentation in
00054   /// $TAO_ROOT/docs/Options.html for details
00055   int parse_args (int argc, ACE_TCHAR* argv[]);
00056 
00057 protected:
00058   void tokenize (ACE_TCHAR* flag_string);
00059 
00060   void report_option_value_error (const ACE_TCHAR* option_name,
00061                                   const ACE_TCHAR* option_value);
00062 
00063 protected:
00064   /// Should the server connection handlers run in their own thread?
00065   int activate_server_connections_;
00066 
00067   /// Default thread flags passed to thr_create().
00068   u_long thread_flags_;
00069 
00070   enum Lock_Type
00071   {
00072     TAO_NULL_LOCK,
00073     TAO_THREAD_LOCK
00074   };
00075 
00076   /// The type of lock to be returned by <create_poa_lock()>.
00077   Lock_Type poa_lock_type_;
00078 
00079   /// The timeout flag and value for the thread-per-connection model
00080   int thread_per_connection_use_timeout_;
00081   ACE_Time_Value thread_per_connection_timeout_;
00082 };
00083 
00084 #if defined (__ACE_INLINE__)
00085 # include "tao/default_server.i"
00086 #endif /* __ACE_INLINE__ */
00087 
00088 ACE_STATIC_SVC_DECLARE_EXPORT (TAO, TAO_Default_Server_Strategy_Factory)
00089 ACE_FACTORY_DECLARE (TAO, TAO_Default_Server_Strategy_Factory)
00090 
00091 #include "ace/post.h"
00092 #endif /* TAO_DEFAULT_SERVER_FACTORY_H */

Generated on Mon Jun 16 13:48:14 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002