00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Transport_Acceptor.h 00006 * 00007 * $Id: Transport_Acceptor.h 76593 2007-01-25 19:19:27Z johnnyw $ 00008 * 00009 * Interface for the Acceptor component of the TAO pluggable protocol 00010 * framework. 00011 * 00012 * @author Fred Kuhns <fredk@cs.wustl.edu> 00013 */ 00014 //============================================================================= 00015 00016 #ifndef TAO_ACCEPTOR_H 00017 #define TAO_ACCEPTOR_H 00018 00019 #include /**/ "ace/pre.h" 00020 00021 #include /**/ "tao/TAO_Export.h" 00022 00023 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00024 # pragma once 00025 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00026 00027 #include "tao/Basic_Types.h" 00028 00029 // Forward declarations. 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_MProfile; 00039 class TAO_Endpoint; 00040 class TAO_Transport; 00041 00042 namespace IOP 00043 { 00044 struct TaggedProfile; 00045 } 00046 00047 namespace TAO 00048 { 00049 class ObjectKey; 00050 } 00051 00052 //@@ TAO_ACCEPTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK 00053 00054 // **************************************************************** 00055 00056 /// The TAO-specific OMG assigned value for the TAG_ORB_TYPE tagged 00057 /// component. 00058 /** 00059 * This number was assigned by the OMG. Do *NOT* change. The ASCII 00060 * representation is "TA\x00". If necessary, we can request more ORB 00061 * types later. 00062 */ 00063 const CORBA::ULong TAO_ORB_TYPE = 0x54414f00U; 00064 00065 // **************************************************************** 00066 00067 /** 00068 * @class TAO_Acceptor 00069 * 00070 * @brief Abstract Acceptor class used for pluggable transports. 00071 * 00072 * Base class for the Acceptor bridge class. 00073 * 00074 * @todo Need to rename the class as TAO_Transport_Acceptor. 00075 */ 00076 class TAO_Export TAO_Acceptor 00077 { 00078 public: 00079 TAO_Acceptor (CORBA::ULong tag); 00080 00081 /// Destructor 00082 virtual ~TAO_Acceptor (void); 00083 00084 /// The tag, each concrete class will have a specific tag value. 00085 CORBA::ULong tag (void) const; 00086 00087 /// Method to initialize acceptor for address. 00088 virtual int open (TAO_ORB_Core *orb_core, 00089 ACE_Reactor *reactor, 00090 int version_major, 00091 int version_minor, 00092 const char *address, 00093 const char *options = 0) = 0; 00094 00095 /** 00096 * Open an acceptor with the given protocol version on a default 00097 * endpoint 00098 */ 00099 virtual int open_default (TAO_ORB_Core *, 00100 ACE_Reactor *reactor, 00101 int version_major, 00102 int version_minor, 00103 const char *options = 0) = 0; 00104 00105 /// Closes the acceptor 00106 virtual int close (void) = 0; 00107 00108 /** 00109 * Create the corresponding profile for this endpoint. 00110 * If share_profile is set to true, the pluggable protocol 00111 * implementation should try to add the endpoint to a profile 00112 * in the mprofile that is of the same type. Currently, this 00113 * is used when RT CORBA is enabled. 00114 */ 00115 virtual int create_profile (const TAO::ObjectKey &object_key, 00116 TAO_MProfile &mprofile, 00117 CORBA::Short priority) = 0; 00118 00119 /// Return 1 if the @a endpoint has the same address as the acceptor. 00120 virtual int is_collocated (const TAO_Endpoint *endpoint) = 0; 00121 00122 /** 00123 * Returns the number of endpoints this acceptor is listening on. This 00124 * is used for determining how many profiles will be generated 00125 * for this acceptor. 00126 */ 00127 virtual CORBA::ULong endpoint_count (void) = 0; 00128 00129 /** 00130 * This method fetches the @a key from the @a profile. Protocols that 00131 * are pluggable can send data that are specific in the 00132 * @c profile_data field encapsulated as a octet stream. This method 00133 * allows those protocols to get the object key from the 00134 * encapsulation. 00135 */ 00136 virtual int object_key (IOP::TaggedProfile &profile, 00137 TAO::ObjectKey &key) = 0; 00138 00139 /* 00140 * Hook to add public methods from derived acceptor classes onto 00141 * this class. 00142 */ 00143 //@@ TAO_ACCEPTOR_SPL_PUBLIC_METHODS_ADD_HOOK 00144 00145 private: 00146 /// IOP protocol tag. 00147 CORBA::ULong const tag_; 00148 00149 /* 00150 * Hook to add data members from concrete acceptor implementations onto 00151 * the base class. 00152 */ 00153 //@@ TAO_ACCEPTOR_SPL_DATA_MEMBERS_ADD_HOOK 00154 }; 00155 00156 //@@ TAO_ACCEPTOR_SPL_EXTERN_ADD_HOOK 00157 00158 TAO_END_VERSIONED_NAMESPACE_DECL 00159 00160 #if defined (__ACE_INLINE__) 00161 # include "tao/Transport_Acceptor.inl" 00162 #endif /* __ACE_INLINE__ */ 00163 00164 #include /**/ "ace/post.h" 00165 00166 #endif /* TAO_ACCEPTOR_H */