summaryrefslogtreecommitdiff
path: root/modules/CIAO/ciao/Dynamic_Component_Activator.cpp
diff options
context:
space:
mode:
authorjai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-01-29 21:10:39 +0000
committerjai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-01-29 21:10:39 +0000
commite7b830ab561638ed25822054be80ce12e8801d38 (patch)
treea5b9aa16924c541fcb424ee9460b1ac7f5a89352 /modules/CIAO/ciao/Dynamic_Component_Activator.cpp
parent9b720f395833b3ce2f499463e5fed37a0da926f4 (diff)
downloadATCD-DiffServ-Merge.tar.gz
branching/taggingDiffServ-Merge
Diffstat (limited to 'modules/CIAO/ciao/Dynamic_Component_Activator.cpp')
-rw-r--r--modules/CIAO/ciao/Dynamic_Component_Activator.cpp66
1 files changed, 66 insertions, 0 deletions
diff --git a/modules/CIAO/ciao/Dynamic_Component_Activator.cpp b/modules/CIAO/ciao/Dynamic_Component_Activator.cpp
new file mode 100644
index 00000000000..cdce36fb96f
--- /dev/null
+++ b/modules/CIAO/ciao/Dynamic_Component_Activator.cpp
@@ -0,0 +1,66 @@
+#include "ciao/Dynamic_Component_Activator.h"
+#include "ciao/Dynamic_Component_Servant_Base.h"
+#include "ciao/CIAO_common.h"
+#include "ace/Log_Msg.h"
+#include "ace/OS_NS_string.h"
+
+ACE_RCSID (ciao,
+ Dynamic_Component_Activator,
+ "$Id$")
+
+namespace CIAO
+{
+ Dynamic_Component_Activator::Dynamic_Component_Activator (CORBA::ORB_ptr o)
+ : orb_ (CORBA::ORB::_duplicate (o))
+ {
+ }
+
+ Dynamic_Component_Activator::~Dynamic_Component_Activator (void)
+ {
+ }
+
+ PortableServer::Servant
+ Dynamic_Component_Activator::incarnate (const PortableServer::ObjectId &oid,
+ PortableServer::POA_ptr)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::ForwardRequest))
+ {
+ Dynamic_Component_Servant_Base* servant = 0;
+ PortableServer::ObjectId new_oid (oid);
+
+ if (this->servant_map_.find (oid, servant) == 0)
+ {
+ return servant->create (new_oid);
+ }
+
+ return 0;
+ }
+
+ void
+ Dynamic_Component_Activator::etherealize (
+ const PortableServer::ObjectId &,
+ PortableServer::POA_ptr ,
+ PortableServer::Servant ,
+ CORBA::Boolean ,
+ CORBA::Boolean)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ }
+
+ void Dynamic_Component_Activator::add_servant_map
+ (PortableServer::ObjectId &oid,
+ Dynamic_Component_Servant_Base* servant)
+ {
+ this->servant_map_.bind (oid, servant);
+ }
+
+ void Dynamic_Component_Activator::delete_servant_map
+ (PortableServer::ObjectId &oid)
+ {
+ Dynamic_Component_Servant_Base* servant = 0;
+ if (this->servant_map_.unbind (oid, servant) != 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Invalid object reference\n"));
+ }
+ }
+}