UIOP_Acceptor.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    UIOP_Acceptor.h
00006  *
00007  *  UIOP_Acceptor.h,v 1.17 2006/06/01 13:15:05 jwillemsen Exp
00008  *
00009  *  Unix Domain Socket (UIOP) specific acceptor processing
00010  *
00011  *  @author Fred Kuhns <fredk@cs.wustl.edu>
00012  *  @author Ossama Othman <ossama@dre.vanderbilt.edu>
00013  */
00014 //=============================================================================
00015 
00016 
00017 #ifndef TAO_UIOP_ACCEPTOR_H
00018 #define TAO_UIOP_ACCEPTOR_H
00019 
00020 #include /**/ "ace/pre.h"
00021 #include "tao/orbconf.h"
00022 
00023 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00024 # pragma once
00025 #endif /* ACE_LACKS_PRAGMA_ONCE */
00026 
00027 # if TAO_HAS_UIOP == 1
00028 #include "tao/Strategies/UIOP_Connection_Handler.h"
00029 
00030 #include "tao/Transport_Acceptor.h"
00031 #include "tao/Acceptor_Impl.h"
00032 #include "tao/GIOP_Message_Version.h"
00033 
00034 #include "ace/Acceptor.h"
00035 #include "ace/LSOCK_Acceptor.h"
00036 
00037 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00038 
00039 /**
00040  * @class TAO_UIOP_Acceptor
00041  *
00042  * @brief The UIOP-specific bridge class for the concrete acceptor.
00043  */
00044 class TAO_Strategies_Export TAO_UIOP_Acceptor : public TAO_Acceptor
00045 {
00046 public:
00047   // TAO_UIOP_Acceptor (ACE_UNIX_Addr &addr);
00048   // Create Acceptor object using addr.
00049 
00050   /// Create Acceptor object using addr.
00051   TAO_UIOP_Acceptor (CORBA::Boolean flag = false);
00052 
00053   /// Destructor
00054   virtual ~TAO_UIOP_Acceptor (void);
00055 
00056   typedef ACE_Strategy_Acceptor<TAO_UIOP_Connection_Handler, ACE_LSOCK_ACCEPTOR> TAO_UIOP_BASE_ACCEPTOR;
00057   typedef TAO_Creation_Strategy<TAO_UIOP_Connection_Handler> TAO_UIOP_CREATION_STRATEGY;
00058   typedef TAO_Concurrency_Strategy<TAO_UIOP_Connection_Handler> TAO_UIOP_CONCURRENCY_STRATEGY;
00059   typedef TAO_Accept_Strategy<TAO_UIOP_Connection_Handler, ACE_LSOCK_ACCEPTOR> TAO_UIOP_ACCEPT_STRATEGY;
00060 
00061   /**
00062    * @name The TAO_Acceptor Methods
00063    *
00064    * Please check the documentation in Transport_Acceptor.h for details.
00065    */
00066   //@{
00067   virtual int open (TAO_ORB_Core *orb_core,
00068                     ACE_Reactor *reactor,
00069                     int version_major,
00070                     int version_minor,
00071                     const char *address,
00072                     const char *options = 0);
00073   virtual int open_default (TAO_ORB_Core *orb_core,
00074                             ACE_Reactor *reactor,
00075                             int version_major,
00076                             int version_minor,
00077                             const char *options = 0);
00078   virtual int close (void);
00079   virtual int create_profile (const TAO::ObjectKey &object_key,
00080                               TAO_MProfile &mprofile,
00081                               CORBA::Short priority);
00082 
00083   virtual int is_collocated (const TAO_Endpoint* endpoint);
00084   virtual CORBA::ULong endpoint_count (void);
00085 
00086   virtual int object_key (IOP::TaggedProfile &profile,
00087                           TAO::ObjectKey &key);
00088   //@}
00089 
00090 private:
00091   /// Implement the common part of the open*() methods
00092   int open_i (const char *rendezvous,
00093               ACE_Reactor *reactor);
00094 
00095   /// Set the rendezvous point and verify that it is
00096   /// valid (e.g. wasn't truncated because it was too long).
00097   void rendezvous_point (ACE_UNIX_Addr &, const char *rendezvous);
00098 
00099   /// Parse protocol specific options.
00100   int parse_options (const char *options);
00101 
00102   /// Obtains uiop properties that must be used by this acceptor, i.e.,
00103   /// initializes <uiop_properties_>.
00104   int init_uiop_properties (void);
00105 
00106   /// Create a UIOP profile representing this acceptor.
00107   int create_new_profile (const TAO::ObjectKey &object_key,
00108                           TAO_MProfile &mprofile,
00109                           CORBA::Short priority);
00110 
00111   /// Add the endpoints on this acceptor to a shared profile.
00112   int create_shared_profile (const TAO::ObjectKey &object_key,
00113                              TAO_MProfile &mprofile,
00114                              CORBA::Short priority);
00115 
00116 private:
00117   /// The concrete acceptor, as a pointer to its base class.
00118   TAO_UIOP_BASE_ACCEPTOR base_acceptor_;
00119 
00120   // Acceptor strategies.
00121   TAO_UIOP_CREATION_STRATEGY *creation_strategy_;
00122   TAO_UIOP_CONCURRENCY_STRATEGY *concurrency_strategy_;
00123   TAO_UIOP_ACCEPT_STRATEGY *accept_strategy_;
00124 
00125   /// The GIOP version for this endpoint
00126   TAO_GIOP_Message_Version version_;
00127 
00128   /// ORB Core.
00129   TAO_ORB_Core *orb_core_;
00130 
00131   /// Flag that determines whether or not the rendezvous point should
00132   /// be unlinked on close.  This is really only used when an error
00133   /// occurs.
00134   bool unlink_on_close_;
00135 
00136   /// Should we use GIOP lite??
00137   const bool lite_flag_;
00138 };
00139 
00140 TAO_END_VERSIONED_NAMESPACE_DECL
00141 
00142 # endif /* TAO_HAS_UIOP == 1 */
00143 
00144 #include /**/ "ace/post.h"
00145 
00146 #endif  /* TAO_UIOP_ACCEPTOR_H */

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