DIOP_Acceptor.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    DIOP_Acceptor.h
00006  *
00007  *  DIOP_Acceptor.h,v 1.14 2006/06/01 13:13:11 jwillemsen Exp
00008  *
00009  *  DIOP specific acceptor processing
00010  *
00011  *  @author  Michael Kircher
00012  */
00013 //=============================================================================
00014 
00015 
00016 #ifndef TAO_DIOP_ACCEPTOR_H
00017 #define TAO_DIOP_ACCEPTOR_H
00018 
00019 #include /**/ "ace/pre.h"
00020 
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 defined (TAO_HAS_DIOP) && (TAO_HAS_DIOP != 0)
00028 
00029 #include "tao/Transport_Acceptor.h"
00030 #include "tao/Strategies/DIOP_Connection_Handler.h"
00031 #include "tao/Acceptor_Impl.h"
00032 
00033 #include "tao/GIOP_Message_Version.h"
00034 
00035 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00036 
00037 // TAO DIOP_Acceptor concrete call defination
00038 
00039 /**
00040  * @class TAO_DIOP_Acceptor
00041  *
00042  * @brief TAO_DIOP_Acceptor
00043  *
00044  * The DIOP-specific bridge class for the concrete acceptor.
00045  */
00046 class TAO_Strategies_Export TAO_DIOP_Acceptor : public TAO_Acceptor
00047 {
00048 public:
00049   /// Constructor.
00050   TAO_DIOP_Acceptor (CORBA::Boolean flag = false);
00051 
00052   /// Destructor.
00053   ~TAO_DIOP_Acceptor (void);
00054 
00055   /// @@ Helper method for the implementation repository, should go
00056   ///    away
00057   const ACE_INET_Addr& address (void) const;
00058 
00059   /// Returns the array of endpoints in this acceptor
00060   const ACE_INET_Addr *endpoints (void);
00061 
00062   /**
00063    * @name The TAO_Acceptor Methods
00064    *
00065    * Please check the documentation in Transport_Acceptor.h for details.
00066    */
00067   //@{
00068   virtual int open (TAO_ORB_Core *orb_core,
00069                     ACE_Reactor *reactor,
00070                     int version_major,
00071                     int version_minor,
00072                     const char *address,
00073                     const char *options = 0);
00074   virtual int open_default (TAO_ORB_Core *orb_core,
00075                             ACE_Reactor *reactor,
00076                             int version_major,
00077                             int version_minor,
00078                             const char *options = 0);
00079   virtual int close (void);
00080   virtual int create_profile (const TAO::ObjectKey &object_key,
00081                               TAO_MProfile &mprofile,
00082                               CORBA::Short priority);
00083 
00084   virtual int is_collocated (const TAO_Endpoint *endpoint);
00085   virtual CORBA::ULong endpoint_count (void);
00086 
00087   virtual int object_key (IOP::TaggedProfile &profile,
00088                           TAO::ObjectKey &key);
00089   //@}
00090 
00091   /**
00092    * Set the host name for the given addr.
00093    * A hostname may be forced by using specified_hostname.  This
00094    * is useful if the given address corresponds to more than one
00095    * hostname and the desired one cannot be determined in any
00096    * other way.
00097    */
00098   int hostname (TAO_ORB_Core *orb_core,
00099                 ACE_INET_Addr &addr,
00100                 char *&host,
00101                 const char *specified_hostname = 0);
00102 
00103   /**
00104    * Set the host name for the given address using the dotted decimal
00105    * format.
00106    */
00107   int dotted_decimal_address (ACE_INET_Addr &addr,
00108                               char *&host);
00109 
00110 protected:
00111 
00112   /**
00113    * Implement the common part of the open*() methods.  This method is
00114    * virtual to allow a derived class implementation to be invoked
00115    * instead.
00116    */
00117   virtual int open_i (const ACE_INET_Addr &addr,
00118                       ACE_Reactor *reactor);
00119 
00120   /**
00121    * Probe the system for available network interfaces, and initialize
00122    * the <addrs_> array with an ACE_INET_Addr for each network
00123    * interface.  The port for each initialized ACE_INET_Addr will be
00124    * set in the open_i() method.  This method only gets invoked when
00125    * no explicit hostname is provided in the specified endpoint.
00126    */
00127   int probe_interfaces (TAO_ORB_Core *orb_core);
00128 
00129   /// Parse protocol specific options.
00130   virtual int parse_options (const char *options);
00131 
00132   /// Helper method to add a new profile to the mprofile for
00133   /// each endpoint.
00134   int create_new_profile (const TAO::ObjectKey &object_key,
00135                           TAO_MProfile &mprofile,
00136                           CORBA::Short priority);
00137 
00138   /// Helper method to create a profile that contains all of
00139   /// our endpoints.
00140   int create_shared_profile (const TAO::ObjectKey &object_key,
00141                              TAO_MProfile &mprofile,
00142                              CORBA::Short priority);
00143 protected:
00144 
00145   /// Array of ACE_INET_Addr instances, each one corresponding to a
00146   /// given network interface.
00147   ACE_INET_Addr *addrs_;
00148 
00149   /**
00150    * Cache the information about the endpoints serviced by this
00151    * acceptor.
00152    * There may in fact be multiple hostnames for this endpoint. For
00153    * example, if the IP address is INADDR_ANY (0.0.0.0) then there
00154    * will be possibly a different hostname for each interface.
00155    */
00156   char **hosts_;
00157 
00158   /// The number of host names cached in the hosts_ array (equivalent
00159   /// to the number of endpoints opened by this Acceptor).
00160   CORBA::ULong endpoint_count_;
00161 
00162   /**
00163    * The GIOP version for this endpoint
00164    * @@ Theoretically they shouldn't be here!! We need to look at a
00165    * way to move this out
00166    */
00167   TAO_GIOP_Message_Version version_;
00168 
00169   /// ORB Core.
00170   TAO_ORB_Core *orb_core_;
00171 
00172   /// Should we use GIOP lite??
00173   CORBA::Boolean lite_flag_;
00174 
00175 private:
00176   // @@ Frank: From DIOP_Acceptor.h
00177   TAO_DIOP_Connection_Handler *connection_handler_;
00178 
00179 };
00180 
00181 TAO_END_VERSIONED_NAMESPACE_DECL
00182 
00183 #if defined(__ACE_INLINE__)
00184 #include "tao/Strategies/DIOP_Acceptor.i"
00185 #endif /* __ACE_INLINE__ */
00186 
00187 #endif /* TAO_HAS_DIOP && TAO_HAS_DIOP != 0 */
00188 
00189 #include /**/ "ace/post.h"
00190 
00191 #endif  /* TAO_DIOP_ACCEPTOR_H */

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