3 //=============================================================================
5 * @file ServantRetentionStrategyRetain.h
7 * @author Johnny Willemsen <jwillemsen@remedy.nl>
9 //=============================================================================
11 #ifndef TAO_SERVANT_RETENTION_STRATEGY_RETAIN_H
12 #define TAO_SERVANT_RETENTION_STRATEGY_RETAIN_H
13 #include /**/ "ace/pre.h"
15 #include "tao/PortableServer/ServantRetentionStrategyNonRetain.h"
17 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 #endif /* ACE_LACKS_PRAGMA_ONCE */
21 #include "tao/PortableServer/Active_Object_Map.h"
24 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
30 namespace Portable_Server
32 class ServantRetentionStrategyRetain
33 : public ServantRetentionStrategyNonRetain
36 ServantRetentionStrategyRetain () = default;
38 CORBA::ULong
waiting_servant_deactivation () const override
;
40 void strategy_init (TAO_Root_POA
*poa
) override
;
42 void strategy_cleanup() override
;
44 int is_servant_in_map (PortableServer::Servant servant
,
45 bool &wait_occurred_restart_call
) override
;
47 PortableServer::ObjectId
*
48 activate_object (PortableServer::Servant servant
,
49 CORBA::Short priority
,
50 bool &wait_occurred_restart_call
) override
;
53 activate_object_with_id (const PortableServer::ObjectId
&id
,
54 PortableServer::Servant servant
,
55 CORBA::Short priority
,
56 bool &wait_occurred_restart_call
) override
;
58 void deactivate_object (const PortableServer::ObjectId
&id
) override
;
60 PortableServer::Servant
find_servant (const PortableServer::ObjectId
&system_id
) override
;
62 PortableServer::ObjectId
* system_id_to_object_id (const PortableServer::ObjectId
&system_id
) override
;
64 PortableServer::Servant
user_id_to_servant (const PortableServer::ObjectId
&id
) override
;
66 CORBA::Object_ptr
id_to_reference (const PortableServer::ObjectId
&id
,
67 bool indirect
) override
;
70 servant_present (const PortableServer::ObjectId
&system_id
,
71 PortableServer::Servant
&servant
) override
;
73 PortableServer::Servant
find_servant (
74 const PortableServer::ObjectId
&system_id
,
75 TAO::Portable_Server::Servant_Upcall
&servant_upcall
,
76 TAO::Portable_Server::POA_Current_Impl
&poa_current_impl
) override
;
78 int find_servant_priority (
79 const PortableServer::ObjectId
&system_id
,
80 CORBA::Short
&priority
) override
;
82 void deactivate_all_objects () override
;
84 PortableServer::ObjectId
*servant_to_user_id (PortableServer::Servant servant
) override
;
86 CORBA::Object_ptr
servant_to_reference (PortableServer::Servant servant
) override
;
88 CORBA::Object_ptr
create_reference (const char *intf
, CORBA::Short priority
) override
;
90 #if !defined (CORBA_E_MICRO)
91 CORBA::Object_ptr
create_reference_with_id (
92 const PortableServer::ObjectId
&oid
,
94 CORBA::Short priority
) override
;
99 is_user_id_in_map (const PortableServer::ObjectId
&id
,
100 CORBA::Short priority
,
101 bool &priorities_match
,
102 bool &wait_occurred_restart_call
);
105 deactivate_map_entry (TAO_Active_Object_Map_Entry
*active_object_map_entry
);
107 PortableServer::ObjectId
*servant_to_system_id_i (
108 PortableServer::Servant p_servant
,
109 CORBA::Short
&priority
);
111 int rebind_using_user_id_and_system_id (
112 PortableServer::Servant servant
,
113 const PortableServer::ObjectId
&user_id
,
114 const PortableServer::ObjectId
&system_id
,
115 TAO::Portable_Server::Servant_Upcall
&servant_upcall
) override
;
117 CORBA::Boolean
servant_has_remaining_activations (
118 PortableServer::Servant servant
) override
;
120 int unbind_using_user_id (
121 const PortableServer::ObjectId
&user_id
) override
;
123 TAO_Active_Object_Map
* get_active_object_map() const override
;
126 std::unique_ptr
<TAO_Active_Object_Map
> active_object_map_
;
127 CORBA::ULong waiting_servant_deactivation_
{ 0 } ;
132 TAO_END_VERSIONED_NAMESPACE_DECL
134 #include /**/ "ace/post.h"
135 #endif /* TAO_SERVANT_RETENTION_STRATEGY_RETAIN_H */