summaryrefslogtreecommitdiff
path: root/TAO/CIAO/ciao
diff options
context:
space:
mode:
authorvenkita <venkita@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2004-02-10 16:51:48 +0000
committervenkita <venkita@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2004-02-10 16:51:48 +0000
commit075c69a9e00da3865c15dc7f98369d5a12d6764c (patch)
tree322de23e1354cee3214f8577db6a7188bed0bd6d /TAO/CIAO/ciao
parent3b1cd6dfda918316b7ae70e55025b6042848ecfc (diff)
downloadATCD-075c69a9e00da3865c15dc7f98369d5a12d6764c.tar.gz
ChangeLogTag: Tue Feb 10 10:41:48 2004 Venkita Subramonian <venkita@cs.wustl.edu>
Diffstat (limited to 'TAO/CIAO/ciao')
-rw-r--r--TAO/CIAO/ciao/ComponentServer_Impl.cpp5
-rw-r--r--TAO/CIAO/ciao/ComponentServer_Impl.h12
-rw-r--r--TAO/CIAO/ciao/ComponentServer_Impl.inl11
-rw-r--r--TAO/CIAO/ciao/Container_Base.cpp68
-rw-r--r--TAO/CIAO/ciao/Container_Base.h43
-rw-r--r--TAO/CIAO/ciao/Container_Impl.cpp51
-rw-r--r--TAO/CIAO/ciao/Container_Impl.h10
-rw-r--r--TAO/CIAO/ciao/Container_Impl.inl8
8 files changed, 150 insertions, 58 deletions
diff --git a/TAO/CIAO/ciao/ComponentServer_Impl.cpp b/TAO/CIAO/ciao/ComponentServer_Impl.cpp
index a36a82aff4c..63cf731ef2c 100644
--- a/TAO/CIAO/ciao/ComponentServer_Impl.cpp
+++ b/TAO/CIAO/ciao/ComponentServer_Impl.cpp
@@ -74,7 +74,10 @@ CIAO::ComponentServer_Impl::create_container (const Components::ConfigValues & c
ACE_NEW_THROW_EX (container_servant,
CIAO::Container_Impl (this->orb_.in (),
this->poa_.in (),
- this->get_objref ()),
+ this->get_objref (),
+ this->static_config_flag_,
+ this->static_entrypts_maps_
+ ),
CORBA::INTERNAL ());
ACE_CHECK_RETURN (0);
diff --git a/TAO/CIAO/ciao/ComponentServer_Impl.h b/TAO/CIAO/ciao/ComponentServer_Impl.h
index fb6fb438282..d715da0a2cd 100644
--- a/TAO/CIAO/ciao/ComponentServer_Impl.h
+++ b/TAO/CIAO/ciao/ComponentServer_Impl.h
@@ -29,6 +29,7 @@
namespace CIAO
{
+ struct Static_Config_EntryPoints_Maps;
/**
* @class ComponentServer_Impl
*
@@ -46,7 +47,10 @@ namespace CIAO
public:
/// Constructor
ComponentServer_Impl (CORBA::ORB_ptr o,
- PortableServer::POA_ptr p);
+ PortableServer::POA_ptr p,
+ int static_config_flag = 0,
+ const Static_Config_EntryPoints_Maps* static_entrypts_maps = 0
+ );
/// Destructor
virtual ~ComponentServer_Impl (void);
@@ -132,6 +136,12 @@ protected:
/// Keep a list of managed Container objects.
Object_Set<Components::Deployment::Container, ::Components::Deployment::Container_var> container_set_;
+
+ /// Flag to indicate static configuration.
+ int static_config_flag_;
+
+ /// Reference to CIAO static config entry points map.
+ const Static_Config_EntryPoints_Maps* static_entrypts_maps_;
};
}
diff --git a/TAO/CIAO/ciao/ComponentServer_Impl.inl b/TAO/CIAO/ciao/ComponentServer_Impl.inl
index 5b2f94c6b32..275516e8db1 100644
--- a/TAO/CIAO/ciao/ComponentServer_Impl.inl
+++ b/TAO/CIAO/ciao/ComponentServer_Impl.inl
@@ -3,9 +3,13 @@
ACE_INLINE
CIAO::ComponentServer_Impl::ComponentServer_Impl (CORBA::ORB_ptr o,
- PortableServer::POA_ptr p)
+ PortableServer::POA_ptr p,
+ int static_config_flag,
+ const Static_Config_EntryPoints_Maps* static_entrypts_maps)
: orb_ (CORBA::ORB::_duplicate (o)),
- poa_ (PortableServer::POA::_duplicate (p))
+ poa_ (PortableServer::POA::_duplicate (p)),
+ static_config_flag_ (static_config_flag),
+ static_entrypts_maps_ (static_entrypts_maps)
{
}
@@ -41,6 +45,9 @@ CIAO::ComponentServer_Impl::get_component_installation (ACE_ENV_SINGLE_ARG_DECL)
{
if (CORBA::is_nil (this->installation_.in ()))
{
+ if (this->static_config_flag_ == 1)
+ return 0;
+
ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0);
CORBA::Object_var tmp = this->orb_->resolve_initial_references ("ComponentInstallation"
diff --git a/TAO/CIAO/ciao/Container_Base.cpp b/TAO/CIAO/ciao/Container_Base.cpp
index ee5cf0371aa..376e5d44283 100644
--- a/TAO/CIAO/ciao/Container_Base.cpp
+++ b/TAO/CIAO/ciao/Container_Base.cpp
@@ -36,9 +36,14 @@ CIAO::Container::_ciao_the_ORB ()
ACE_Atomic_Op <ACE_SYNCH_MUTEX, long>
CIAO::Session_Container::serial_number_ (0);
-CIAO::Session_Container::Session_Container (CORBA::ORB_ptr o)
+CIAO::Session_Container::Session_Container (CORBA::ORB_ptr o,
+ int static_config_flag,
+ const Static_Config_EntryPoints_Maps* maps
+ )
: Container (o),
- number_ (0)
+ number_ (0),
+ static_config_flag_ (static_config_flag),
+ static_entrypts_maps_ (maps)
{
}
@@ -152,28 +157,49 @@ CIAO::Session_Container::ciao_install_home (const char *exe_dll_name,
Components::Deployment::InstallationFailure))
{
ACE_DLL executor_dll, servant_dll;
+ HomeFactory hcreator=0;
+ ServantFactory screator=0;
- if (exe_dll_name == 0 || sv_dll_name == 0)
- ACE_THROW_RETURN (Components::Deployment::UnknownImplId (), 0);
-
- if (executor_dll.open (exe_dll_name,
- ACE_DEFAULT_SHLIB_MODE,
- 0) != 0)
- ACE_THROW_RETURN (Components::Deployment::UnknownImplId (), 0);
-
- if (servant_dll.open (sv_dll_name,
- ACE_DEFAULT_SHLIB_MODE,
- 0) != 0)
+ ACE_DEBUG ((LM_DEBUG, "static config flag = %d\n", this->static_config_flag_));
+ if (this->static_config_flag_ == 0)
{
- executor_dll.close ();
- ACE_THROW_RETURN (Components::Deployment::UnknownImplId (), 0);
+ if (exe_dll_name == 0 || sv_dll_name == 0)
+ ACE_THROW_RETURN (Components::Deployment::UnknownImplId (), 0);
+
+ if (executor_dll.open (exe_dll_name,
+ ACE_DEFAULT_SHLIB_MODE,
+ 0) != 0)
+ ACE_THROW_RETURN (Components::Deployment::UnknownImplId (), 0);
+
+ if (servant_dll.open (sv_dll_name,
+ ACE_DEFAULT_SHLIB_MODE,
+ 0) != 0)
+ {
+ executor_dll.close ();
+ ACE_THROW_RETURN (Components::Deployment::UnknownImplId (), 0);
+ }
+
+ if (exe_entrypt == 0 || sv_entrypt == 0)
+ ACE_THROW_RETURN (Components::Deployment::ImplEntryPointNotFound (), 0);
+
+ hcreator = (HomeFactory) executor_dll.symbol (exe_entrypt);
+ screator = (ServantFactory) servant_dll.symbol (sv_entrypt);
+ }
+ else
+ {
+ if ( static_entrypts_maps_ == 0 ||
+ static_entrypts_maps_->home_creator_funcptr_map_ == 0 ||
+ static_entrypts_maps_->home_servant_creator_funcptr_map_ == 0)
+ ACE_THROW_RETURN (Components::Deployment::ImplEntryPointNotFound (), 0);
+
+ ACE_CString exe_entrypt_str (exe_entrypt);
+ static_entrypts_maps_->home_creator_funcptr_map_->
+ find (exe_entrypt_str, hcreator);
+
+ ACE_CString sv_entrypt_str (sv_entrypt);
+ static_entrypts_maps_->home_servant_creator_funcptr_map_->
+ find (sv_entrypt_str, screator);
}
-
- if (exe_entrypt == 0 || sv_entrypt == 0)
- ACE_THROW_RETURN (Components::Deployment::ImplEntryPointNotFound (), 0);
-
- HomeFactory hcreator = (HomeFactory) executor_dll.symbol (exe_entrypt);
- ServantFactory screator = (ServantFactory) servant_dll.symbol (sv_entrypt);
if (hcreator == 0 || screator == 0)
ACE_THROW_RETURN (Components::Deployment::ImplEntryPointNotFound (), 0);
diff --git a/TAO/CIAO/ciao/Container_Base.h b/TAO/CIAO/ciao/Container_Base.h
index 651ea557ec3..2bf5f67c224 100644
--- a/TAO/CIAO/ciao/Container_Base.h
+++ b/TAO/CIAO/ciao/Container_Base.h
@@ -80,10 +80,42 @@ namespace CIAO
PortableServer::POA_var poa_;
};
+ class Session_Container;
+
+ typedef ::Components::HomeExecutorBase_ptr (*HomeFactory) (void);
+ typedef ::PortableServer::Servant (*ServantFactory)
+ (::Components::HomeExecutorBase_ptr p,
+ ::CIAO::Session_Container *c
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+
+ typedef ACE_Hash_Map_Manager_Ex<ACE_CString,
+ HomeFactory,
+ ACE_Hash<ACE_CString>,
+ ACE_Equal_To<ACE_CString>,
+ ACE_Null_Mutex> HOMECREATOR_FUNCPTR_MAP;
+
+ typedef ACE_Hash_Map_Manager_Ex<ACE_CString,
+ ServantFactory,
+ ACE_Hash<ACE_CString>,
+ ACE_Equal_To<ACE_CString>,
+ ACE_Null_Mutex> HOMESERVANTCREATOR_FUNCPTR_MAP;
+
+ struct Static_Config_EntryPoints_Maps
+ {
+ /// Map of home creator entry point name and func ptr
+ HOMECREATOR_FUNCPTR_MAP* home_creator_funcptr_map_;
+
+ /// Map of home servant creator entry point name and func ptr
+ HOMESERVANTCREATOR_FUNCPTR_MAP* home_servant_creator_funcptr_map_;
+ };
+
class CIAO_SERVER_Export Session_Container : public Container
{
public:
- Session_Container (CORBA::ORB_ptr o);
+ Session_Container (CORBA::ORB_ptr o,
+ int static_config_flag,
+ const Static_Config_EntryPoints_Maps* static_entrypts_maps
+ );
virtual ~Session_Container (void);
@@ -157,13 +189,10 @@ namespace CIAO
long number_;
static ACE_Atomic_Op <ACE_SYNCH_MUTEX, long> serial_number_;
- };
- typedef ::Components::HomeExecutorBase_ptr (*HomeFactory) (void);
- typedef ::PortableServer::Servant (*ServantFactory)
- (::Components::HomeExecutorBase_ptr p,
- ::CIAO::Session_Container *c
- ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+ int static_config_flag_;
+ const Static_Config_EntryPoints_Maps* static_entrypts_maps_;
+ };
}
#if defined (__ACE_INLINE__)
diff --git a/TAO/CIAO/ciao/Container_Impl.cpp b/TAO/CIAO/ciao/Container_Impl.cpp
index b547da43174..14a965c3772 100644
--- a/TAO/CIAO/ciao/Container_Impl.cpp
+++ b/TAO/CIAO/ciao/Container_Impl.cpp
@@ -36,7 +36,9 @@ CIAO::Container_Impl::init (const ::Components::ConfigValues &options,
// @@ Fish out the ComponentServer object reference from <options>.
ACE_NEW_THROW_EX (this->container_,
- CIAO::Session_Container (this->orb_.in ()),
+ CIAO::Session_Container (this->orb_.in (),
+ this->static_config_flag_,
+ this->static_entrypts_maps_),
CORBA::INTERNAL ());
ACE_CHECK_RETURN (-1);
@@ -241,31 +243,34 @@ CIAO::Container_Impl::parse_config_values (const char *id,
}
}
- component_install_info.executor_dll_ =
- this->installation_->get_implementation (id
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
-
- component_install_info.servant_dll_ =
- this->installation_->get_implementation (servant_uuid.in ()
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
-
- if (component_install_info.executor_dll_.in () == 0 ||
- component_install_info.servant_dll_.in () == 0 ||
- component_install_info.servant_entrypt_.in () == 0)
+ if (this->static_config_flag_ == 0)
{
- Components::InvalidConfiguration *exc = 0;
- ACE_NEW_THROW_EX (exc,
- Components::InvalidConfiguration,
- CORBA::NO_MEMORY ());
- exc->name = CORBA::string_dup ("home_installation_info");
- exc->reason = Components::ConfigValueRequired;
+ component_install_info.executor_dll_ =
+ this->installation_->get_implementation (id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ component_install_info.servant_dll_ =
+ this->installation_->get_implementation (servant_uuid.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (component_install_info.executor_dll_.in () == 0 ||
+ component_install_info.servant_dll_.in () == 0 ||
+ component_install_info.servant_entrypt_.in () == 0)
+ {
+ Components::InvalidConfiguration *exc = 0;
+ ACE_NEW_THROW_EX (exc,
+ Components::InvalidConfiguration,
+ CORBA::NO_MEMORY ());
+ exc->name = CORBA::string_dup ("home_installation_info");
+ exc->reason = Components::ConfigValueRequired;
#if defined (ACE_HAS_EXCEPTIONS)
- auto_ptr<Components::InvalidConfiguration> safety (exc);
- exc->_raise ();
+ auto_ptr<Components::InvalidConfiguration> safety (exc);
+ exc->_raise ();
#else
- ACE_TRY_ENV.exception (exc);
+ ACE_TRY_ENV.exception (exc);
#endif /*ACE_HAS_EXCEPTIONS*/
+ }
}
}
diff --git a/TAO/CIAO/ciao/Container_Impl.h b/TAO/CIAO/ciao/Container_Impl.h
index 26f86ddd1c3..320779483d1 100644
--- a/TAO/CIAO/ciao/Container_Impl.h
+++ b/TAO/CIAO/ciao/Container_Impl.h
@@ -57,7 +57,9 @@ namespace CIAO
/// Constructor
Container_Impl (CORBA::ORB_ptr o,
PortableServer::POA_ptr p,
- Components::Deployment::ComponentServer_ptr server);
+ Components::Deployment::ComponentServer_ptr server,
+ int static_config_flag,
+ const Static_Config_EntryPoints_Maps* static_entrypts_maps);
/// Destructor
virtual ~Container_Impl (void);
@@ -150,6 +152,12 @@ protected:
/// Keep a list of managed CCMHome.
Object_Set<Components::CCMHome, Components::CCMHome_var> home_set_;
+
+ /// Flag to indicate static configuration.
+ int static_config_flag_;
+
+ /// Reference to CIAO static config entry points map.
+ const Static_Config_EntryPoints_Maps* static_entrypts_maps_;
};
}
diff --git a/TAO/CIAO/ciao/Container_Impl.inl b/TAO/CIAO/ciao/Container_Impl.inl
index 5ca2953b032..cd1aea3253a 100644
--- a/TAO/CIAO/ciao/Container_Impl.inl
+++ b/TAO/CIAO/ciao/Container_Impl.inl
@@ -4,10 +4,14 @@
ACE_INLINE
CIAO::Container_Impl::Container_Impl (CORBA::ORB_ptr o,
PortableServer::POA_ptr p,
- Components::Deployment::ComponentServer_ptr s)
+ Components::Deployment::ComponentServer_ptr s,
+ int static_config_flag,
+ const Static_Config_EntryPoints_Maps* static_entrypts_maps)
: orb_ (CORBA::ORB::_duplicate (o)),
poa_ (PortableServer::POA::_duplicate (p)),
- comserv_ (Components::Deployment::ComponentServer::_duplicate (s))
+ comserv_ (Components::Deployment::ComponentServer::_duplicate (s)),
+ static_config_flag_ (static_config_flag),
+ static_entrypts_maps_ (static_entrypts_maps)
{
}