Go to the documentation of this file.00001
00002
00003
00004
00005 #include "tao/debug.h"
00006
00007 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00008
00009 ACE_INLINE
00010 TAO::CSD::Strategy_Base::Strategy_Base()
00011 : poa_activated_(false)
00012 {
00013 }
00014
00015 ACE_INLINE
00016 void
00017 TAO::CSD::Strategy_Base::dispatch_request
00018 (TAO_ServerRequest& server_request,
00019 TAO::Portable_Server::Servant_Upcall& upcall)
00020 {
00021 DispatchResult result;
00022
00023 if (server_request.collocated())
00024 {
00025 result = this->dispatch_collocated_request_i(server_request,
00026 upcall.user_id(),
00027 this->poa_.in(),
00028 server_request.operation(),
00029 upcall.servant());
00030 }
00031 else
00032 {
00033 result = this->dispatch_remote_request_i(server_request,
00034 upcall.user_id(),
00035 this->poa_.in(),
00036 server_request.operation(),
00037 upcall.servant());
00038 }
00039
00040 switch (result)
00041 {
00042 case DISPATCH_HANDLED:
00043
00044 break;
00045
00046 case DISPATCH_REJECTED:
00047 if (server_request.collocated ())
00048 {
00049 CORBA::NO_IMPLEMENT ex;
00050 ex._raise ();
00051 }
00052 else
00053 {
00054
00055
00056 if (!server_request.sync_with_server() &&
00057 server_request.response_expected() &&
00058 !server_request.deferred_reply())
00059 {
00060 CORBA::NO_IMPLEMENT ex;
00061 server_request.tao_send_reply_exception(ex);
00062 }
00063 }
00064 break;
00065
00066 case DISPATCH_DEFERRED:
00067
00068
00069 upcall.servant()->_dispatch(server_request, (void*)&upcall);
00070 break;
00071
00072 default:
00073 if (TAO_debug_level > 0)
00074 ACE_ERROR((LM_ERROR,
00075 ACE_TEXT("(%P|%t) Unknown result (%d) from call to ")
00076 ACE_TEXT("dispatch_remote_request_i().\n"), result));
00077
00078
00079
00080 break;
00081 }
00082 }
00083
00084
00085 ACE_INLINE
00086 bool
00087 TAO::CSD::Strategy_Base::poa_activated_event(TAO_ORB_Core& orb_core)
00088 {
00089
00090 this->poa_activated_ = this->poa_activated_event_i(orb_core);
00091
00092
00093 return this->poa_activated_;
00094 }
00095
00096 ACE_INLINE
00097 void
00098 TAO::CSD::Strategy_Base::poa_deactivated_event()
00099 {
00100 if (this->poa_activated_)
00101 {
00102 this->poa_activated_ = false;
00103
00104
00105 this->poa_deactivated_event_i();
00106
00107
00108
00109
00110 this->poa_ = 0;
00111 }
00112 }
00113
00114 ACE_INLINE
00115 void
00116 TAO::CSD::Strategy_Base::servant_activated_event
00117 (PortableServer::Servant servant,
00118 const PortableServer::ObjectId& oid)
00119 {
00120 this->servant_activated_event_i(servant, oid);
00121 }
00122
00123 ACE_INLINE
00124 void
00125 TAO::CSD::Strategy_Base::servant_deactivated_event
00126 (PortableServer::Servant servant,
00127 const PortableServer::ObjectId& oid)
00128 {
00129 this->servant_deactivated_event_i(servant, oid);
00130 }
00131
00132 TAO_END_VERSIONED_NAMESPACE_DECL