UIPMC_Acceptor.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file     UIPMC_Acceptor.h
00006  *
00007  *  UIPMC_Acceptor.h,v 1.12 2006/03/14 06:14:34 jtc Exp
00008  *
00009  *  MIOP specific acceptor processing
00010  *
00011  *  @author Frank Hunleth <fhunleth@cs.wustl.edu>
00012  */
00013 //=============================================================================
00014 
00015 #ifndef TAO_UIPMC_ACCEPTOR_H
00016 #define TAO_UIPMC_ACCEPTOR_H
00017 
00018 #include /**/ "ace/pre.h"
00019 
00020 #include "orbsvcs/PortableGroup/UIPMC_Connection_Handler.h"
00021 
00022 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00023 # pragma once
00024 #endif /* ACE_LACKS_PRAGMA_ONCE */
00025 
00026 #include "tao/Transport_Acceptor.h"
00027 #include "tao/Acceptor_Impl.h"
00028 #include "tao/GIOP_Message_State.h"
00029 
00030 #include "ace/Acceptor.h"
00031 #include "ace/SOCK_Acceptor.h"
00032 
00033 #include "orbsvcs/PortableGroup/portablegroup_export.h"
00034 
00035 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00036 
00037 // TAO UIPMC_Acceptor concrete call defination
00038 
00039 /**
00040  * @class TAO_UIPMC_Acceptor
00041  *
00042  * @brief TAO_UIPMC_Acceptor
00043  *
00044  * The UIPMC-specific bridge class for the concrete acceptor.
00045  */
00046 class TAO_PortableGroup_Export TAO_UIPMC_Acceptor : public TAO_Acceptor
00047 {
00048 public:
00049   /// Constructor.
00050   TAO_UIPMC_Acceptor (CORBA::Boolean flag = 0);
00051 
00052   /// Destructor.
00053   ~TAO_UIPMC_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    * The TAO_Acceptor methods, check the documentation in
00064    * Pluggable.h for details.
00065    */
00066   virtual int open (TAO_ORB_Core *orb_core,
00067                     ACE_Reactor *reactor,
00068                     int version_major,
00069                     int version_minor,
00070                     const char *address,
00071                     const char *options = 0);
00072   virtual int open_default (TAO_ORB_Core *orb_core,
00073                             ACE_Reactor *reactor,
00074                             int version_major,
00075                             int version_minor,
00076                             const char *options = 0);
00077   virtual int close (void);
00078   virtual int create_profile (const TAO::ObjectKey &object_key,
00079                               TAO_MProfile &mprofile,
00080                               CORBA::Short priority);
00081   virtual int is_collocated (const TAO_Endpoint *endpoint);
00082   virtual CORBA::ULong endpoint_count (void);
00083 
00084   virtual int object_key (IOP::TaggedProfile &profile,
00085                           TAO::ObjectKey &key);
00086 
00087   /**
00088    * Set the host name for the given addr.
00089    * A hostname may be forced by using specified_hostname.  This
00090    * is useful if the given address corresponds to more than one
00091    * hostname and the desired one cannot be determined in any
00092    * other way.
00093    */
00094   int hostname (TAO_ORB_Core *orb_core,
00095                 ACE_INET_Addr &addr,
00096                 char *&host,
00097                 const char *specified_hostname = 0);
00098 
00099   /**
00100    * Set the host name for the given address using the dotted decimal
00101    * format.
00102    */
00103   int dotted_decimal_address (ACE_INET_Addr &addr,
00104                               char *&host);
00105 
00106 protected:
00107 
00108   /**
00109    * Implement the common part of the open*() methods.  This method is
00110    * virtual to allow a derived class implementation to be invoked
00111    * instead.
00112    */
00113   virtual int open_i (const ACE_INET_Addr &addr,
00114                       ACE_Reactor *reactor);
00115 
00116   /// Parse protocol specific options.
00117   virtual int parse_options (const char *options);
00118 
00119 protected:
00120 
00121   /// Array of ACE_INET_Addr instances, each one corresponding to a
00122   /// given network interface.
00123   ACE_INET_Addr *addrs_;
00124 
00125   /**
00126    * Cache the information about the endpoints serviced by this
00127    * acceptor.
00128    * There may in fact be multiple hostnames for this endpoint. For
00129    * example, if the IP address is INADDR_ANY (0.0.0.0) then there
00130    * will be possibly a different hostname for each interface.
00131    */
00132   char **hosts_;
00133 
00134   /// The number of host names cached in the hosts_ array (equivalent
00135   /// to the number of endpoints opened by this Acceptor).
00136   CORBA::ULong endpoint_count_;
00137 
00138   /**
00139    * The GIOP version for this endpoint
00140    * @@ Theoretically this shouldn't be here!! We need to look at a
00141    * way to move this out
00142    */
00143   TAO_GIOP_Message_Version version_;
00144 
00145   /// ORB Core.
00146   TAO_ORB_Core *orb_core_;
00147 
00148 private:
00149 
00150   TAO_UIPMC_Connection_Handler *connection_handler_;
00151 };
00152 
00153 TAO_END_VERSIONED_NAMESPACE_DECL
00154 
00155 #if defined(__ACE_INLINE__)
00156 #include "orbsvcs/PortableGroup/UIPMC_Acceptor.i"
00157 #endif /* __ACE_INLINE__ */
00158 
00159 #include /**/ "ace/post.h"
00160 #endif  /* TAO_UIPMC_ACCEPTOR_H */

Generated on Thu Nov 9 14:03:34 2006 for TAO_PortableGroup by doxygen 1.3.6