00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef TAO_SERVANT_RETENTION_STRATEGY_RETAIN_H
00014 #define TAO_SERVANT_RETENTION_STRATEGY_RETAIN_H
00015 #include "ace/pre.h"
00016
00017 #include "tao/PortableServer/ServantRetentionStrategyNonRetain.h"
00018
00019 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00020 # pragma once
00021 #endif
00022
00023 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00024
00025 class TAO_Root_POA;
00026
00027 namespace TAO
00028 {
00029 namespace Portable_Server
00030 {
00031 class ServantRetentionStrategyRetain
00032 : public ServantRetentionStrategyNonRetain
00033 {
00034 public:
00035 ServantRetentionStrategyRetain (void);
00036
00037 CORBA::ULong waiting_servant_deactivation (void) const;
00038
00039 virtual void strategy_init (TAO_Root_POA *poa);
00040
00041 virtual void strategy_cleanup(void);
00042
00043 virtual int is_servant_in_map (PortableServer::Servant servant,
00044 bool &wait_occurred_restart_call);
00045
00046 virtual
00047 PortableServer::ObjectId *
00048 activate_object (PortableServer::Servant servant,
00049 CORBA::Short priority,
00050 bool &wait_occurred_restart_call
00051 );
00052
00053 #if !defined (CORBA_E_MICRO)
00054 virtual
00055 void
00056 activate_object_with_id (const PortableServer::ObjectId &id,
00057 PortableServer::Servant servant,
00058 CORBA::Short priority,
00059 bool &wait_occurred_restart_call);
00060 #endif
00061
00062 void deactivate_object (const PortableServer::ObjectId &id);
00063
00064 virtual PortableServer::Servant find_servant (
00065 const PortableServer::ObjectId &system_id
00066 );
00067
00068 virtual PortableServer::ObjectId * system_id_to_object_id (
00069 const PortableServer::ObjectId &system_id);
00070
00071 virtual
00072 PortableServer::Servant
00073 user_id_to_servant (const PortableServer::ObjectId &id);
00074
00075 CORBA::Object_ptr id_to_reference (const PortableServer::ObjectId &id,
00076 bool indirect);
00077
00078 virtual
00079 TAO_SERVANT_LOCATION
00080 servant_present (const PortableServer::ObjectId &system_id,
00081 PortableServer::Servant &servant);
00082
00083 virtual PortableServer::Servant find_servant (
00084 const PortableServer::ObjectId &system_id,
00085 TAO::Portable_Server::Servant_Upcall &servant_upcall,
00086 TAO::Portable_Server::POA_Current_Impl &poa_current_impl);
00087
00088 virtual int find_servant_priority (
00089 const PortableServer::ObjectId &system_id,
00090 CORBA::Short &priority
00091 );
00092
00093 virtual void deactivate_all_objects (void);
00094
00095 virtual PortableServer::ObjectId *servant_to_user_id (
00096 PortableServer::Servant servant
00097 );
00098
00099 virtual
00100 CORBA::Object_ptr
00101 servant_to_reference (PortableServer::Servant servant
00102 );
00103
00104 virtual
00105 CORBA::Object_ptr create_reference (
00106 const char *intf,
00107 CORBA::Short priority
00108 );
00109
00110 virtual
00111 CORBA::Object_ptr create_reference_with_id (
00112 const PortableServer::ObjectId &oid,
00113 const char *intf,
00114 CORBA::Short priority
00115 );
00116
00117 virtual ::PortableServer::ServantRetentionPolicyValue type() const;
00118
00119 protected:
00120 int
00121 is_user_id_in_map (const PortableServer::ObjectId &id,
00122 CORBA::Short priority,
00123 bool &priorities_match,
00124 bool &wait_occurred_restart_call);
00125
00126 void
00127 deactivate_map_entry (TAO_Active_Object_Map_Entry *active_object_map_entry
00128 );
00129
00130 PortableServer::ObjectId *servant_to_system_id_i (
00131 PortableServer::Servant p_servant,
00132 CORBA::Short &priority
00133
00134 );
00135
00136 virtual
00137 int rebind_using_user_id_and_system_id (
00138 PortableServer::Servant servant,
00139 const PortableServer::ObjectId &user_id,
00140 const PortableServer::ObjectId &system_id,
00141 TAO::Portable_Server::Servant_Upcall &servant_upcall);
00142
00143 virtual
00144 CORBA::Boolean servant_has_remaining_activations (
00145 PortableServer::Servant servant);
00146
00147 virtual int unbind_using_user_id (
00148 const PortableServer::ObjectId &user_id);
00149
00150 private:
00151 TAO_Active_Object_Map *active_object_map_;
00152 CORBA::ULong waiting_servant_deactivation_;
00153 };
00154 }
00155 }
00156
00157 TAO_END_VERSIONED_NAMESPACE_DECL
00158
00159 #include "ace/post.h"
00160 #endif