Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef TAO_CSD_FW_CUSTOM_SERVANT_DISPATCHING_STRATEGY_H
00014 #define TAO_CSD_FW_CUSTOM_SERVANT_DISPATCHING_STRATEGY_H
00015
00016 #include "ace/pre.h"
00017
00018 #include "tao/CSD_Framework/CSD_FW_Export.h"
00019
00020 #include "tao/PortableServer/PortableServer.h"
00021 #include "tao/PortableServer/Servant_Upcall.h"
00022 #include "tao/PortableServer/Servant_Base.h"
00023 #include "tao/TAO_Server_Request.h"
00024 #include "tao/LocalObject.h"
00025
00026
00027 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00028 # pragma once
00029 #endif
00030
00031 #include "tao/CSD_Framework/CSD_FrameworkC.h"
00032
00033 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00034
00035 class TAO_Root_POA;
00036 namespace PortableServer
00037 {
00038 class POAManager;
00039 }
00040
00041 namespace TAO
00042 {
00043 namespace CSD
00044 {
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056 class TAO_CSD_FW_Export Strategy_Base
00057 : public CSD_Framework::Strategy,
00058 public ::CORBA::LocalObject
00059 {
00060 public:
00061
00062
00063 enum DispatchResult
00064 {
00065
00066 DISPATCH_HANDLED,
00067
00068
00069 DISPATCH_REJECTED,
00070
00071
00072 DISPATCH_DEFERRED
00073 };
00074
00075
00076 virtual ~Strategy_Base();
00077
00078
00079
00080 CORBA::Boolean apply_to(PortableServer::POA_ptr poa );
00081
00082 protected:
00083
00084 Strategy_Base();
00085
00086
00087 virtual DispatchResult dispatch_remote_request_i
00088 (TAO_ServerRequest& server_request,
00089 const PortableServer::ObjectId& object_id,
00090 PortableServer::POA_ptr poa,
00091 const char* operation,
00092 PortableServer::Servant servant) = 0;
00093
00094
00095 virtual DispatchResult dispatch_collocated_request_i
00096 (TAO_ServerRequest& server_request,
00097 const PortableServer::ObjectId& object_id,
00098 PortableServer::POA_ptr poa,
00099 const char* operation,
00100 PortableServer::Servant servant) = 0;
00101
00102
00103 virtual bool poa_activated_event_i(TAO_ORB_Core& orb_core) = 0;
00104
00105
00106 virtual void poa_deactivated_event_i() = 0;
00107
00108
00109 virtual void servant_activated_event_i
00110 (PortableServer::Servant servant,
00111 const PortableServer::ObjectId& oid);
00112
00113
00114 virtual void servant_deactivated_event_i
00115 (PortableServer::Servant servant,
00116 const PortableServer::ObjectId& oid);
00117
00118 private:
00119
00120
00121
00122
00123
00124 friend class Strategy_Proxy;
00125
00126
00127
00128 void dispatch_request(TAO_ServerRequest& server_request,
00129 ::TAO::Portable_Server::Servant_Upcall& upcall);
00130
00131
00132
00133 bool poa_activated_event(TAO_ORB_Core& orb_core);
00134
00135
00136
00137 void poa_deactivated_event();
00138
00139
00140 void servant_activated_event(PortableServer::Servant servant,
00141 const PortableServer::ObjectId& oid);
00142
00143
00144
00145 void servant_deactivated_event(PortableServer::Servant servant,
00146 const PortableServer::ObjectId& oid);
00147
00148
00149 ::PortableServer::POA_var poa_;
00150
00151
00152
00153 bool poa_activated_;
00154 };
00155 }
00156 }
00157
00158 TAO_END_VERSIONED_NAMESPACE_DECL
00159
00160 #if defined (__ACE_INLINE__)
00161 # include "tao/CSD_Framework/CSD_Strategy_Base.inl"
00162 #endif
00163
00164 #include "ace/post.h"
00165
00166 #endif