Storable_Naming_Context_Activator.h

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

Generated on Thu Nov 9 13:57:03 2006 for TAO_CosNaming by doxygen 1.3.6