Storable_Naming_Context_Activator.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 
00004 //=============================================================================
00005 /**
00006  *  @file   Storable_Naming_Context_Activator.h
00007  *
00008  *  $Id: Storable_Naming_Context_Activator.h 77031 2007-02-12 15:20:17Z johnnyw $
00009  *
00010  *  @author Byron Harris <harris_b@ociweb.com>
00011  */
00012 //=============================================================================
00013 
00014 
00015 #ifndef TAO_STORABLE_NAMING_CONTEXT_ACTIVATOR_H
00016 #define TAO_STORABLE_NAMING_CONTEXT_ACTIVATOR_H
00017 #include /**/ "ace/pre.h"
00018 
00019 #include "tao/PortableServer/PortableServer.h"
00020 #include "tao/PortableServer/ServantActivatorC.h"
00021 #include "tao/LocalObject.h"
00022 
00023 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
00024 
00025 #include "orbsvcs/Naming/naming_serv_export.h"
00026 
00027 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00028 
00029 class TAO_Naming_Service_Persistence_Factory;
00030 
00031 /**
00032  * A servant activator to be use with a TAO_Storable_Naming_Context.
00033  * Permits contexts saved to disk in one naming service process to be
00034  * "lazily" created on demand in other processes by reading the
00035  * context file off disk only when a request to the context is made.
00036  */
00037 class TAO_Naming_Serv_Export TAO_Storable_Naming_Context_Activator :
00038   public virtual PortableServer::ServantActivator
00039 {
00040 public:
00041 
00042   /**
00043    * The constructor takes arguments needed to create a
00044    * TAO_Storable_Naming_Context and TAO_Naming_Context on demand.
00045    */
00046   TAO_Storable_Naming_Context_Activator(CORBA::ORB_ptr orb,
00047                                         TAO_Naming_Service_Persistence_Factory *factory,
00048                                         const ACE_TCHAR *persistence_directory,
00049                                         size_t context_size);
00050 
00051   virtual ~TAO_Storable_Naming_Context_Activator();
00052 
00053   /**
00054    * Create a TAO_Storable_Naming_Context and TAO_Naming_Context on
00055    * demand if a request to a naming context CORBA reference is made
00056    * and the servant implementing this reference does not yet exist.
00057    */
00058   virtual PortableServer::Servant incarnate (const PortableServer::ObjectId &oid,
00059                                              PortableServer::POA_ptr poa);
00060 
00061   /**
00062    * Used by the POA to delete the servant created from a call to incarnate.
00063    */
00064   virtual void etherealize (const PortableServer::ObjectId &oid,
00065                             PortableServer::POA_ptr adapter,
00066                             PortableServer::Servant servant,
00067                             CORBA::Boolean cleanup_in_progress,
00068                             CORBA::Boolean remaining_activations);
00069 
00070 private:
00071 
00072   CORBA::ORB_ptr orb_;
00073   TAO_Naming_Service_Persistence_Factory *factory_;
00074   const ACE_TCHAR *persistence_directory_;
00075   size_t context_size_;
00076 };
00077 
00078 TAO_END_VERSIONED_NAMESPACE_DECL
00079 
00080 #endif /* TAO_HAS_MINIMUM_POA */
00081 
00082 #include /**/ "ace/post.h"
00083 #endif

Generated on Sun Jan 27 16:15:32 2008 for TAO_CosNaming by doxygen 1.3.6