3 //=============================================================================
5 * @file ServantRetentionStrategy.h
7 * @author Johnny Willemsen <jwillemsen@remedy.nl>
9 //=============================================================================
11 #ifndef TAO_SERVANTRETENTIONSTRATEGY_H
12 #define TAO_SERVANTRETENTIONSTRATEGY_H
13 #include /**/ "ace/pre.h"
15 #include "tao/PortableServer/Servant_Location.h"
17 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 #endif /* ACE_LACKS_PRAGMA_ONCE */
21 #include "tao/PortableServer/Servant_Upcall.h"
22 #include "tao/PortableServer/ServantRetentionPolicyC.h"
23 #include "tao/PortableServer/PortableServer.h"
25 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
28 class TAO_Active_Object_Map
;
29 struct TAO_Active_Object_Map_Entry
;
33 namespace Portable_Server
35 class ServantRetentionStrategy
38 ServantRetentionStrategy ();
39 virtual ~ServantRetentionStrategy () = default;
41 virtual void strategy_init (TAO_Root_POA
*poa
) = 0;
43 virtual void strategy_cleanup() = 0;
45 virtual CORBA::ULong
waiting_servant_deactivation () const = 0;
47 virtual int is_servant_in_map (PortableServer::Servant servant
,
48 bool &wait_occurred_restart_call
) = 0;
50 virtual TAO_Servant_Location
servant_present (
51 const PortableServer::ObjectId
&system_id
,
52 PortableServer::Servant
&servant
) = 0;
54 virtual PortableServer::Servant
find_servant (
55 const PortableServer::ObjectId
&system_id
,
56 TAO::Portable_Server::Servant_Upcall
&servant_upcall
,
57 TAO::Portable_Server::POA_Current_Impl
&poa_current_impl
) = 0;
59 virtual int find_servant_priority (
60 const PortableServer::ObjectId
&system_id
,
61 CORBA::Short
&priority
) = 0;
63 virtual PortableServer::ObjectId
*activate_object (
64 PortableServer::Servant servant
,
65 CORBA::Short priority
,
66 bool &wait_occurred_restart_call
) = 0;
68 virtual void activate_object_with_id (
69 const PortableServer::ObjectId
&id
,
70 PortableServer::Servant servant
,
71 CORBA::Short priority
,
72 bool &wait_occurred_restart_call
) = 0;
74 virtual void deactivate_object (const PortableServer::ObjectId
&id
) = 0;
76 virtual PortableServer::Servant
find_servant (
77 const PortableServer::ObjectId
&system_id
) = 0;
79 virtual PortableServer::ObjectId
*system_id_to_object_id (
80 const PortableServer::ObjectId
&system_id
) = 0;
82 virtual PortableServer::Servant
user_id_to_servant (
83 const PortableServer::ObjectId
&id
) = 0;
85 virtual CORBA::Object_ptr
id_to_reference (
86 const PortableServer::ObjectId
&id
,
89 virtual void deactivate_all_objects () = 0;
91 virtual PortableServer::ObjectId
*servant_to_user_id (
92 PortableServer::Servant servant
) = 0;
94 virtual CORBA::Object_ptr
servant_to_reference (
95 PortableServer::Servant servant
) = 0;
97 virtual CORBA::Object_ptr
create_reference (
99 CORBA::Short priority
) = 0;
101 #if !defined (CORBA_E_MICRO)
102 virtual CORBA::Object_ptr
create_reference_with_id (
103 const PortableServer::ObjectId
&oid
,
105 CORBA::Short priority
) = 0;
108 virtual int rebind_using_user_id_and_system_id (
109 PortableServer::Servant servant
,
110 const PortableServer::ObjectId
&user_id
,
111 const PortableServer::ObjectId
&system_id
,
112 TAO::Portable_Server::Servant_Upcall
&servant_upcall
) = 0;
114 virtual int unbind_using_user_id (
115 const PortableServer::ObjectId
&user_id
) = 0;
117 virtual CORBA::Boolean
servant_has_remaining_activations (
118 PortableServer::Servant servant
) = 0;
120 virtual ::PortableServer::ServantRetentionPolicyValue
type() const = 0;
122 virtual TAO_Active_Object_Map
* get_active_object_map() const = 0;
127 TAO_END_VERSIONED_NAMESPACE_DECL
129 #include /**/ "ace/post.h"
130 #endif /* TAO_SERVANTRETENTIONSTRATEGY_H */