Acceptor_Registry.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file     Acceptor_Registry.h
00006  *
00007  *  Acceptor_Registry.h,v 1.38 2006/04/19 08:20:43 jwillemsen Exp
00008  *
00009  *  Interface for the TAO pluggable protocol framework.
00010  *
00011  *  @author Fred Kuhns <fredk@cs.wustl.edu>
00012  *  @author Ossama Othman <ossama@uci.edu>
00013  */
00014 //=============================================================================
00015 
00016 #ifndef TAO_ACCEPTOR_REGISTRY_H
00017 #define TAO_ACCEPTOR_REGISTRY_H
00018 
00019 #include /**/ "ace/pre.h"
00020 #include "ace/Unbounded_Set.h"
00021 
00022 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00023 # pragma once
00024 #endif /* ACE_LACKS_PRAGMA_ONCE */
00025 
00026 #include "tao/TAO_Export.h"
00027 #include "tao/Exception.h"
00028 #include "tao/params.h"
00029 
00030 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00031 class ACE_Addr;
00032 class ACE_Reactor;
00033 ACE_END_VERSIONED_NAMESPACE_DECL
00034 
00035 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00036 
00037 class TAO_ORB_Core;
00038 class TAO_Acceptor;
00039 class TAO_Acceptor_Filter;
00040 class TAO_Stub;
00041 class TAO_Profile;
00042 class TAO_MProfile;
00043 class TAO_Protocol_Factory;
00044 class TAO_Protocol_Item;
00045 
00046 typedef ACE_Unbounded_Set_Iterator<TAO_Protocol_Item *>
00047         TAO_ProtocolFactorySetItor;
00048 
00049 typedef TAO_Acceptor** TAO_AcceptorSetIterator;
00050 
00051 /**
00052  * @class TAO_Acceptor_Registry
00053  *
00054  * @brief Acceptor Registry and Generic Acceptor interface definitions.
00055  * All loaded ESIOP or GIOP acceptor bridges must register with
00056  * this object.
00057  *
00058  * This class maintains a list os acceptor factories
00059  * for all loaded ORB protocols.
00060  * There is one Acceptor_Registry per ORB_Core.
00061  */
00062 class TAO_Export TAO_Acceptor_Registry
00063 {
00064 public:
00065   // = Initialization and termination methods.
00066   ///  Default constructor.
00067   TAO_Acceptor_Registry (void);
00068 
00069   ///  Default destructor.
00070   ~TAO_Acceptor_Registry (void);
00071 
00072   /// Initialize all registered acceptors.  Return -1 on error.
00073   int open (TAO_ORB_Core *orb_core,
00074             ACE_Reactor *reactor,
00075             const TAO_EndpointSet &endpoint_set,
00076             bool ignore_address
00077             ACE_ENV_ARG_DECL);
00078 
00079   /// Close all open acceptors.
00080   int close_all (void);
00081 
00082   /// Returns the total number of endpoints in all of its acceptors.
00083   size_t endpoint_count (void);
00084 
00085   /// Check if there is at least one profile in @a mprofile that
00086   /// corresponds to a collocated object.
00087   int is_collocated (const TAO_MProfile& mprofile);
00088 
00089   /// Return the acceptor bridges
00090   TAO_Acceptor *get_acceptor (CORBA::ULong tag);
00091 
00092   // = Iterator.
00093   TAO_AcceptorSetIterator begin (void);
00094   TAO_AcceptorSetIterator end (void);
00095 
00096 private:
00097 
00098   /// Create a default acceptor for all loaded protocols.
00099   int open_default (TAO_ORB_Core *orb_core,
00100                     ACE_Reactor *reactor,
00101                     const char *options);
00102 
00103   /// Create a default acceptor using the specified protocol factory.
00104   int open_default (TAO_ORB_Core *orb_core,
00105                     ACE_Reactor *reactor,
00106                     int major,
00107                     int minor,
00108                     TAO_ProtocolFactorySetItor &factory,
00109                     const char *options);
00110 
00111   /// Open a default acceptor.
00112   int open_default_i (TAO_ORB_Core *orb_core,
00113                       ACE_Reactor *reactor,
00114                       int major,
00115                       int minor,
00116                       TAO_ProtocolFactorySetItor &factory,
00117                       TAO_Acceptor* acceptor,
00118                       const char *options);
00119 
00120   /// Extract endpoint-specific options from the endpoint string.
00121   void extract_endpoint_options (ACE_CString &addrs,
00122                                  ACE_CString &options,
00123                                  TAO_Protocol_Factory *factory);
00124 
00125   /// Extract endpoint/address specific version from the endpoint
00126   /// string.
00127   void extract_endpoint_version (ACE_CString &address,
00128                                  int &major,
00129                                  int &minor);
00130 
00131   /// Iterator through addrs in the string <iop>, and create an
00132   /// acceptor for each one.
00133   int open_i (TAO_ORB_Core *orb_core,
00134               ACE_Reactor *reactor,
00135               ACE_CString &address,
00136               TAO_ProtocolFactorySetItor &factory,
00137               bool ignore_address
00138               ACE_ENV_ARG_DECL);
00139 
00140 private:
00141 
00142   // The acceptor registry should not be copied.
00143   TAO_Acceptor_Registry (const TAO_Acceptor_Registry&);
00144   void operator= (const TAO_Acceptor_Registry&);
00145 
00146 private:
00147   /// List of acceptors that are currently open.
00148   TAO_Acceptor **acceptors_;
00149 
00150   /// Number of acceptors that are currently open.
00151   size_t size_;
00152 };
00153 
00154 TAO_END_VERSIONED_NAMESPACE_DECL
00155 
00156 #if defined(__ACE_INLINE__)
00157 #include "tao/Acceptor_Registry.i"
00158 #endif /* __ACE_INLINE__ */
00159 
00160 #include /**/ "ace/post.h"
00161 
00162 #endif /* TAO_ACCEPTOR_REGISTRY_H */

Generated on Thu Nov 9 11:54:07 2006 for TAO by doxygen 1.3.6