SHMIOP_Acceptor.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 // SHMIOP_Acceptor.h,v 1.20 2006/06/01 13:16:13 jwillemsen Exp
00003 
00004 // SHMIOP_Acceptor.h,v 1.20 2006/06/01 13:16:13 jwillemsen Exp
00005 // ===================================================================
00006 /**
00007  *  @file   SHMIOP_Acceptor.h
00008  *
00009  *  @brief  SHMIOP specific acceptor processing
00010  *
00011  *  @author Nanbor Wang <nanbor@cs.wustl.edu>
00012  */
00013 // ===================================================================
00014 
00015 #ifndef TAO_SHMIOP_ACCEPTOR_H
00016 #define TAO_SHMIOP_ACCEPTOR_H
00017 
00018 #include /**/ "ace/pre.h"
00019 
00020 #include "tao/orbconf.h"
00021 
00022 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00023 # pragma once
00024 #endif /* ACE_LACKS_PRAGMA_ONCE */
00025 
00026 #if defined (TAO_HAS_SHMIOP) && (TAO_HAS_SHMIOP != 0)
00027 
00028 #include "tao/Transport_Acceptor.h"
00029 #include "tao/Strategies/SHMIOP_Connection_Handler.h"
00030 #include "tao/Acceptor_Impl.h"
00031 #include "ace/Acceptor.h"
00032 #include "ace/MEM_Acceptor.h"
00033 #include "tao/GIOP_Message_Version.h"
00034 // TAO SHMIOP_Acceptor concrete call definitions
00035 
00036 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00037 
00038 /**
00039  * @class TAO_SHMIOP_Acceptor
00040  *
00041  * @brief The SHMIOP-specific bridge class for the concrete acceptor.
00042  *
00043  */
00044 class TAO_Strategies_Export TAO_SHMIOP_Acceptor : public TAO_Acceptor
00045 {
00046 public:
00047   /// Constructor.
00048   TAO_SHMIOP_Acceptor (CORBA::Boolean flag = false);
00049 
00050   /// Destructor.
00051   ~TAO_SHMIOP_Acceptor (void);
00052 
00053   typedef ACE_Strategy_Acceptor<TAO_SHMIOP_Connection_Handler, ACE_MEM_ACCEPTOR> TAO_SHMIOP_BASE_ACCEPTOR;
00054   typedef TAO_Creation_Strategy<TAO_SHMIOP_Connection_Handler> TAO_SHMIOP_CREATION_STRATEGY;
00055   typedef TAO_Concurrency_Strategy<TAO_SHMIOP_Connection_Handler> TAO_SHMIOP_CONCURRENCY_STRATEGY;
00056   typedef TAO_Accept_Strategy<TAO_SHMIOP_Connection_Handler, ACE_MEM_ACCEPTOR> TAO_SHMIOP_ACCEPT_STRATEGY;
00057 
00058   /**
00059    * @name The TAO_Acceptor Methods
00060    *
00061    * Please check the documentation in Transport_Acceptor.h for details.
00062    */
00063   //@{
00064   virtual int open (TAO_ORB_Core *orb_core,
00065                     ACE_Reactor *reactor,
00066                     int version_major,
00067                     int version_minor,
00068                     const char *port,
00069                     const char *options = 0);
00070   virtual int open_default (TAO_ORB_Core *orb_core,
00071                             ACE_Reactor *reactor,
00072                             int version_major,
00073                             int version_minor,
00074                             const char *options = 0);
00075   virtual int close (void);
00076   virtual int create_profile (const TAO::ObjectKey &object_key,
00077                               TAO_MProfile &mprofile,
00078                               CORBA::Short priority);
00079 
00080   virtual int is_collocated (const TAO_Endpoint* endpoint);
00081   virtual CORBA::ULong endpoint_count (void);
00082 
00083   virtual int object_key (IOP::TaggedProfile &profile,
00084                           TAO::ObjectKey &key);
00085   //@}
00086 
00087   /// Set the MMAP options the MEM_Stream this acceptor creates will
00088   /// use.
00089   int set_mmap_options (const ACE_TCHAR *prefix,
00090                         off_t size);
00091 
00092 private:
00093   /// Implement the common part of the open*() methods.
00094   int open_i (TAO_ORB_Core* orb_core,
00095               ACE_Reactor *reactor);
00096 
00097   /// Parse protocol specific options.
00098   virtual int parse_options (const char *options);
00099 
00100   /// Create a SHMIOP profile representing this acceptor.
00101   int create_new_profile (const TAO::ObjectKey &object_key,
00102                           TAO_MProfile &mprofile,
00103                           CORBA::Short priority);
00104 
00105   /// Add the endpoints on this acceptor to a shared profile.
00106   int create_shared_profile (const TAO::ObjectKey &object_key,
00107                              TAO_MProfile &mprofile,
00108                              CORBA::Short priority);
00109 
00110 protected:
00111   /// Cache the information about the endpoint serviced by this
00112   /// acceptor.
00113   /// @todo There may in fact be multiple hostnames for this endpoint.
00114   ///    For example it the IP address is INADDR_ANY
00115   ///    (0.0.0.0) then there will be possibly a different hostname for
00116   ///    each interface.
00117   ACE_CString host_;
00118 
00119   /// A local endpoint.
00120   ACE_MEM_Addr address_;
00121 
00122   /// The GIOP version for this endpoint
00123   TAO_GIOP_Message_Version version_;
00124 
00125   /// ORB Core.
00126   TAO_ORB_Core *orb_core_;
00127 
00128 private:
00129   /// The concrete acceptor, as a pointer to it's base class.
00130   TAO_SHMIOP_BASE_ACCEPTOR base_acceptor_;
00131 
00132   /// Acceptor strategies.
00133   TAO_SHMIOP_CREATION_STRATEGY *creation_strategy_;
00134   TAO_SHMIOP_CONCURRENCY_STRATEGY *concurrency_strategy_;
00135   TAO_SHMIOP_ACCEPT_STRATEGY *accept_strategy_;
00136 
00137   /// Determine the prefix (include path name) of the mmap file.
00138   const ACE_TCHAR *mmap_file_prefix_;
00139 
00140   /// Determine the minimum size of mmap file.  This dictate the
00141   /// maximum size of a CORBA method invocation.
00142   off_t mmap_size_;
00143 
00144   /// Should we use GIOP lite??
00145   CORBA::Boolean lite_flag_;
00146 };
00147 
00148 TAO_END_VERSIONED_NAMESPACE_DECL
00149 
00150 #endif /* TAO_HAS_SHMIOP && TAO_HAS_SHMIOP != 0 */
00151 
00152 #include /**/ "ace/post.h"
00153 
00154 #endif  /* TAO_SHMIOP_ACCEPTOR_H */

Generated on Thu Nov 9 13:39:30 2006 for TAO_Strategies by doxygen 1.3.6