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

Acceptor_Impl.h

Go to the documentation of this file.
00001 // This may look like C, but it's really -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file   Acceptor_Impl.h
00006  *
00007  *  $Id: Acceptor_Impl.h,v 1.1.1.4 2003/02/21 18:36:44 chad Exp $
00008  *
00009  *  @author Carlos O'Ryan <coryan@cs.wustl.edu>Ossama Othman <othman@cs.wustl.edu>
00010  */
00011 //=============================================================================
00012 
00013 
00014 #ifndef TAO_ACCEPTOR_IMPL_H
00015 #define TAO_ACCEPTOR_IMPL_H
00016 #include "ace/pre.h"
00017 
00018 #include "ace/Acceptor.h"
00019 
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif /* ACE_LACKS_PRAGMA_ONCE */
00023 
00024 #include "tao/corbafwd.h"
00025 
00026 // Forward declarations.
00027 class TAO_ORB_Core;
00028 
00029 /**
00030  * @class TAO_Creation_Strategy
00031  *
00032  * @brief Creates a Svc_Handler and set the ORB_Core pointer on it.
00033  */
00034 template <class SVC_HANDLER>
00035 class TAO_Creation_Strategy : public ACE_Creation_Strategy<SVC_HANDLER>
00036 {
00037 public:
00038   /**
00039    * Constructor. <arg> parameter is used to pass any special
00040    * state/info to the service handler upon creation.  Currently used
00041    * by IIOP and UIOP to pass protocol configuration properties.
00042    */
00043   TAO_Creation_Strategy (TAO_ORB_Core *orb_core,
00044                          void *arg = 0,
00045                          CORBA::Boolean flag = 0);
00046 
00047   /// Create a SVC_HANDLER  and set the ORB_Core pointer on it.
00048   int make_svc_handler (SVC_HANDLER *&sh);
00049 
00050 protected:
00051   /// Pointer to the ORB Core.
00052   TAO_ORB_Core *orb_core_;
00053 
00054   /// Some info/state to be passed to the service handler we create.
00055   void *arg_;
00056 
00057   /// Should we use the Lite version for any protocol?
00058   CORBA::Boolean lite_flag_;
00059 };
00060 
00061 /**
00062  * @class TAO_Concurrency_Strategy
00063  *
00064  * @brief Activates the Svc_Handler, and then if specified by the
00065  * TAO_Server_Strategy_Factory, it activates the Svc_Handler to
00066  * run in its own thread.
00067  */
00068 template <class SVC_HANDLER>
00069 class TAO_Concurrency_Strategy : public ACE_Concurrency_Strategy<SVC_HANDLER>
00070 {
00071 public:
00072   /// Constructor.
00073   TAO_Concurrency_Strategy (TAO_ORB_Core *orb_core);
00074 
00075   /**
00076    * Activates the Svc_Handler, and then if specified by the
00077    * TAO_Server_Strategy_Factory, it activates the Svc_Handler to run
00078    * in its own thread.
00079    */
00080   int activate_svc_handler (SVC_HANDLER *svc_handler,
00081                             void *arg);
00082 
00083 protected:
00084   /// Pointer to the ORB Core.
00085   TAO_ORB_Core *orb_core_;
00086 };
00087 
00088 template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1>
00089 class TAO_Accept_Strategy : public ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>
00090 {
00091 public:
00092 
00093   /// Constructor.
00094   TAO_Accept_Strategy (TAO_ORB_Core *orb_core);
00095 
00096   /// Initialize the <peer_acceptor_> with <local_addr>.  If the
00097   /// process runs out of handles, purge some "old" connections.
00098   int open (const ACE_PEER_ACCEPTOR_ADDR &local_addr,
00099             int restart = 0);
00100 
00101   /// Delegates to the <accept> method of the PEER_ACCEPTOR. If the
00102   /// process runs out of handles, purge some "old" connections.
00103   int accept_svc_handler (SVC_HANDLER *svc_handler);
00104 
00105 protected:
00106   /// Base class.
00107   typedef ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2> ACCEPT_STRATEGY_BASE;
00108 
00109   /// Pointer to the ORB Core.
00110   TAO_ORB_Core *orb_core_;
00111 };
00112 
00113 #if defined(__ACE_INLINE__)
00114 #include "tao/Acceptor_Impl.i"
00115 #endif /* __ACE_INLINE__ */
00116 
00117 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
00118 #include "tao/Acceptor_Impl.cpp"
00119 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
00120 
00121 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
00122 #pragma implementation ("Acceptor_Impl.cpp")
00123 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
00124 
00125 #include "ace/post.h"
00126 #endif /* TAO_ACCEPTOR_IMPL_H */

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