3 //=============================================================================
5 * @file CSD_Strategy_Proxy.h
7 * @author Tim Bradley <bradley_t@ociweb.com>
9 //=============================================================================
11 #ifndef TAO_SERVANT_DISPATCHING_STRATEGY_PROXY_H
12 #define TAO_SERVANT_DISPATCHING_STRATEGY_PROXY_H
14 #include /**/ "ace/pre.h"
16 #include "tao/CSD_Framework/CSD_FW_Export.h"
18 #include "tao/PortableServer/PortableServer.h"
19 #include "tao/PortableServer/Servant_Upcall.h"
21 #if !defined (ACE_LACKS_PRAGMA_ONCE)
23 #endif /* ACE_LACKS_PRAGMA_ONCE */
25 #include "tao/CSD_Framework/CSD_Strategy_Base.h"
28 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
30 class TAO_ServerRequest
;
37 * @class Strategy_Proxy
39 * @brief Proxy class for the Custom Servant Dispatching Strategy.
41 * If no custom servant dispatching strategy is provided to the proxy,
42 * then the "default servant dispatching strategy" logic is used.
44 class TAO_CSD_FW_Export Strategy_Proxy
47 /// Default Constructor.
53 /// Mutator to provide the proxy with a CSD Strategy object.
54 /// A return value of true indicates success, and false indicates
55 /// failure to set the custom strategy on the proxy object.
56 bool custom_strategy(CSD_Framework::Strategy_ptr strategy
);
58 /// Invoked by the Object_Adapter using an ORB thread.
60 /// If the proxy object holds a custom strategy object, then this method
61 /// will simply delegate to the custom strategy object. Otherwise,
62 /// this method will perform the "default servant dispatching strategy"
63 /// logic, preserving the original logic path as it was prior to the
64 /// introduction of the Custom Servant Dispatching feature.
66 /// This method will be inlined (if inlining is turned on during the build).
68 /// The added cost to the original logic path will be this method
69 /// invocation + one conditional (an is_nil() call/comparison for truth on
70 /// the smart pointer to the custom dispatching strategy object).
71 void dispatch_request(TAO_ServerRequest
& server_request
,
72 TAO::Portable_Server::Servant_Upcall
& upcall
);
75 /// Event - The POA has been (or is being) activated.
76 bool poa_activated_event(TAO_ORB_Core
& orb_core
);
78 /// Event - The POA has been deactivated.
79 void poa_deactivated_event();
81 /// Event - A servant has been activated.
82 void servant_activated_event(PortableServer::Servant servant
,
83 const PortableServer::ObjectId
& oid
);
85 /// Event - A servant has been deactivated.
86 void servant_deactivated_event(PortableServer::Servant servant
,
87 const PortableServer::ObjectId
& oid
);
90 /// Smart Pointer to a custom servant dispatching strategy object.
91 /// This smart pointer will be in the "nil" state when the "default"
92 /// strategy is to be applied.
93 CSD_Framework::Strategy_var strategy_
;
94 TAO::CSD::Strategy_Base
*strategy_impl_
;
99 TAO_END_VERSIONED_NAMESPACE_DECL
101 #if defined (__ACE_INLINE__)
102 # include "tao/CSD_Framework/CSD_Strategy_Proxy.inl"
103 #endif /* __ACE_INLINE__ */
105 #include /**/ "ace/post.h"