ServantRetentionStrategyRetain.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file ServantRetentionStrategyRetain.h
00006  *
00007  *  $Id: ServantRetentionStrategyRetain.h 81319 2008-04-10 11:31:40Z johnnyw $
00008  *
00009  *  @author  Johnny Willemsen  <jwillemsen@remedy.nl>
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 /* ACE_LACKS_PRAGMA_ONCE */
00022 
00023 #include "ace/Auto_Ptr.h"
00024 
00025 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00026 
00027 class TAO_Root_POA;
00028 
00029 namespace TAO
00030 {
00031   namespace Portable_Server
00032   {
00033     class ServantRetentionStrategyRetain
00034        : public ServantRetentionStrategyNonRetain
00035     {
00036     public:
00037       ServantRetentionStrategyRetain (void);
00038 
00039       CORBA::ULong waiting_servant_deactivation (void) const;
00040 
00041       virtual void strategy_init (TAO_Root_POA *poa);
00042 
00043       virtual void strategy_cleanup(void);
00044 
00045       virtual int is_servant_in_map (PortableServer::Servant servant,
00046                                      bool &wait_occurred_restart_call);
00047 
00048       virtual
00049       PortableServer::ObjectId *
00050       activate_object (PortableServer::Servant servant,
00051                        CORBA::Short priority,
00052                        bool &wait_occurred_restart_call);
00053 
00054 #if !defined (CORBA_E_MICRO)
00055       virtual
00056       void
00057       activate_object_with_id (const PortableServer::ObjectId &id,
00058                                PortableServer::Servant servant,
00059                                CORBA::Short priority,
00060                                bool &wait_occurred_restart_call);
00061 #endif
00062 
00063       void deactivate_object (const PortableServer::ObjectId &id);
00064 
00065       virtual PortableServer::Servant find_servant (
00066         const PortableServer::ObjectId &system_id);
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       virtual void deactivate_all_objects (void);
00093 
00094       virtual PortableServer::ObjectId *servant_to_user_id (
00095         PortableServer::Servant servant);
00096 
00097       virtual
00098       CORBA::Object_ptr servant_to_reference (PortableServer::Servant servant);
00099 
00100       virtual
00101       CORBA::Object_ptr create_reference (
00102         const char *intf,
00103         CORBA::Short priority);
00104 
00105 #if !defined (CORBA_E_MICRO)
00106       virtual
00107       CORBA::Object_ptr create_reference_with_id (
00108         const PortableServer::ObjectId &oid,
00109         const char *intf,
00110         CORBA::Short priority);
00111 #endif
00112 
00113       virtual ::PortableServer::ServantRetentionPolicyValue type() const;
00114 
00115     protected:
00116       int
00117       is_user_id_in_map (const PortableServer::ObjectId &id,
00118                          CORBA::Short priority,
00119                          bool &priorities_match,
00120                          bool &wait_occurred_restart_call);
00121 
00122       void
00123       deactivate_map_entry (TAO_Active_Object_Map_Entry *active_object_map_entry);
00124 
00125       PortableServer::ObjectId *servant_to_system_id_i (
00126           PortableServer::Servant p_servant,
00127           CORBA::Short &priority);
00128 
00129       virtual
00130       int rebind_using_user_id_and_system_id (
00131         PortableServer::Servant servant,
00132         const PortableServer::ObjectId &user_id,
00133         const PortableServer::ObjectId &system_id,
00134         TAO::Portable_Server::Servant_Upcall &servant_upcall);
00135 
00136       virtual
00137       CORBA::Boolean servant_has_remaining_activations (
00138         PortableServer::Servant servant);
00139 
00140       virtual int unbind_using_user_id (
00141         const PortableServer::ObjectId &user_id);
00142 
00143     private:
00144       auto_ptr<TAO_Active_Object_Map> active_object_map_;
00145       CORBA::ULong waiting_servant_deactivation_;
00146     };
00147   }
00148 }
00149 
00150 TAO_END_VERSIONED_NAMESPACE_DECL
00151 
00152 #include /**/ "ace/post.h"
00153 #endif /* TAO_SERVANT_RETENTION_STRATEGY_RETAIN_H */

Generated on Tue Feb 2 17:40:54 2010 for TAO_PortableServer by  doxygen 1.4.7