Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
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
00026
00027 #include "ace/Acceptor.h"
00028 #include "tao/Basic_Types.h"
00029
00030
00031 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00032 class ACE_Addr;
00033 class ACE_Reactor;
00034 ACE_END_VERSIONED_NAMESPACE_DECL
00035
00036 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00037
00038 class TAO_ORB_Core;
00039 class TAO_MProfile;
00040 class TAO_Endpoint;
00041 class TAO_Transport;
00042
00043 namespace IOP
00044 {
00045 struct TaggedProfile;
00046 }
00047
00048 namespace TAO
00049 {
00050 class ObjectKey;
00051 }
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064 const CORBA::ULong TAO_ORB_TYPE = 0x54414f00U;
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077 class TAO_Export TAO_Acceptor
00078 {
00079 public:
00080 TAO_Acceptor (CORBA::ULong tag);
00081
00082
00083 virtual ~TAO_Acceptor (void);
00084
00085
00086 CORBA::ULong tag (void) const;
00087
00088
00089
00090 void set_error_retry_delay (time_t delay);
00091
00092
00093 virtual int open (TAO_ORB_Core *orb_core,
00094 ACE_Reactor *reactor,
00095 int version_major,
00096 int version_minor,
00097 const char *address,
00098 const char *options = 0) = 0;
00099
00100
00101
00102
00103
00104 virtual int open_default (TAO_ORB_Core *,
00105 ACE_Reactor *reactor,
00106 int version_major,
00107 int version_minor,
00108 const char *options = 0) = 0;
00109
00110
00111 virtual int close (void) = 0;
00112
00113
00114
00115
00116
00117
00118
00119
00120 virtual int create_profile (const TAO::ObjectKey &object_key,
00121 TAO_MProfile &mprofile,
00122 CORBA::Short priority) = 0;
00123
00124
00125 virtual int is_collocated (const TAO_Endpoint *endpoint) = 0;
00126
00127
00128
00129
00130
00131
00132 virtual CORBA::ULong endpoint_count (void) = 0;
00133
00134
00135
00136
00137
00138
00139
00140
00141 virtual int object_key (IOP::TaggedProfile &profile,
00142 TAO::ObjectKey &key) = 0;
00143
00144
00145
00146
00147 int handle_accept_error (ACE_Event_Handler* base_acceptor);
00148
00149
00150
00151 int handle_expiration (ACE_Event_Handler* base_acceptor);
00152
00153
00154
00155
00156
00157
00158
00159 private:
00160
00161 CORBA::ULong const tag_;
00162
00163 time_t error_retry_delay_;
00164
00165
00166
00167
00168
00169
00170 };
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182 template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1>
00183 class TAO_Strategy_Acceptor:
00184 public ACE_Strategy_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>
00185 {
00186 public:
00187 TAO_Strategy_Acceptor (TAO_Acceptor* acceptor)
00188 : acceptor_ (acceptor)
00189 {
00190 }
00191
00192 virtual int handle_accept_error (void)
00193 {
00194 return this->acceptor_->handle_accept_error (this);
00195 }
00196
00197 virtual int handle_timeout (const ACE_Time_Value&, const void*)
00198 {
00199 return this->acceptor_->handle_expiration (this);
00200 }
00201
00202 private:
00203 TAO_Acceptor* acceptor_;
00204 };
00205
00206
00207
00208 TAO_END_VERSIONED_NAMESPACE_DECL
00209
00210 #if defined (__ACE_INLINE__)
00211 # include "tao/Transport_Acceptor.inl"
00212 #endif
00213
00214 #include "ace/post.h"
00215
00216 #endif