#include <Exclusive_TMS.h>
Inheritance diagram for TAO_Exclusive_TMS:


Public Member Functions | |
| TAO_Exclusive_TMS (TAO_Transport *transport) | |
| Constructor. | |
| virtual | ~TAO_Exclusive_TMS (void) |
| Destructor. | |
The TAO_Transport_Mux_Strategy overrided methods | |
| virtual CORBA::ULong | request_id (void) |
| virtual int | bind_dispatcher (CORBA::ULong request_id, TAO_Reply_Dispatcher *rh) |
| virtual int | unbind_dispatcher (CORBA::ULong request_id) |
| virtual int | dispatch_reply (TAO_Pluggable_Reply_Params ¶ms) |
| virtual bool | idle_after_send (void) |
| virtual bool | idle_after_reply (void) |
| virtual void | connection_closed (void) |
Protected Attributes | |
| CORBA::ULong | request_id_generator_ |
| bool | has_request_ |
| CORBA::ULong | request_id_ |
| Request id for the current request. | |
| TAO_Reply_Dispatcher * | rd_ |
| Reply Dispatcher corresponding to the request. | |
Definition at line 39 of file Exclusive_TMS.h.
|
|
Constructor.
Definition at line 14 of file Exclusive_TMS.cpp.
00015 : TAO_Transport_Mux_Strategy (transport), 00016 request_id_generator_ (0), 00017 has_request_ (false), 00018 request_id_ (0), 00019 rd_ (0) 00020 { 00021 } |
|
|
Destructor.
Definition at line 23 of file Exclusive_TMS.cpp.
00024 {
00025 }
|
|
||||||||||||
|
Bind the dispatcher with the request id. Commonalities in the derived class implementations is kept here. Implements TAO_Transport_Mux_Strategy. Definition at line 58 of file Exclusive_TMS.cpp. References has_request_.
00060 {
00061 this->has_request_ = true;
00062 this->request_id_ = request_id;
00063 this->rd_ = rd;
00064
00065 return 0;
00066 }
|
|
|
The transport object has closed the connection, inform all Reply dispatchers and waiting strategies. Implements TAO_Transport_Mux_Strategy. Definition at line 125 of file Exclusive_TMS.cpp. References TAO_Reply_Dispatcher::connection_closed().
00126 {
00127 if (this->rd_ != 0)
00128 this->rd_->connection_closed ();
00129 }
|
|
|
Dispatch the reply for , cleanup any resources allocated for that request. Implements TAO_Transport_Mux_Strategy. Definition at line 81 of file Exclusive_TMS.cpp. References ACE_DEBUG, ACE_TEXT, TAO_Reply_Dispatcher::dispatch_reply(), has_request_, LM_DEBUG, TAO_Pluggable_Reply_Params_Base::request_id_, and TAO_debug_level.
00082 {
00083 // Check the ids.
00084 if (!this->has_request_ || this->request_id_ != params.request_id_)
00085 {
00086 if (TAO_debug_level > 0)
00087 ACE_DEBUG ((LM_DEBUG,
00088 ACE_TEXT ("(%P|%t) TAO_Exclusive_TMS::dispatch_reply - <%d != %d>\n"),
00089 this->request_id_, params.request_id_));
00090
00091 // The return value 0 informs the transport that the mux strategy
00092 // did not find the right reply handler.
00093 return 0;
00094 }
00095
00096 TAO_Reply_Dispatcher *rd = this->rd_;
00097 this->has_request_ = false;
00098 this->request_id_ = 0; // @@ What is a good value???
00099 this->rd_ = 0;
00100
00101 // Dispatch the reply.
00102 // Returns 1 on success, -1 on failure.
00103 return rd->dispatch_reply (params);
00104 }
|
|
|
Request is sent and the reply is received. Idle the transport now. The return value indicates whether idling was successful or not. Implements TAO_Transport_Mux_Strategy. Definition at line 113 of file Exclusive_TMS.cpp. References TAO_Transport::make_idle().
00114 {
00115 // Irrespective of whether we are successful or not we need to
00116 // return true. If *this* class is not successfull in idling the
00117 // transport no one can.
00118 if (this->transport_ != 0)
00119 (void) this->transport_->make_idle ();
00120
00121 return true;
00122 }
|
|
|
Request has been just sent, but the reply is not received. Idle the transport now. The return value indicates whether idling was successful or not. Implements TAO_Transport_Mux_Strategy. Definition at line 107 of file Exclusive_TMS.cpp.
00108 {
00109 return false;
00110 }
|
|
|
Generate and return an unique request id for the current invocation. Implements TAO_Transport_Mux_Strategy. Definition at line 31 of file Exclusive_TMS.cpp. References ACE_DEBUG, ACE_EVEN, ACE_ODD, ACE_TEXT, TAO_Transport::bidirectional_flag(), LM_DEBUG, request_id_generator_, and TAO_debug_level.
00032 {
00033 ++this->request_id_generator_;
00034
00035 // if TAO_Transport::bidirectional_flag_
00036 // == 1 --> originating side
00037 // == 0 --> other side
00038 // == -1 --> no bi-directional connection was negotiated
00039 // The originating side must have an even request ID, and the other
00040 // side must have an odd request ID. Make sure that is the case.
00041 int const bidir_flag =
00042 this->transport_->bidirectional_flag ();
00043
00044 if ((bidir_flag == 1 && ACE_ODD (this->request_id_generator_))
00045 || (bidir_flag == 0 && ACE_EVEN (this->request_id_generator_)))
00046 ++this->request_id_generator_;
00047
00048 if (TAO_debug_level > 4)
00049 ACE_DEBUG ((LM_DEBUG,
00050 ACE_TEXT ("TAO (%P|%t) - Exclusive_TMS::request_id - <%d>\n"),
00051 this->request_id_generator_));
00052
00053 return this->request_id_generator_;
00054 }
|
|
|
Unbind the dispatcher, the client is no longer waiting for the request, for example, because the request timedout. The strategy can (must) cleanup any resources associated with the request. A later reply for that request should be ignored. Implements TAO_Transport_Mux_Strategy. Definition at line 69 of file Exclusive_TMS.cpp. References has_request_.
00070 {
00071 if (!this->has_request_ || this->request_id_ != request_id)
00072 return -1;
00073 this->has_request_ = false;
00074 this->request_id_ = 0;
00075 this->rd_ = 0;
00076
00077 return 0;
00078 }
|
|
|
If false then the request id and reply dispatcher below are meaningless Definition at line 75 of file Exclusive_TMS.h. Referenced by bind_dispatcher(), dispatch_reply(), and unbind_dispatcher(). |
|
|
Reply Dispatcher corresponding to the request.
Definition at line 81 of file Exclusive_TMS.h. |
|
|
Request id for the current request.
Definition at line 78 of file Exclusive_TMS.h. |
|
|
Used to generate a different request_id on each call to request_id(). Definition at line 71 of file Exclusive_TMS.h. Referenced by request_id(). |
1.3.6