summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.h
diff options
context:
space:
mode:
authorseibel_r <seibel_r@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-06-23 17:44:25 +0000
committerseibel_r <seibel_r@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-06-23 17:44:25 +0000
commit2d1efbf998bc5f43f34b9821a19ea440694395bb (patch)
treef7d7d383738372346a70d107bf4efa105a9f3280 /TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.h
parent6b234b1478ad31c1056c82cf2cb4f3d87904566c (diff)
downloadATCD-2d1efbf998bc5f43f34b9821a19ea440694395bb.tar.gz
Mon Jun 23 12:38:54 2003 Rich Seibel <seibel_r@ociweb.com>
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.h')
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.h83
1 files changed, 83 insertions, 0 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.h b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.h
new file mode 100644
index 00000000000..159b5c2b2c1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.h
@@ -0,0 +1,83 @@
+/* -*- C++ -*- */
+// $Id$
+// ============================================================================
+//
+// = LIBRARY
+// cos
+//
+// = FILENAME
+// Storable_Naming_Context_Activator.h
+//
+// = AUTHOR
+// Byron Harris <harris_b@ociweb.com>
+//
+// ============================================================================
+
+#ifndef TAO_STORABLE_NAMING_CONTEXT_ACTIVATOR_H
+#define TAO_STORABLE_NAMING_CONTEXT_ACTIVATOR_H
+#include "ace/pre.h"
+
+#include "tao/PortableServer/PortableServer.h"
+
+#if (TAO_HAS_MINIMUM_POA == 0)
+
+#include "naming_export.h"
+
+class TAO_Naming_Service_Persistence_Factory;
+
+/**
+ * A servant activator to be use with a TAO_Storable_Naming_Context.
+ * Permits contexts saved to disk in one naming service process to be
+ * "lazily" created on demand in other processes by reading the
+ * context file off disk only when a request to the context is made.
+ */
+class TAO_Naming_Export TAO_Storable_Naming_Context_Activator :
+ public PortableServer::ServantActivator
+{
+public:
+
+ /**
+ * The constructor takes arguments needed to create a
+ * TAO_Storable_Naming_Context and TAO_Naming_Context on demand.
+ */
+ TAO_Storable_Naming_Context_Activator(CORBA::ORB_ptr orb,
+ TAO_Naming_Service_Persistence_Factory *factory,
+ const ACE_TCHAR *persistence_directory,
+ size_t context_size);
+
+ virtual ~TAO_Storable_Naming_Context_Activator();
+
+ /**
+ * Create a TAO_Storable_Naming_Context and TAO_Naming_Context on
+ * demand if a request to a naming context CORBA reference is made
+ * and the servant implementing this reference does not yet exist.
+ */
+ virtual PortableServer::Servant incarnate (const PortableServer::ObjectId &oid,
+ PortableServer::POA_ptr poa
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::ForwardRequest));
+
+ /**
+ * Used by the POA to delete the servant created from a call to incarnate.
+ */
+ virtual void etherealize (const PortableServer::ObjectId &oid,
+ PortableServer::POA_ptr adapter,
+ PortableServer::Servant servant,
+ CORBA::Boolean cleanup_in_progress,
+ CORBA::Boolean remaining_activations
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+
+ CORBA::ORB_ptr orb_;
+ TAO_Naming_Service_Persistence_Factory *factory_;
+ const ACE_TCHAR *persistence_directory_;
+ size_t context_size_;
+};
+
+#endif /* TAO_HAS_MINIMUM_POA */
+
+#include "ace/post.h"
+#endif