summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2004-11-18 23:56:32 +0000
committerjai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2004-11-18 23:56:32 +0000
commitb87b51d684179c46aae02650ce04826efa7744ca (patch)
tree84d01e4e1944819c71a80a76f1364642b9058807
parent5bc45d896f51f39281e42c5eceb48f0fabecb4bc (diff)
downloadATCD-b87b51d684179c46aae02650ce04826efa7744ca.tar.gz
*** empty log message ***
-rw-r--r--TAO/CIAO/DAnCE/ciao/Container_Base.h5
-rw-r--r--TAO/CIAO/DAnCE/ciao/Dynamic_Component_Servant_T.cpp14
-rw-r--r--TAO/CIAO/DAnCE/ciao/NodeApplication_Impl.cpp4
-rw-r--r--TAO/CIAO/DAnCE/ciao/NodeApplication_Impl.h1
-rw-r--r--TAO/CIAO/DAnCE/ciao/Swapping_Container.cpp129
-rw-r--r--TAO/CIAO/DAnCE/ciao/Swapping_Container.h18
-rw-r--r--TAO/CIAO/DAnCE/ciao/Swapping_Container.inl2
-rw-r--r--TAO/CIAO/DAnCE/ciao/Swapping_Servant_Home_Impl_T.cpp28
8 files changed, 176 insertions, 25 deletions
diff --git a/TAO/CIAO/DAnCE/ciao/Container_Base.h b/TAO/CIAO/DAnCE/ciao/Container_Base.h
index b76cf9da544..f66b2282d16 100644
--- a/TAO/CIAO/DAnCE/ciao/Container_Base.h
+++ b/TAO/CIAO/DAnCE/ciao/Container_Base.h
@@ -107,6 +107,7 @@ namespace CIAO
* are distinct from the component.
*/
PortableServer::POA_var facet_cons_poa_;
+ PortableServer::POA_var home_servant_poa_;
};
class Session_Container;
@@ -195,7 +196,7 @@ namespace CIAO
ACE_THROW_SPEC ((CORBA::SystemException));
// Install a servant for component or home.
- CORBA::Object_ptr install_servant (PortableServer::Servant p,
+ virtual CORBA::Object_ptr install_servant (PortableServer::Servant p,
Container::OA_Type t
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException));
@@ -207,7 +208,7 @@ namespace CIAO
ACE_THROW_SPEC ((CORBA::SystemException));
// Get an object reference to a component or home from the servant.
- CORBA::Object_ptr get_objref (PortableServer::Servant p
+ virtual CORBA::Object_ptr get_objref (PortableServer::Servant p
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException));
diff --git a/TAO/CIAO/DAnCE/ciao/Dynamic_Component_Servant_T.cpp b/TAO/CIAO/DAnCE/ciao/Dynamic_Component_Servant_T.cpp
index 3347e1448d4..8b36b3fcdae 100644
--- a/TAO/CIAO/DAnCE/ciao/Dynamic_Component_Servant_T.cpp
+++ b/TAO/CIAO/DAnCE/ciao/Dynamic_Component_Servant_T.cpp
@@ -22,6 +22,7 @@ namespace CIAO
executor_ (EXEC::_duplicate (exe)),
home_ (Components::CCMHome::_duplicate (home))
{
+ ACE_DEBUG ((LM_DEBUG, "created the dynamic servant\n"));
}
template <typename COMP_SVNT,
@@ -45,6 +46,7 @@ namespace CIAO
<COMP_SVNT, COMP_EXEC, COMP_EXEC_VAR,
EXEC, EXEC_VAR, COMP>::create (void)
{
+ ACE_DEBUG ((LM_DEBUG, "actually trying to create the servant\n"));
::Components::EnterpriseComponent_var ciao_ec =
this->executor_->create (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN (COMP::_nil ());
@@ -53,19 +55,15 @@ namespace CIAO
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (COMP::_nil ());
+ ACE_DEBUG ((LM_DEBUG, "narrowed down to EXEC VAR\n"));
COMP_SVNT *svt = new COMP_SVNT(ciao_comp.in (), this->home_.in (),
this->container_);
-
- /*
- COMP_SVNT *svt = 0;
- ACE_NEW_RETURN (svt,
- COMP_SVNT(ciao_comp.in (), this->home_.in (),
- this->container_),
- COMP::_nil ());
- */
+ ACE_DEBUG ((LM_DEBUG, "created the COMP SVNT\n"));
+
PortableServer::ServantBase_var safe (svt);
+ ACE_DEBUG ((LM_DEBUG, "actually created the dynamic servant\n"));
return safe._retn ();
}
}
diff --git a/TAO/CIAO/DAnCE/ciao/NodeApplication_Impl.cpp b/TAO/CIAO/DAnCE/ciao/NodeApplication_Impl.cpp
index 5c8c4fcf553..9a50c53e26f 100644
--- a/TAO/CIAO/DAnCE/ciao/NodeApplication_Impl.cpp
+++ b/TAO/CIAO/DAnCE/ciao/NodeApplication_Impl.cpp
@@ -391,9 +391,7 @@ CIAO::NodeApplication_Impl::init (ACE_ENV_SINGLE_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
ACE_NEW_THROW_EX (this->container_,
- CIAO::Session_Container (this->orb_.in (),
- 0,
- 0),
+ CIAO::Swapping_Container (this->orb_.in ()),
CORBA::NO_MEMORY ());
ACE_CHECK_RETURN (-1);
diff --git a/TAO/CIAO/DAnCE/ciao/NodeApplication_Impl.h b/TAO/CIAO/DAnCE/ciao/NodeApplication_Impl.h
index 64e497f2fdb..9fd4792e5f8 100644
--- a/TAO/CIAO/DAnCE/ciao/NodeApplication_Impl.h
+++ b/TAO/CIAO/DAnCE/ciao/NodeApplication_Impl.h
@@ -23,6 +23,7 @@
#include "ace/Synch.h"
#include "ace/Synch_Traits.h"
#include "Container_Base.h"
+#include "Swapping_Container.h"
#include "Deployment_CoreS.h"
#include "Server_init.h"
#include "CIAO_common.h"
diff --git a/TAO/CIAO/DAnCE/ciao/Swapping_Container.cpp b/TAO/CIAO/DAnCE/ciao/Swapping_Container.cpp
index a4190be2a37..393b6a8844d 100644
--- a/TAO/CIAO/DAnCE/ciao/Swapping_Container.cpp
+++ b/TAO/CIAO/DAnCE/ciao/Swapping_Container.cpp
@@ -26,6 +26,12 @@ namespace CIAO
{
}
+ PortableServer::POA_ptr
+ Swapping_Container::the_home_servant_POA (void) const
+ {
+ return this->home_servant_poa_.in ();
+ }
+
int
Swapping_Container::init (const char *name,
const CORBA::PolicyList *more_policies
@@ -59,12 +65,29 @@ namespace CIAO
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (-1);
+ ACE_DEBUG ((LM_DEBUG, "create servant POA\n"));
+
this->create_servant_POA (name,
more_policies,
root_poa.in ()
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (-1);
+ ACE_DEBUG ((LM_DEBUG, "created servant POA\n"));
+
+ ACE_DEBUG ((LM_DEBUG, "create home servant POA\n"));
+
+ this->create_home_servant_POA ("home servant POA",
+ more_policies,
+ root_poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ ACE_DEBUG ((LM_DEBUG, "created home servant POA\n"));
+
+ this->create_connections_POA (root_poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
PortableServer::POAManager_var poa_manager =
root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN (-1);
@@ -85,6 +108,80 @@ namespace CIAO
}
void
+ Swapping_Container::create_home_servant_POA (const char *name,
+ const CORBA::PolicyList *p,
+ PortableServer::POA_ptr root
+ ACE_ENV_ARG_DECL)
+ {
+ CORBA::PolicyList policies (0);
+
+ if (p != 0)
+ policies = *p;
+
+ PortableServer::POAManager_var poa_manager =
+ root->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "about to create home servant POA\n"));
+
+ this->home_servant_poa_ =
+ root->create_POA (name,
+ poa_manager.in (),
+ policies
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ ACE_DEBUG ((LM_DEBUG, "created home servant POA\n"));
+ }
+
+ void
+ Swapping_Container::create_connections_POA (
+ PortableServer::POA_ptr root
+ ACE_ENV_ARG_DECL)
+ {
+ PortableServer::POAManager_var poa_manager =
+ root->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO::Utils::PolicyList_Destroyer policies (3);
+ policies.length (3);
+
+ policies[0] =
+ root->create_id_assignment_policy (PortableServer::USER_ID
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ policies[1] =
+ root->create_request_processing_policy
+ (PortableServer::USE_SERVANT_MANAGER
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK;
+
+ // Servant Retention Policy
+ policies[2] =
+ root->create_servant_retention_policy (PortableServer::RETAIN
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->facet_cons_poa_ =
+ root->create_POA ("facet_consumer_poa",
+ poa_manager.in (),
+ policies
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_NEW_THROW_EX (this->sa_,
+ Servant_Activator (this->orb_.in ()),
+ CORBA::NO_MEMORY ());
+
+ this->facet_cons_poa_->set_servant_manager (
+ this->sa_
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK;
+ }
+
+ void
Swapping_Container::create_servant_POA (const char *name,
const CORBA::PolicyList *p,
PortableServer::POA_ptr root
@@ -138,4 +235,36 @@ namespace CIAO
ACE_CHECK;
}
+
+ CORBA::Object_ptr
+ Swapping_Container::install_servant (PortableServer::Servant p,
+ Container::OA_Type t
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ ACE_DEBUG ((LM_DEBUG, "i am inside install servant \n"));
+ PortableServer::POA_ptr tmp = 0;
+
+ if (t == Container::Component)
+ {
+ tmp = this->home_servant_poa_.in ();
+ ACE_DEBUG ((LM_DEBUG, "i am inside identifying the home servant POA \n"));
+ }
+ else
+ tmp = this->facet_cons_poa_.in ();
+
+ PortableServer::ObjectId_var oid
+ = tmp->activate_object (p
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ ACE_DEBUG ((LM_DEBUG, "activate object \n"));
+
+ CORBA::Object_var objref
+ = tmp->id_to_reference (oid.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ ACE_DEBUG ((LM_DEBUG, "create ref \n"));
+
+ return objref._retn ();
+ }
}
diff --git a/TAO/CIAO/DAnCE/ciao/Swapping_Container.h b/TAO/CIAO/DAnCE/ciao/Swapping_Container.h
index 302300e32bc..300f9d7cdb9 100644
--- a/TAO/CIAO/DAnCE/ciao/Swapping_Container.h
+++ b/TAO/CIAO/DAnCE/ciao/Swapping_Container.h
@@ -26,6 +26,7 @@
#include "ciao/Deployment_CoreC.h"
#include "ciao/Dynamic_Component_Activator.h"
#include "ciao/CIAO_Server_Export.h"
+#include "ciao/Servant_Activator.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
@@ -49,7 +50,12 @@ namespace CIAO
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException));
- CORBA::Object_ptr get_objref (PortableServer::Servant p
+ virtual CORBA::Object_ptr install_servant (PortableServer::Servant p,
+ Container::OA_Type t
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Object_ptr get_objref (PortableServer::Servant p
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException));
@@ -57,6 +63,8 @@ namespace CIAO
Dynamic_Component_Servant_Base* servant
ACE_ENV_ARG_DECL);
+ PortableServer::POA_ptr the_home_servant_POA (void) const;
+
private:
/// Create POA for the component.
@@ -64,6 +72,14 @@ namespace CIAO
const CORBA::PolicyList *p,
PortableServer::POA_ptr root
ACE_ENV_ARG_DECL);
+
+ void create_home_servant_POA (const char *name,
+ const CORBA::PolicyList *p,
+ PortableServer::POA_ptr root
+ ACE_ENV_ARG_DECL);
+
+ void create_connections_POA (PortableServer::POA_ptr root
+ ACE_ENV_ARG_DECL);
protected:
long number_;
diff --git a/TAO/CIAO/DAnCE/ciao/Swapping_Container.inl b/TAO/CIAO/DAnCE/ciao/Swapping_Container.inl
index b2c00a33346..9d6df55bb3f 100644
--- a/TAO/CIAO/DAnCE/ciao/Swapping_Container.inl
+++ b/TAO/CIAO/DAnCE/ciao/Swapping_Container.inl
@@ -5,6 +5,6 @@ CIAO::Swapping_Container::get_objref (PortableServer::Servant p
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
- return this->the_POA ()->servant_to_reference (p
+ return this->the_home_servant_POA ()->servant_to_reference (p
ACE_ENV_ARG_PARAMETER);
}
diff --git a/TAO/CIAO/DAnCE/ciao/Swapping_Servant_Home_Impl_T.cpp b/TAO/CIAO/DAnCE/ciao/Swapping_Servant_Home_Impl_T.cpp
index 329a180ed6e..118087d8e29 100644
--- a/TAO/CIAO/DAnCE/ciao/Swapping_Servant_Home_Impl_T.cpp
+++ b/TAO/CIAO/DAnCE/ciao/Swapping_Servant_Home_Impl_T.cpp
@@ -149,10 +149,14 @@ namespace CIAO
COMP::_nil ());
}
+ ACE_DEBUG ((LM_DEBUG, "creating home\n"));
+
::Components::EnterpriseComponent_var _ciao_ec =
this->executor_->create (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN (COMP::_nil ());
+ ACE_DEBUG ((LM_DEBUG, "created home \n"));
+
COMP_EXEC_VAR _ciao_comp =
COMP_EXEC::_narrow (_ciao_ec.in ()
ACE_ENV_ARG_PARAMETER);
@@ -186,41 +190,45 @@ namespace CIAO
)
ACE_THROW_SPEC ((CORBA::SystemException))
{
+ ACE_DEBUG ((LM_DEBUG, "activating the component\n"));
CORBA::Object_var hobj =
this->container_->get_objref (this
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (COMP::_nil ());
+ ACE_DEBUG ((LM_DEBUG, "obtaining the reference\n"));
Components::CCMHome_var home =
Components::CCMHome::_narrow (hobj.in ()
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (COMP::_nil ());
- const char* obj_id = "composition_name_home_name";
- const char* repo_id = "repo_id";
-
PortableServer::ObjectId_var oid =
- PortableServer::string_to_ObjectId (obj_id);
+ PortableServer::string_to_ObjectId (this->obj_id_);
CORBA::Object_var objref =
this->container_->generate_reference (
- obj_id,
- repo_id,
+ this->obj_id_,
+ this->repo_id_,
Container::Component
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (CORBA::Object::_nil ());
+ ACE_DEBUG ((LM_DEBUG, "generated the reference\n"));
- COMP_VAR ho = COMP::_narrow (objref.in ()
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (COMP::_nil ());
-
+ ACE_DEBUG ((LM_DEBUG, "creating the servant impl template\n"));
Dynamic_Component_Servant_Base *svt =
new Dynamic_Component_Servant
<COMP_SVNT, COMP_EXEC, COMP_EXEC_VAR, EXEC, EXEC_VAR, COMP>
(this->executor_.in (), home, this->container_);
+ ACE_DEBUG ((LM_DEBUG, "created the servant impl template\n"));
this->container_->update_servant_map (oid, svt);
+ ACE_DEBUG ((LM_DEBUG, "updated the map\n"));
+
+ COMP_VAR ho = COMP::_narrow (objref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (COMP::_nil ());
+
return ho._retn ();
}