ServantRetentionStrategyRetain.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file ServantRetentionStrategyRetain.h
00006  *
00007  *  ServantRetentionStrategyRetain.h,v 1.9 2006/06/20 07:21:21 jwillemsen Exp
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 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 ACE_ENV_ARG_DECL);
00040 
00041       virtual void strategy_cleanup(ACE_ENV_SINGLE_ARG_DECL);
00042 
00043       virtual int is_servant_in_map (PortableServer::Servant servant,
00044                                      int &wait_occurred_restart_call);
00045 
00046       virtual
00047       PortableServer::ObjectId *
00048       activate_object (PortableServer::Servant servant,
00049                        CORBA::Short priority,
00050                        int &wait_occurred_restart_call
00051                             ACE_ENV_ARG_DECL)
00052         ACE_THROW_SPEC ((CORBA::SystemException,
00053                          PortableServer::POA::ServantAlreadyActive,
00054                          PortableServer::POA::WrongPolicy));
00055 
00056 #if !defined (CORBA_E_MICRO)
00057       virtual
00058       void
00059       activate_object_with_id (const PortableServer::ObjectId &id,
00060                                PortableServer::Servant servant,
00061                                CORBA::Short priority,
00062                                int &wait_occurred_restart_call
00063                                ACE_ENV_ARG_DECL)
00064         ACE_THROW_SPEC ((CORBA::SystemException,
00065                    PortableServer::POA::ServantAlreadyActive,
00066                    PortableServer::POA::ObjectAlreadyActive,
00067                    PortableServer::POA::WrongPolicy));
00068 #endif
00069 
00070       void deactivate_object (const PortableServer::ObjectId &id
00071                               ACE_ENV_ARG_DECL);
00072 
00073       virtual PortableServer::Servant find_servant (
00074         const PortableServer::ObjectId &system_id
00075         ACE_ENV_ARG_DECL);
00076 
00077       virtual PortableServer::ObjectId * system_id_to_object_id (
00078         const PortableServer::ObjectId &system_id
00079         ACE_ENV_ARG_DECL)
00080           ACE_THROW_SPEC ((CORBA::SystemException,
00081                            PortableServer::POA::WrongAdapter,
00082                            PortableServer::POA::WrongPolicy));
00083 
00084       virtual
00085       PortableServer::Servant
00086       user_id_to_servant (const PortableServer::ObjectId &id
00087                      ACE_ENV_ARG_DECL)
00088         ACE_THROW_SPEC ((CORBA::SystemException,
00089                          PortableServer::POA::ObjectNotActive,
00090                          PortableServer::POA::WrongPolicy));
00091 
00092       CORBA::Object_ptr id_to_reference (const PortableServer::ObjectId &id,
00093                                          bool indirect ACE_ENV_ARG_DECL)
00094         ACE_THROW_SPEC ((CORBA::SystemException,
00095                          PortableServer::POA::ObjectNotActive,
00096                          PortableServer::POA::WrongPolicy));
00097 
00098       virtual
00099       TAO_SERVANT_LOCATION
00100       servant_present (const PortableServer::ObjectId &system_id,
00101                        PortableServer::Servant &servant
00102                        ACE_ENV_ARG_DECL);
00103 
00104       virtual PortableServer::Servant find_servant (
00105         const PortableServer::ObjectId &system_id,
00106         TAO::Portable_Server::Servant_Upcall &servant_upcall,
00107         TAO::Portable_Server::POA_Current_Impl &poa_current_impl
00108         ACE_ENV_ARG_DECL);
00109 
00110       virtual int find_servant_priority (
00111         const PortableServer::ObjectId &system_id,
00112         CORBA::Short &priority
00113         ACE_ENV_ARG_DECL);
00114 
00115       virtual void deactivate_all_objects (ACE_ENV_SINGLE_ARG_DECL)
00116         ACE_THROW_SPEC ((CORBA::SystemException,
00117                          PortableServer::POA::WrongPolicy));
00118 
00119       virtual PortableServer::ObjectId *servant_to_user_id (
00120         PortableServer::Servant servant
00121         ACE_ENV_ARG_DECL)
00122           ACE_THROW_SPEC ((CORBA::SystemException,
00123                            PortableServer::POA::ServantNotActive,
00124                            PortableServer::POA::WrongPolicy));
00125 
00126       virtual
00127       CORBA::Object_ptr
00128       servant_to_reference (PortableServer::Servant servant
00129                             ACE_ENV_ARG_DECL)
00130         ACE_THROW_SPEC ((CORBA::SystemException,
00131                       PortableServer::POA::ServantNotActive,
00132                       PortableServer::POA::WrongPolicy));
00133 
00134       virtual
00135       CORBA::Object_ptr create_reference (
00136         const char *intf,
00137         CORBA::Short priority
00138         ACE_ENV_ARG_DECL)
00139           ACE_THROW_SPEC ((CORBA::SystemException,
00140                            PortableServer::POA::WrongPolicy));
00141 
00142       virtual
00143       CORBA::Object_ptr create_reference_with_id (
00144         const PortableServer::ObjectId &oid,
00145         const char *intf,
00146         CORBA::Short priority
00147         ACE_ENV_ARG_DECL)
00148           ACE_THROW_SPEC ((CORBA::SystemException));
00149 
00150       virtual ::PortableServer::ServantRetentionPolicyValue type() const;
00151 
00152     protected:
00153       int
00154       is_user_id_in_map (const PortableServer::ObjectId &id,
00155                          CORBA::Short priority,
00156                          int &priorities_match,
00157                          int &wait_occurred_restart_call);
00158 
00159       void
00160       deactivate_map_entry (TAO_Active_Object_Map_Entry *active_object_map_entry
00161                             ACE_ENV_ARG_DECL);
00162 
00163       PortableServer::ObjectId *servant_to_system_id_i (
00164           PortableServer::Servant p_servant,
00165           CORBA::Short &priority
00166           ACE_ENV_ARG_DECL
00167         )
00168         ACE_THROW_SPEC ((CORBA::SystemException,
00169                          PortableServer::POA::ServantNotActive,
00170                          PortableServer::POA::WrongPolicy));
00171 
00172       virtual
00173       int rebind_using_user_id_and_system_id (
00174         PortableServer::Servant servant,
00175         const PortableServer::ObjectId &user_id,
00176         const PortableServer::ObjectId &system_id,
00177         TAO::Portable_Server::Servant_Upcall &servant_upcall);
00178 
00179       virtual
00180       CORBA::Boolean servant_has_remaining_activations (
00181         PortableServer::Servant servant);
00182 
00183       virtual int unbind_using_user_id (
00184         const PortableServer::ObjectId &user_id);
00185 
00186     private:
00187       TAO_Active_Object_Map *active_object_map_;
00188       CORBA::ULong waiting_servant_deactivation_;
00189     };
00190   }
00191 }
00192 
00193 TAO_END_VERSIONED_NAMESPACE_DECL
00194 
00195 #include /**/ "ace/post.h"
00196 #endif /* TAO_SERVANT_RETENTION_STRATEGY_RETAIN_H */

Generated on Thu Nov 9 12:40:45 2006 for TAO_PortableServer by doxygen 1.3.6