Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Acceptor_Registry.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file     Acceptor_Registry.h
00006  *
00007  *  $Id: Acceptor_Registry.h,v 1.1.1.4 2003/02/21 18:36:44 chad 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 
00017 #ifndef TAO_ACCEPTOR_REGISTRY_H
00018 #define TAO_ACCEPTOR_REGISTRY_H
00019 
00020 #include "ace/pre.h"
00021 
00022 #include "tao/corbafwd.h"
00023 
00024 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00025 # pragma once
00026 #endif /* ACE_LACKS_PRAGMA_ONCE */
00027 
00028 #include "tao/Resource_Factory.h"
00029 #include "tao/Exception.h"
00030 
00031 #include "ace/SString.h"
00032 
00033 // Forward declarations.
00034 class ACE_Addr;
00035 class ACE_Reactor;
00036 
00037 class TAO_ORB_Core;
00038 class TAO_Acceptor;
00039 class TAO_Acceptor_Filter;
00040 
00041 class TAO_Stub;
00042 class TAO_Profile;
00043 class TAO_MProfile;
00044 
00045 typedef TAO_Acceptor** TAO_AcceptorSetIterator;
00046 
00047 /**
00048  * @class TAO_Acceptor_Registry
00049  *
00050  * @brief Acceptor Registry and Generic Acceptor interface definitions.
00051  * All loaded ESIOP or GIOP acceptor bridges must register with
00052  * this object.
00053  *
00054  * This class maintains a list os acceptor factories
00055  * for all loaded ORB protocols.
00056  * There is one Acceptor_Registry per ORB_Core.
00057  */
00058 class TAO_Export TAO_Acceptor_Registry
00059 {
00060 public:
00061   // = Initialization and termination methods.
00062   ///  Default constructor.
00063   TAO_Acceptor_Registry (void);
00064 
00065   ///  Default destructor.
00066   ~TAO_Acceptor_Registry (void);
00067 
00068   /// Initialize all registered acceptors.  Return -1 on error.
00069   int open (TAO_ORB_Core *orb_core,
00070             ACE_Reactor *reactor,
00071             int ignore_address
00072             ACE_ENV_ARG_DECL)
00073     ACE_THROW_SPEC ((CORBA::SystemException));
00074 
00075   /// Close all open acceptors.
00076   int close_all (void);
00077 
00078   /// Returns the total number of endpoints in all of its acceptors.
00079   size_t endpoint_count (void);
00080 
00081   /// Check if there is at least one profile in <mprofile> that
00082   /// corresponds to a collocated object.
00083   int is_collocated (const TAO_MProfile& mprofile);
00084 
00085   /// Return the acceptor bridges
00086   TAO_Acceptor *get_acceptor (CORBA::ULong tag);
00087 
00088   // = Iterator.
00089   TAO_AcceptorSetIterator begin (void);
00090   TAO_AcceptorSetIterator end (void);
00091 
00092 private:
00093 
00094   /// Create a default acceptor for all loaded protocols.
00095   int open_default (TAO_ORB_Core *orb_core,
00096                     ACE_Reactor *reactor,
00097                     const char *options);
00098 
00099   /// Create a default acceptor using the specified protocol factory.
00100   int open_default (TAO_ORB_Core *orb_core,
00101                     ACE_Reactor *reactor,
00102                     int major,
00103                     int minor,
00104                     TAO_ProtocolFactorySetItor &factory,
00105                     const char *options);
00106 
00107   /// Extract endpoint-specific options from the endpoint string.
00108   void extract_endpoint_options (ACE_CString &addrs,
00109                                  ACE_CString &options,
00110                                  TAO_Protocol_Factory *factory);
00111 
00112   /// Extract endpoint/address specific version from the endpoint
00113   /// string.
00114   void extract_endpoint_version (ACE_CString &address,
00115                                  int &major,
00116                                  int &minor);
00117 
00118   /// Iterator through addrs in the string <iop>, and create an
00119   /// acceptor for each one.
00120   int open_i (TAO_ORB_Core *orb_core,
00121               ACE_Reactor *reactor,
00122               ACE_CString &address,
00123               TAO_ProtocolFactorySetItor &factory,
00124               int ignore_address
00125               ACE_ENV_ARG_DECL);
00126 
00127 private:
00128   // The acceptor registry should not be copied.
00129   ACE_UNIMPLEMENTED_FUNC (TAO_Acceptor_Registry (const TAO_Acceptor_Registry&))
00130   ACE_UNIMPLEMENTED_FUNC (void operator= (const TAO_Acceptor_Registry&))
00131 
00132 private:
00133   /// List of acceptors that are currently open.
00134   TAO_Acceptor **acceptors_;
00135 
00136   /// Number of acceptors that are currently open.
00137   size_t size_;
00138 };
00139 
00140 #if defined(__ACE_INLINE__)
00141 #include "tao/Acceptor_Registry.i"
00142 #endif /* __ACE_INLINE__ */
00143 
00144 #include "ace/post.h"
00145 
00146 #endif /* TAO_ACCEPTOR_REGISTRY_H */

Generated on Mon Jun 16 13:47:57 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002