diff options
Diffstat (limited to 'TAO/CIAO/DAnCE/ciao')
-rw-r--r-- | TAO/CIAO/DAnCE/ciao/CCM_Container.idl | 2 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/ciao/CCM_Core.mpc | 25 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/ciao/ComponentsC.h | 2 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/ciao/Container_Base.cpp | 687 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/ciao/Container_Base.h | 101 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/ciao/Container_Base.inl | 10 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/ciao/Servant_Impl_Base.cpp | 425 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/ciao/Servant_Impl_Base.h | 134 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/ciao/Servant_Impl_T.cpp | 196 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/ciao/Servant_Impl_T.h | 43 |
10 files changed, 353 insertions, 1272 deletions
diff --git a/TAO/CIAO/DAnCE/ciao/CCM_Container.idl b/TAO/CIAO/DAnCE/ciao/CCM_Container.idl index 220a09ea261..0b7d23562fc 100644 --- a/TAO/CIAO/DAnCE/ciao/CCM_Container.idl +++ b/TAO/CIAO/DAnCE/ciao/CCM_Container.idl @@ -17,7 +17,7 @@ #define CCM_CONTAINER_IDL #include "CCM_Component.idl" -#include "orbsvcs/SecurityLevel2.idl" +#include "orbsvcs/orbsvcs/SecurityLevel2.idl" #include "CCM_Transaction.idl" // *************** Basic Container interfaces *************** diff --git a/TAO/CIAO/DAnCE/ciao/CCM_Core.mpc b/TAO/CIAO/DAnCE/ciao/CCM_Core.mpc index 8384d770c0a..b8a0c253087 100644 --- a/TAO/CIAO/DAnCE/ciao/CCM_Core.mpc +++ b/TAO/CIAO/DAnCE/ciao/CCM_Core.mpc @@ -31,7 +31,7 @@ project (CIAO_DnC_Client) : taolib_with_idl, valuetype, ifr_client { } } -project (CIAO_DnC_Container) : orbsvcslib, portableserver, security, valuetype, ifr_client { +project (CIAO_DnC_Container) : orbsvcslib, portableserver, security, iorinterceptor, objreftemplate, valuetype, ifr_client { after += CIAO_DnC_Client sharedname = CIAO_DnC_Container libs += CIAO_DnC_Client @@ -62,7 +62,7 @@ project (CIAO_DnC_Container) : orbsvcslib, portableserver, security, valuetype, // Valuetype library must be linked for this project. // Please don't remove. project(Deployment_stub) : taolib_with_idl, valuetype, ifr_client { - sharedname = CIAO_Deployment_stub + sharedname = Deployment_stub after += CIAO_DnC_Client idlflags += -Wb,stub_export_macro=Deployment_stub_Export @@ -91,11 +91,11 @@ project(Deployment_stub) : taolib_with_idl, valuetype, ifr_client { // CIAO_DnC_Client library must be linked for this project. // Please don't remove. -project(Deployment_svnt) : taolib_with_idl, portableserver, valuetype,ifr_client { +project(Deployment_svnt) : taolib_with_idl, portableserver, ifr_client { after += Deployment_stub - sharedname = CIAO_Deployment_svnt + sharedname = Deployment_svnt dynamicflags = DEPLOYMENT_SVNT_BUILD_DLL - libs += CIAO_Deployment_stub CIAO_DnC_Client + libs += Deployment_stub CIAO_DnC_Client idlflags += -Wb,stub_export_macro=Deployment_stub_Export idlflags += -Wb,stub_export_include=Deployment_stub_export.h idlflags += -Wb,skel_export_macro=Deployment_svnt_Export @@ -115,11 +115,10 @@ project(Deployment_svnt) : taolib_with_idl, portableserver, valuetype,ifr_client } -project (CIAO_DnC_Server) : orbsvcslib, portableserver, valuetype, ifr_client, utils, security { +project (CIAO_DnC_Server) : orbsvcslib, portableserver, iorinterceptor, objreftemplate, valuetype, ifr_client, security { after += CIAO_DnC_Container Deployment_svnt - includes += $(CIAO_ROOT)/DAnCE sharedname = CIAO_DnC_Server - libs += CIAO_DnC_Client CIAO_DnC_Container CIAO_Deployment_svnt CIAO_Deployment_stub + libs += CIAO_DnC_Client CIAO_DnC_Container Deployment_svnt Deployment_stub idlflags += -Wb,export_include=CIAO_Server_Export.h -Wb,export_macro=CIAO_SERVER_Export dynamicflags = CIAO_SERVER_BUILD_DLL @@ -130,13 +129,8 @@ project (CIAO_DnC_Server) : orbsvcslib, portableserver, valuetype, ifr_client, u Source_Files { Container_Base.cpp NodeApplication_Impl.cpp - Context_Impl_Base.cpp - Home_Servant_Impl_Base.cpp - Servant_Impl_Base.cpp Server_init.cpp - Servant_Activator.cpp - Port_Activator.cpp - StandardConfigurator_Impl.cpp + Servant_Impl_Base.cpp } Header_Files { @@ -145,10 +139,7 @@ project (CIAO_DnC_Server) : orbsvcslib, portableserver, valuetype, ifr_client, u } Template_Files { - Context_Impl_T.cpp - Home_Servant_Impl_T.cpp Servant_Impl_T.cpp - Servant_Activator_T.cpp } } diff --git a/TAO/CIAO/DAnCE/ciao/ComponentsC.h b/TAO/CIAO/DAnCE/ciao/ComponentsC.h index 4ef065c4e8d..32e5a755e83 100644 --- a/TAO/CIAO/DAnCE/ciao/ComponentsC.h +++ b/TAO/CIAO/DAnCE/ciao/ComponentsC.h @@ -72,7 +72,7 @@ // Traits specializations. namespace TAO { -} +}; // TAO_IDL - Generated from // be/be_visitor_root/cdr_op.cpp:48 diff --git a/TAO/CIAO/DAnCE/ciao/Container_Base.cpp b/TAO/CIAO/DAnCE/ciao/Container_Base.cpp index f1fce5ec95f..794e3927437 100644 --- a/TAO/CIAO/DAnCE/ciao/Container_Base.cpp +++ b/TAO/CIAO/DAnCE/ciao/Container_Base.cpp @@ -2,429 +2,300 @@ #include "Container_Base.h" #include "ace/DLL.h" -#include "tao/Utils/PolicyList_Destroyer.h" #include "ace/OS_NS_stdio.h" -#include "Servant_Activator.h" #if !defined (__ACE_INLINE__) # include "Container_Base.inl" #endif /* __ACE_INLINE__ */ -namespace CIAO +//////////////////////////////////////////////////////////////// + +CIAO::Container::Container (CORBA::ORB_ptr o) + : orb_ (CORBA::ORB::_duplicate (o)) { +} -//////////////////////////////////////////////////////////////// - Container::Container (CORBA::ORB_ptr o) - : orb_ (CORBA::ORB::_duplicate (o)) - { - } - - Container::~Container () - { - } - - PortableServer::POA_ptr - Container::the_POA (void) const - { - return this->component_poa_.in (); - } - - CORBA::ORB_ptr - Container::the_ORB (void) const - { - return this->orb_.in (); - } - - /////////////////////////////////////////////////////////////// - - ACE_Atomic_Op <ACE_SYNCH_MUTEX, long> - Session_Container::serial_number_ (0); - - Session_Container::Session_Container (CORBA::ORB_ptr o, - bool static_config_flag, - const Static_Config_EntryPoints_Maps* maps) +CIAO::Container::~Container () +{ +} + +PortableServer::POA_ptr +CIAO::Container::_ciao_the_POA (void) +{ + return this->poa_.in (); +} + +CORBA::ORB_ptr +CIAO::Container::_ciao_the_ORB () +{ + return this->orb_.in (); +} + +/////////////////////////////////////////////////////////////// + +ACE_Atomic_Op <ACE_SYNCH_MUTEX, long> +CIAO::Session_Container::serial_number_ (0); + +CIAO::Session_Container::Session_Container (CORBA::ORB_ptr o, + int static_config_flag, + const Static_Config_EntryPoints_Maps* maps + ) : Container (o), number_ (0), static_config_flag_ (static_config_flag), - static_entrypts_maps_ (maps), - sa_ (0) - { - } - - Session_Container::~Session_Container () - { - } - - int - Session_Container::init (const char *name, - const CORBA::PolicyList *more_policies - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - char buffer[MAXPATHLEN]; - - if (name == 0) - { - this->number_ = ++Session_Container::serial_number_; - ACE_OS::sprintf (buffer, "CIAO::Session_Container-%ld", - this->number_); - name = buffer; - } - - CORBA::Object_var poa_object = - this->orb_->resolve_initial_references("RootPOA" - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - if (CORBA::is_nil (poa_object.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize the POA.\n"), - -1); - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (poa_object.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - this->create_component_POA (name, - more_policies, - root_poa.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - this->create_facet_consumer_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); - - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - return 0; - } - - void - Session_Container::create_component_POA (const char *name, - const CORBA::PolicyList *p, - PortableServer::POA_ptr root - ACE_ENV_ARG_DECL) - { - // Set up proper poa policies here. Default policies seems to be - // fine for session container. If you add some other default - // policies here, then you need to "add" more_policies below - // instead of simply assigning more_policies to the init policy - // list. - CORBA::PolicyList policies (0); - - if (p != 0) - policies = *p; - - PortableServer::POAManager_var poa_manager = - root->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - this->component_poa_ = - root->create_POA (name, - poa_manager.in (), - policies - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - void - Session_Container::create_facet_consumer_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; - } - - CORBA::Object_ptr - Session_Container::install_servant (PortableServer::Servant p, - Container::OA_Type t - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - PortableServer::POA_ptr tmp = 0; - - if (t == Container::Component) - tmp = this->component_poa_.in (); - else - tmp = this->facet_cons_poa_.in (); - - PortableServer::ObjectId_var oid - = tmp->activate_object (p - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - CORBA::Object_var objref - = tmp->id_to_reference (oid.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - return objref._retn (); - } - - CORBA::Object_ptr - Session_Container::install_component (PortableServer::Servant p, - PortableServer::ObjectId_out oid - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - PortableServer::ObjectId_var id = - this->component_poa_->activate_object (p - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - CORBA::Object_var objref - = this->component_poa_->id_to_reference (id.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - oid = id._retn (); - - return objref._retn (); - } - - - //@@ Apparently we need to be cautious when handling the exception - // thrown here. We should make sure that new DnC interfaces - // NodeApplication/NodeApplicationManager etc will cache the new - // exceptions--> rethrow of new exceptions is needed. - // --Tao - Components::CCMHome_ptr - Session_Container::ciao_install_home (const char *exe_dll_name, - const char *exe_entrypt, - const char *sv_dll_name, - const char *sv_entrypt - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - Deployment::UnknownImplId, - Deployment::ImplEntryPointNotFound, - Deployment::InstallationFailure)) - { - - HomeFactory hcreator = 0; - ServantFactory screator = 0; - - if (this->static_config_flag_ == 0) - { - ACE_DLL executor_dll, servant_dll; - - if (exe_dll_name == 0 || sv_dll_name == 0) - ACE_THROW_RETURN (Deployment::UnknownImplId (), - Components::CCMHome::_nil ()); - - if (executor_dll.open (exe_dll_name, - ACE_DEFAULT_SHLIB_MODE, - 0) != 0 - || servant_dll.open (sv_dll_name, - ACE_DEFAULT_SHLIB_MODE, - 0) != 0) - { - ACE_THROW_RETURN (Deployment::UnknownImplId (), - Components::CCMHome::_nil ()); - } - - if (exe_entrypt == 0 || sv_entrypt == 0) - ACE_THROW_RETURN (Deployment::ImplEntryPointNotFound (), - Components::CCMHome::_nil ()); - - // @@ (OO) Please use a static_cast<> here instead of a C-style - // cast. ANSI C++ casts are the preferred (and modern) - // way of casting in ACE/TAO/CIAO. - hcreator = (HomeFactory) executor_dll.symbol (exe_entrypt); - screator = (ServantFactory) servant_dll.symbol (sv_entrypt); + static_entrypts_maps_ (maps) +{ +} + +CIAO::Session_Container::~Session_Container () +{ +} + +int +CIAO::Session_Container::init (const char *name, + const CORBA::PolicyList *more_policies + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + char buffer[MAXPATHLEN]; + + if (name == 0) + { + this->number_ = ++CIAO::Session_Container::serial_number_; + ACE_OS::sprintf (buffer, "CIAO::Session_Container-%ld", + this->number_); + name = buffer; } - 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 (Deployment::ImplEntryPointNotFound (), - Components::CCMHome::_nil ()); - - 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 (hcreator == 0 || screator == 0) - ACE_THROW_RETURN (Deployment::ImplEntryPointNotFound (), - Components::CCMHome::_nil ()); - - Components::HomeExecutorBase_var home_executor = hcreator (); - if (CORBA::is_nil (home_executor.in ())) - ACE_THROW_RETURN (Deployment::InstallationFailure (), - Components::CCMHome::_nil ()); - - PortableServer::Servant home_servant = screator (home_executor.in (), - this - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (Components::CCMHome::_nil ()); - - if (home_servant == 0) - ACE_THROW_RETURN (Deployment::InstallationFailure (), - Components::CCMHome::_nil ()); - - PortableServer::ServantBase_var safe (home_servant); - - CORBA::Object_var objref = - this->install_servant (home_servant, - Container::Component - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (Components::CCMHome::_nil ()); - - Components::CCMHome_var homeref = - Components::CCMHome::_narrow (objref.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - return homeref._retn (); - - } - - void - Session_Container::ciao_uninstall_home (Components::CCMHome_ptr homeref + + CORBA::Object_var poa_object = + this->orb_->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (-1); + + if (CORBA::is_nil (poa_object.in ())) + ACE_ERROR_RETURN ((LM_ERROR, + " (%P|%t) Unable to initialize the POA.\n"), + -1); + + PortableServer::POA_var root_poa = + PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (-1); + + // Set up proper poa policies here. Default policies seems to be + // fine for session container. If you add some other default + // policies here, then you need to "add" more_policies below + // instead of simply assigning more_policies to the init policy + // list. + CORBA::PolicyList policies (0); + + if (more_policies != 0) + policies = *more_policies; + + this->poa_ = root_poa->create_POA (name, + PortableServer::POAManager::_nil (), + policies + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (-1); + + PortableServer::POAManager_var poa_manager = + this->poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (-1); + + poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (-1); + + return 0; +} + +CORBA::Object_ptr +CIAO::Session_Container::install_servant (PortableServer::Servant p ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - this->uninstall (homeref, - Container::Component - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - void - Session_Container::uninstall (CORBA::Object_ptr objref, - Container::OA_Type t - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - PortableServer::POA_ptr tmp = 0; - - if (t == Container::Component) - tmp = this->component_poa_.in (); - else - tmp = this->facet_cons_poa_.in (); - - PortableServer::ObjectId_var oid = - tmp->reference_to_id (objref - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - tmp->deactivate_object (oid.in () - ACE_ENV_ARG_PARAMETER); - } - - void - Session_Container::uninstall (PortableServer::Servant svt, - Container::OA_Type t - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - PortableServer::POA_ptr tmp = 0; - - if (t == Container::Component) - tmp = this->component_poa_.in (); - else - tmp = this->facet_cons_poa_.in (); - - PortableServer::ObjectId_var oid - = tmp->servant_to_id (svt + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + PortableServer::ObjectId_var oid + = this->poa_->activate_object (p + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + CORBA::Object_var objref + = this->poa_->id_to_reference (oid.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + return objref._retn (); +} + +CORBA::Object_ptr +CIAO::Session_Container::install_component (PortableServer::Servant p, + PortableServer::ObjectId_out oid + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + PortableServer::ObjectId_var id + = this->poa_->activate_object (p + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + CORBA::Object_var objref + = this->poa_->id_to_reference (id.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + oid = id._retn (); + + return objref._retn (); +} + + +//@@ Apparently we need to be cautious when handling the exception +// thrown here. We should make sure that new DnC interfaces +// NodeApplication/NodeApplicationManager etc will cache the new +// exceptions--> rethrow of new exceptions is needed. +// --Tao +Components::CCMHome_ptr +CIAO::Session_Container::ciao_install_home (const char *exe_dll_name, + const char *exe_entrypt, + const char *sv_dll_name, + const char *sv_entrypt + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Deployment::UnknownImplId, + Deployment::ImplEntryPointNotFound, + Deployment::InstallationFailure)) +{ + + HomeFactory hcreator = 0; + ServantFactory screator = 0; + + if (this->static_config_flag_ == 0) + { + ACE_DLL executor_dll, servant_dll; + + if (exe_dll_name == 0 || sv_dll_name == 0) + ACE_THROW_RETURN (Deployment::UnknownImplId (), + Components::CCMHome::_nil ()); + + if (executor_dll.open (exe_dll_name, + ACE_DEFAULT_SHLIB_MODE, + 0) != 0 + || servant_dll.open (sv_dll_name, + ACE_DEFAULT_SHLIB_MODE, + 0) != 0) + { + ACE_THROW_RETURN (Deployment::UnknownImplId (), + Components::CCMHome::_nil ()); + } + + if (exe_entrypt == 0 || sv_entrypt == 0) + ACE_THROW_RETURN (Deployment::ImplEntryPointNotFound (), + Components::CCMHome::_nil ()); + + // @@ (OO) Please use a static_cast<> here instead of a C-style + // cast. ANSI C++ casts are the preferred (and modern) + // way of casting in ACE/TAO/CIAO. + 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 (Deployment::ImplEntryPointNotFound (), + Components::CCMHome::_nil ()); + + 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 (hcreator == 0 || screator == 0) + ACE_THROW_RETURN (Deployment::ImplEntryPointNotFound (), + Components::CCMHome::_nil ()); + + Components::HomeExecutorBase_var home_executor = hcreator (); + if (CORBA::is_nil (home_executor.in ())) + ACE_THROW_RETURN (Deployment::InstallationFailure (), + Components::CCMHome::_nil ()); + + PortableServer::Servant home_servant = screator (home_executor.in (), + this + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (Components::CCMHome::_nil ()); + + if (home_servant == 0) + ACE_THROW_RETURN (Deployment::InstallationFailure (), + Components::CCMHome::_nil ()); + + PortableServer::ServantBase_var safe (home_servant); + + CORBA::Object_var objref = this->install_servant (home_servant + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (Components::CCMHome::_nil ()); + + Components::CCMHome_var homeref = + Components::CCMHome::_narrow (objref.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + return homeref._retn (); + +} + +void +CIAO::Session_Container::ciao_uninstall_home (Components::CCMHome_ptr homeref + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + this->uninstall (homeref + ACE_ENV_ARG_PARAMETER); +} + +void +CIAO::Session_Container::uninstall (CORBA::Object_ptr objref + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + PortableServer::ObjectId_var oid + = this->poa_->reference_to_id (objref + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + this->poa_->deactivate_object (oid.in () + ACE_ENV_ARG_PARAMETER); +} + +void +CIAO::Session_Container::uninstall (PortableServer::Servant svt + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + PortableServer::ObjectId_var oid + = this->poa_->servant_to_id (svt ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + ACE_CHECK; - tmp->deactivate_object (oid.in () - ACE_ENV_ARG_PARAMETER); - } + this->poa_->deactivate_object (oid.in () + ACE_ENV_ARG_PARAMETER); +} - void - Session_Container::uninstall_component (Components::CCMObject_ptr objref, - PortableServer::ObjectId_out oid - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - - PortableServer::ObjectId_var id = - this->component_poa_->reference_to_id (objref - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - this->component_poa_->deactivate_object (id.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - oid = id._retn (); - } - - CORBA::Object_ptr - Session_Container::generate_reference (const char *obj_id, - const char *repo_id, - Container::OA_Type t - ACE_ENV_ARG_DECL) - { - PortableServer::POA_ptr tmp = 0; - - if (t == Container::Component) - tmp = this->component_poa_.in (); - else - tmp = this->facet_cons_poa_.in (); - - PortableServer::ObjectId_var oid = - PortableServer::string_to_ObjectId (obj_id); - - CORBA::Object_var objref = - tmp->create_reference_with_id (oid.in (), - repo_id - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (CORBA::Object::_nil ()); - - return objref._retn (); - } +void +CIAO::Session_Container::uninstall_component (Components::CCMObject_ptr objref, + PortableServer::ObjectId_out oid + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + PortableServer::ObjectId_var id + = this->poa_->reference_to_id (objref + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + this->poa_->deactivate_object (id.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + oid = id._retn (); } diff --git a/TAO/CIAO/DAnCE/ciao/Container_Base.h b/TAO/CIAO/DAnCE/ciao/Container_Base.h index b76cf9da544..2a618114c7d 100644 --- a/TAO/CIAO/DAnCE/ciao/Container_Base.h +++ b/TAO/CIAO/DAnCE/ciao/Container_Base.h @@ -20,9 +20,9 @@ #include "tao/ORB.h" #include "tao/PortableServer/PortableServer.h" #include "tao/PortableServer/Servant_Base.h" -#include "ciao/CCM_ContainerC.h" -#include "ciao/Deployment_CoreC.h" -#include "ciao/CIAO_Server_Export.h" +#include "CCM_ContainerC.h" +#include "Deployment_CoreC.h" +#include "CIAO_Server_Export.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -30,8 +30,6 @@ namespace CIAO { - class Servant_Activator; - /** * @class Container * @@ -43,25 +41,16 @@ namespace CIAO class CIAO_SERVER_Export Container { public: - enum OA_Type - { - Component, - Facet_Consumer - }; - Container (CORBA::ORB_ptr o); virtual ~Container (void) = 0; - /// Get component's POA. - /** - * This operation does *NOT* increase the reference count of the - * POA. Look at the const qualifier in the method. - */ - PortableServer::POA_ptr the_POA (void) const; + /// Get the containing POA. This operation does *NOT* + /// increase the reference count of the POA. + virtual PortableServer::POA_ptr _ciao_the_POA (void); /// Get a reference to the underlying ORB. - CORBA::ORB_ptr the_ORB (void) const; + virtual CORBA::ORB_ptr _ciao_the_ORB (void); /// Initialize the container with a name. virtual int init (const char *name = 0, @@ -88,25 +77,14 @@ namespace CIAO // Uninstall a servant for component. virtual void uninstall_component (::Components::CCMObject_ptr objref, - PortableServer::ObjectId_out oid - ACE_ENV_ARG_DECL_WITH_DEFAULTS) + PortableServer::ObjectId_out oid + ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)) = 0; - protected: CORBA::ORB_var orb_; - /// POA within which all the components in this container will be - /// activated. - PortableServer::POA_var component_poa_; - - /// POA within which all the facets and receptacles will be - /// activated. - /** - * Having two POA's allows us to associate different policies that - * are distinct from the component. - */ - PortableServer::POA_var facet_cons_poa_; + PortableServer::POA_var poa_; }; class Session_Container; @@ -115,10 +93,7 @@ namespace CIAO typedef ::PortableServer::Servant (*ServantFactory) (::Components::HomeExecutorBase_ptr p, ::CIAO::Session_Container *c -#if !defined (TAO_HAS_EXCEPTIONS) || defined (ACE_ENV_BKWD_COMPAT) - , CORBA::Environment & -#endif - ); + ACE_ENV_ARG_DECL_WITH_DEFAULTS); typedef ACE_Hash_Map_Manager_Ex<ACE_CString, HomeFactory, @@ -149,8 +124,9 @@ namespace CIAO // It appears to be a boolean value. Please use bool // instead. Session_Container (CORBA::ORB_ptr o, - bool static_config_flag = false, - const Static_Config_EntryPoints_Maps* static_entrypts_maps =0); + int static_config_flag =0, + const Static_Config_EntryPoints_Maps* static_entrypts_maps =0 + ); virtual ~Session_Container (void); @@ -158,7 +134,6 @@ namespace CIAO virtual int init (const char *name = 0, const CORBA::PolicyList *more_policies = 0 ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); /** @@ -190,13 +165,12 @@ namespace CIAO // Uninstall a servant for component. virtual void uninstall_component (::Components::CCMObject_ptr objref, - PortableServer::ObjectId_out oid - ACE_ENV_ARG_DECL_WITH_DEFAULTS) + PortableServer::ObjectId_out oid + ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); // Install a servant for component or home. - CORBA::Object_ptr install_servant (PortableServer::Servant p, - Container::OA_Type t + CORBA::Object_ptr install_servant (PortableServer::Servant p ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); @@ -212,44 +186,15 @@ namespace CIAO ACE_THROW_SPEC ((CORBA::SystemException)); // Uninstall a servant for component or home. - void uninstall (CORBA::Object_ptr objref, - Container::OA_Type t + void uninstall (CORBA::Object_ptr objref ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); // Uninstall a servant for component or home. - void uninstall (PortableServer::Servant svt, - Container::OA_Type t + void uninstall (PortableServer::Servant svt ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); - // Analog of the POA method that creates an object reference from - // an object id string. - CORBA::Object_ptr generate_reference (const char *obj_id, - const char *repo_id, - Container::OA_Type t - ACE_ENV_ARG_DECL); - - /// Return the servant activator factory that activates the - /// servants for facets and consumers. - Servant_Activator *ports_servant_activator (void) const; - - private: - - /// Create POA for the component. - /** - * This is the POA that is returned to the component applications - * if they need one. - */ - void create_component_POA (const char *name, - const CORBA::PolicyList *p, - PortableServer::POA_ptr root - ACE_ENV_ARG_DECL); - - /// Create POA for the facets and consumers alone. - void create_facet_consumer_POA (PortableServer::POA_ptr root - ACE_ENV_ARG_DECL); - protected: long number_; @@ -259,12 +204,8 @@ namespace CIAO // boolean value. Please use bool instead. // // It looks like it can also be declared const, as well. - bool static_config_flag_; + int static_config_flag_; const Static_Config_EntryPoints_Maps* static_entrypts_maps_; - - /// The servant activator factory used to activate facets and - /// consumer servants. - Servant_Activator *sa_; }; } @@ -277,7 +218,7 @@ namespace CIAO { \ CORBA::ValueFactory factory = new FACTORY; \ CORBA::ORB_ptr orb = \ - this->context_->_ciao_the_Container ()->the_ORB (); \ + this->context_->_ciao_the_Container ()->_ciao_the_ORB (); \ CORBA::ValueFactory prev_factory = \ orb->register_value_factory ( \ VALUETYPE::_tao_obv_static_repository_id (), \ diff --git a/TAO/CIAO/DAnCE/ciao/Container_Base.inl b/TAO/CIAO/DAnCE/ciao/Container_Base.inl index 0d6aeef9bcc..5435a481075 100644 --- a/TAO/CIAO/DAnCE/ciao/Container_Base.inl +++ b/TAO/CIAO/DAnCE/ciao/Container_Base.inl @@ -5,12 +5,6 @@ CIAO::Session_Container::get_objref (PortableServer::Servant p ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { - return this->the_POA ()->servant_to_reference (p - ACE_ENV_ARG_PARAMETER); -} - -ACE_INLINE CIAO::Servant_Activator * -CIAO::Session_Container::ports_servant_activator (void) const -{ - return this->sa_; + return this->_ciao_the_POA ()->servant_to_reference (p + ACE_ENV_ARG_PARAMETER); } diff --git a/TAO/CIAO/DAnCE/ciao/Servant_Impl_Base.cpp b/TAO/CIAO/DAnCE/ciao/Servant_Impl_Base.cpp index fccbf855572..16bfc99c407 100644 --- a/TAO/CIAO/DAnCE/ciao/Servant_Impl_Base.cpp +++ b/TAO/CIAO/DAnCE/ciao/Servant_Impl_Base.cpp @@ -1,8 +1,6 @@ // $Id$ #include "Servant_Impl_Base.h" -#include "StandardConfigurator_Impl.h" -#include "Container_Base.h" namespace CIAO { @@ -15,347 +13,6 @@ namespace CIAO { } - // Operations for CCMObject interface. - - ::Components::PrimaryKeyBase * - Servant_Impl_Base::get_primary_key ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - ::Components::NoKeyAvailable)) - { - ACE_THROW_RETURN (::Components::NoKeyAvailable (), 0); - - return 0; - } - - CORBA::IRObject_ptr - Servant_Impl_Base::get_component_def ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), - CORBA::IRObject::_nil ()); - } - - void - Servant_Impl_Base::configuration_complete ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidConfiguration)) - { - // CIAO to-do - } - - void - Servant_Impl_Base::remove ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::RemoveFailure)) - { - // CIAO to-do - } - - ::Components::ConnectionDescriptions * - Servant_Impl_Base::get_connections ( - const char * /* name */ - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)) - { - ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); - } - - ::Components::ComponentPortDescription * - Servant_Impl_Base::get_all_ports ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - OBV_Components::ComponentPortDescription *cps = 0; - ACE_NEW_RETURN (cps, - OBV_Components::ComponentPortDescription, - 0); - ::Components::ComponentPortDescription_var retv = cps; - - ::Components::FacetDescriptions_var facets_desc = - this->get_all_facets (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - ::Components::ReceptacleDescriptions_var receptacle_desc = - this->get_all_receptacles (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - ::Components::ConsumerDescriptions_var consumer_desc = - this->get_all_consumers (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - ::Components::EmitterDescriptions_var emitter_desc = - this->get_all_emitters (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - ::Components::PublisherDescriptions_var publisher_desc = - this->get_all_publishers (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - retv->facets (facets_desc.in ()); - retv->receptacles (receptacle_desc.in ()); - retv->consumers (consumer_desc.in ()); - retv->emitters (emitter_desc.in ()); - retv->publishers (publisher_desc.in ()); - - return retv._retn (); - } - - CORBA::Object_ptr - Servant_Impl_Base::provide_facet ( - const char *name - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)) - { - if (name == 0) - { - ACE_THROW_RETURN (Components::InvalidName (), - CORBA::Object::_nil ()); - } - - CORBA::Object_ptr retval = this->lookup_facet (name); - - if (CORBA::is_nil (retval)) - { - ACE_THROW_RETURN (Components::InvalidName (), - CORBA::Object::_nil ()); - } - - return retval; - } - - Components::FacetDescriptions * - Servant_Impl_Base::get_named_facets ( - const ::Components::NameList & names - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)) - { - Components::FacetDescriptions *retval = 0; - ACE_NEW_RETURN (retval, - ::Components::FacetDescriptions, - 0); - Components::FacetDescriptions_var safe_retval = retval; - CORBA::ULong len = names.length (); - safe_retval->length (len); - ::Components::FacetDescription *tmp = 0; - - for (CORBA::ULong i = 0; i < len; ++i) - { - tmp = this->lookup_facet_description (names[i].in ()); - - if (tmp == 0) - { - ACE_THROW_RETURN (Components::InvalidName (), - 0); - } - - safe_retval[i] = tmp; - } - - return safe_retval._retn (); - } - - ::Components::FacetDescriptions * - Servant_Impl_Base::get_all_facets ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ::Components::FacetDescriptions *tmp = 0; - ACE_NEW_RETURN (tmp, - ::Components::FacetDescriptions, - 0); - - ::Components::FacetDescriptions_var retval = tmp; - - retval->length (this->facet_table_.current_size ()); - CORBA::ULong i = 0; - - for (FacetTable::iterator iter = this->facet_table_.begin (); - iter != this->facet_table_.end (); - ++iter, ++i) - { - FacetTable::ENTRY & entry = *iter; - retval[i] = entry.int_id_; - } - - return retval._retn (); - } - - ::Components::ConsumerDescriptions * - Servant_Impl_Base::get_all_consumers ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ::Components::ConsumerDescriptions *tmp = 0; - ACE_NEW_RETURN (tmp, - ::Components::ConsumerDescriptions, - 0); - - ::Components::ConsumerDescriptions_var retval = tmp; - - retval->length (this->consumer_table_.current_size ()); - CORBA::ULong i = 0; - - for (ConsumerTable::iterator iter = this->consumer_table_.begin (); - iter != this->consumer_table_.end (); - ++iter, ++i) - { - ConsumerTable::ENTRY & entry = *iter; - retval[i] = entry.int_id_; - } - - return retval._retn (); - } - - ::Components::EventConsumerBase_ptr - Servant_Impl_Base::get_consumer ( - const char *sink_name - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)) - { - if (sink_name == 0) - { - ACE_THROW_RETURN (Components::InvalidName (), - Components::EventConsumerBase::_nil ()); - } - - Components::EventConsumerBase_ptr retval = - this->lookup_consumer (sink_name); - - if (CORBA::is_nil (retval)) - { - ACE_THROW_RETURN (Components::InvalidName (), - Components::EventConsumerBase::_nil ()); - } - - return retval; - } - - ::Components::EventConsumerBase_ptr - Servant_Impl_Base::disconnect_consumer ( - const char * /* source_name */ - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName, - Components::NoConnection)) - { - ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); - } - - ::Components::ConsumerDescriptions * - Servant_Impl_Base::get_named_consumers ( - const ::Components::NameList & names - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)) - { - Components::ConsumerDescriptions *retval = 0; - ACE_NEW_RETURN (retval, - ::Components::ConsumerDescriptions, - 0); - Components::ConsumerDescriptions_var safe_retval = retval; - CORBA::ULong len = names.length (); - safe_retval->length (len); - ::Components::ConsumerDescription *tmp = 0; - - for (CORBA::ULong i = 0; i < len; ++i) - { - tmp = this->lookup_consumer_description (names[i].in ()); - - if (tmp == 0) - { - ACE_THROW_RETURN (Components::InvalidName (), - 0); - } - - safe_retval[i] = tmp; - } - - return safe_retval._retn (); - } - - ::Components::EmitterDescriptions * - Servant_Impl_Base::get_all_emitters ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); - } - - ::Components::EmitterDescriptions * - Servant_Impl_Base::get_named_emitters ( - const ::Components::NameList & /* names */ - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)) - { - ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); - } - - ::Components::ReceptacleDescriptions * - Servant_Impl_Base::get_all_receptacles ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); - } - - ::Components::ReceptacleDescriptions * - Servant_Impl_Base::get_named_receptacles ( - const ::Components::NameList & /* names */ - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)) - { - ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); - } - - ::Components::PublisherDescriptions * - Servant_Impl_Base::get_all_publishers ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); - } - - ::Components::PublisherDescriptions * - Servant_Impl_Base::get_named_publishers ( - const ::Components::NameList & /* names */ - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)) - { - ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); - } - - /// Protected operations. - void Servant_Impl_Base::add_facet (const char *port_name, CORBA::Object_ptr port_ref) @@ -374,32 +31,6 @@ namespace CIAO safe._retn (); } } - - CORBA::Object_ptr - Servant_Impl_Base::lookup_facet (const char *port_name) - { - ::Components::FacetDescription_var fd; - - if (this->facet_table_.find (port_name, fd) != 0) - { - return CORBA::Object::_nil (); - } - - return CORBA::Object::_duplicate (fd.in ()->facet_ref ()); - } - - ::Components::FacetDescription * - Servant_Impl_Base::lookup_facet_description (const char *port_name) - { - ::Components::FacetDescription_var fd; - - if (this->facet_table_.find (port_name, fd) != 0) - { - return 0; - } - - return fd._retn (); - } void Servant_Impl_Base::add_consumer ( @@ -421,60 +52,4 @@ namespace CIAO safe._retn (); } } - - ::Components::EventConsumerBase_ptr - Servant_Impl_Base::lookup_consumer (const char *port_name) - { - ::Components::ConsumerDescription_var cd; - - if (this->consumer_table_.find (port_name, cd) != 0) - { - return ::Components::EventConsumerBase::_nil (); - } - - return - ::Components::EventConsumerBase::_duplicate (cd.in ()->consumer ()); - } - - ::Components::ConsumerDescription * - Servant_Impl_Base::lookup_consumer_description ( - const char *port_name - ) - { - ::Components::ConsumerDescription_var cd; - - if (this->consumer_table_.find (port_name, cd) != 0) - { - return 0; - } - - return cd._retn (); - } - - Components::StandardConfigurator* - Servant_Impl_Base::get_standard_configurator ( - ACE_ENV_SINGLE_ARG_DECL) - { - // Create the configurator servant. - StandardConfigurator_Impl *config_impl = 0; - - ACE_NEW_THROW_EX (config_impl, - StandardConfigurator_Impl (this), - CORBA::NO_MEMORY ()); - - - Components::StandardConfigurator_var configurator = - config_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (Components::StandardConfigurator::_nil ()); - - return configurator._retn (); - } - - PortableServer::POA_ptr - Servant_Impl_Base::_default_POA ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - { - return - PortableServer::POA::_duplicate (container_->the_POA ()); - } } diff --git a/TAO/CIAO/DAnCE/ciao/Servant_Impl_Base.h b/TAO/CIAO/DAnCE/ciao/Servant_Impl_Base.h index 272fa8f3d5a..ea854dbde26 100644 --- a/TAO/CIAO/DAnCE/ciao/Servant_Impl_Base.h +++ b/TAO/CIAO/DAnCE/ciao/Servant_Impl_Base.h @@ -27,7 +27,6 @@ #include "CCM_EventC.h" #include "CIAO_Server_Export.h" -#include "CCM_ComponentS.h" namespace CIAO { @@ -42,150 +41,19 @@ namespace CIAO * Servant_Impl. */ class CIAO_SERVER_Export Servant_Impl_Base - : public virtual POA_Components::CCMObject { public: Servant_Impl_Base (Session_Container * c); virtual ~Servant_Impl_Base (void); - /// Operations for CCMObject interface. - - virtual ::Components::PrimaryKeyBase * - get_primary_key (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::NoKeyAvailable)); - - virtual CORBA::IRObject_ptr - get_component_def (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void - configuration_complete (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidConfiguration)); - - virtual void - remove (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::RemoveFailure)); - - virtual ::Components::ConnectionDescriptions * - get_connections (const char *name - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)); - - virtual ::Components::ComponentPortDescription * - get_all_ports (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual CORBA::Object_ptr - provide_facet (const char *name - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)); - - virtual ::Components::FacetDescriptions * - get_named_facets (const ::Components::NameList & names - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)); - - virtual ::Components::FacetDescriptions * - get_all_facets (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual ::Components::ConsumerDescriptions * - get_all_consumers (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual ::Components::EventConsumerBase_ptr - get_consumer (const char *sink_name - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)); - - virtual ::Components::EventConsumerBase_ptr - disconnect_consumer (const char *source_name - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName, - Components::NoConnection)); - - virtual ::Components::ConsumerDescriptions * - get_named_consumers (const ::Components::NameList & names - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)); - - virtual ::Components::EmitterDescriptions * - get_all_emitters (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual ::Components::EmitterDescriptions * - get_named_emitters (const ::Components::NameList & /* names */ - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)); - - virtual ::Components::ReceptacleDescriptions * - get_all_receptacles (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual ::Components::ReceptacleDescriptions * - get_named_receptacles (const ::Components::NameList & /* names */ - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)); - - virtual ::Components::PublisherDescriptions * - get_all_publishers (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual ::Components::PublisherDescriptions * - get_named_publishers (const ::Components::NameList & names - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)); - - /// Operation to set attributes on the component. - virtual void set_attributes (const Components::ConfigValues &descr - ACE_ENV_ARG_DECL) = 0; - - // Creates and returns the StandardConfigurator for the component. - virtual Components::StandardConfigurator *get_standard_configurator ( - ACE_ENV_SINGLE_ARG_DECL - ); - - /// Override that returns the (passed-in) default POA of our member - /// component's container, to ensure that we get registered - /// to that POA when _this() is called. - virtual PortableServer::POA_ptr _default_POA ( - ACE_ENV_SINGLE_ARG_DECL - ); - protected: void add_facet (const char *port_name, CORBA::Object_ptr port_ref); - CORBA::Object_ptr lookup_facet (const char *port_name); - - ::Components::FacetDescription *lookup_facet_description ( - const char *port_name - ); - void add_consumer (const char *port_name, ::Components::EventConsumerBase_ptr port_ref); - - ::Components::EventConsumerBase_ptr lookup_consumer ( - const char *port_name - ); - - ::Components::ConsumerDescription *lookup_consumer_description ( - const char *port_name - ); - + protected: typedef ACE_Hash_Map_Manager_Ex<const char *, ::Components::FacetDescription_var, diff --git a/TAO/CIAO/DAnCE/ciao/Servant_Impl_T.cpp b/TAO/CIAO/DAnCE/ciao/Servant_Impl_T.cpp index 4e39010461f..443aab29064 100644 --- a/TAO/CIAO/DAnCE/ciao/Servant_Impl_T.cpp +++ b/TAO/CIAO/DAnCE/ciao/Servant_Impl_T.cpp @@ -26,200 +26,68 @@ namespace CIAO typename CONTEXT> Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, CONTEXT>::~Servant_Impl (void) { - ACE_TRY_NEW_ENV - { - ::Components::SessionComponent_var scom = - ::Components::SessionComponent::_narrow ( - this->executor_.in () - ACE_ENV_ARG_PARAMETER - ); - ACE_TRY_CHECK; - - if (! ::CORBA::is_nil (scom.in ())) - { - scom->ccm_remove (ACE_ENV_SINGLE_ARG_PARAMETER); - } - } - ACE_CATCHANY - { - } - ACE_ENDTRY; - - this->context_->_remove_ref (); - } - - // Operations for CCMObject interface. - - template <typename BASE_SKEL, - typename EXEC, - typename EXEC_VAR, - typename CONTEXT> - CORBA::Boolean - Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, CONTEXT>::same_component ( - CORBA::Object_ptr object_ref - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - if (::CORBA::is_nil (object_ref)) - { - ACE_THROW_RETURN (::CORBA::BAD_PARAM (), 0); - } - - ::CORBA::Object_var the_other = - object_ref->_get_component (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - ::CORBA::Object_var me = - this->context_->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - return me->_is_equivalent (the_other.in () - ACE_ENV_ARG_PARAMETER); } template <typename BASE_SKEL, typename EXEC, typename EXEC_VAR, typename CONTEXT> - ::Components::CCMHome_ptr - Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, CONTEXT>::get_ccm_home ( - ACE_ENV_SINGLE_ARG_DECL + ::Components::FacetDescriptions * + Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, CONTEXT>::get_all_facets ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED ) ACE_THROW_SPEC ((CORBA::SystemException)) { - return this->context_->get_CCM_home (ACE_ENV_SINGLE_ARG_PARAMETER); - } + ::Components::FacetDescriptions *tmp = 0; + ACE_NEW_RETURN (tmp, + ::Components::FacetDescriptions, + 0); - template <typename BASE_SKEL, - typename EXEC, - typename EXEC_VAR, - typename CONTEXT> - CORBA::Object_ptr - Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, CONTEXT>::_get_component ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ::Components::SessionContext_var sc = - ::Components::SessionContext::_narrow ( - this->context_ - ACE_ENV_ARG_PARAMETER - ); - ACE_CHECK_RETURN (::CORBA::Object::_nil ()); + ::Components::FacetDescriptions_var retval = tmp; - if (! ::CORBA::is_nil (sc.in ())) - { - return sc->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); - } + retval->length (this->facet_table_.current_size ()); + CORBA::ULong i = 0; - ::Components::EntityContext_var ec = - ::Components::EntityContext::_narrow ( - this->context_ - ACE_ENV_ARG_PARAMETER - ); - ACE_CHECK_RETURN (::CORBA::Object::_nil ()); - - if (! ::CORBA::is_nil (ec.in ())) + for (FacetTable::iterator iter = this->facet_table_.begin (); + iter != this->facet_table_.end (); + ++iter, ++i) { - return ec->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); + FacetTable::ENTRY & entry = *iter; + retval[i] = entry.int_id_; } - ACE_THROW_RETURN (CORBA::INTERNAL (), - ::CORBA::Object::_nil ()); + return retval._retn (); } - // CIAO-specific operations. - template <typename BASE_SKEL, typename EXEC, typename EXEC_VAR, typename CONTEXT> - void - Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, CONTEXT>::ciao_preactivate ( - ACE_ENV_SINGLE_ARG_DECL + ::Components::ConsumerDescriptions * + Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, CONTEXT>::get_all_consumers ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED ) ACE_THROW_SPEC ((CORBA::SystemException)) { - ::Components::SessionComponent_var temp = - ::Components::SessionComponent::_narrow ( - this->executor_.in () - ACE_ENV_ARG_PARAMETER - ); - ACE_CHECK; + ::Components::ConsumerDescriptions *tmp = 0; + ACE_NEW_RETURN (tmp, + ::Components::ConsumerDescriptions, + 0); - if (! ::CORBA::is_nil (temp.in ())) - { - temp->ciao_preactivate (ACE_ENV_SINGLE_ARG_PARAMETER); - } - } + ::Components::ConsumerDescriptions_var retval = tmp; - template <typename BASE_SKEL, - typename EXEC, - typename EXEC_VAR, - typename CONTEXT> - void - Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, CONTEXT>::ciao_activate ( - ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ::Components::SessionComponent_var temp = - ::Components::SessionComponent::_narrow ( - this->executor_.in () - ACE_ENV_ARG_PARAMETER - ); - ACE_CHECK; + retval->length (this->consumer_table_.current_size ()); + CORBA::ULong i = 0; - if (! ::CORBA::is_nil (temp.in ())) + for (ConsumerTable::iterator iter = this->consumer_table_.begin (); + iter != this->consumer_table_.end (); + ++iter, ++i) { - temp->ccm_activate (ACE_ENV_SINGLE_ARG_PARAMETER); + ConsumerTable::ENTRY & entry = *iter; + retval[i] = entry.int_id_; } - } - template <typename BASE_SKEL, - typename EXEC, - typename EXEC_VAR, - typename CONTEXT> - void - Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, CONTEXT>::ciao_postactivate ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ::Components::SessionComponent_var temp = - ::Components::SessionComponent::_narrow ( - this->executor_.in () - ACE_ENV_ARG_PARAMETER - ); - ACE_CHECK; - - if (! ::CORBA::is_nil (temp.in ())) - { - temp->ciao_postactivate (ACE_ENV_SINGLE_ARG_PARAMETER); - } - } - - template <typename BASE_SKEL, - typename EXEC, - typename EXEC_VAR, - typename CONTEXT> - void - Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, CONTEXT>::_ciao_passivate ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ::Components::SessionComponent_var temp = - ::Components::SessionComponent::_narrow ( - this->executor_.in () - ACE_ENV_ARG_PARAMETER - ); - ACE_CHECK; - - if (! ::CORBA::is_nil (temp.in ())) - { - temp->ccm_passivate (ACE_ENV_SINGLE_ARG_PARAMETER); - } + return retval._retn (); } } diff --git a/TAO/CIAO/DAnCE/ciao/Servant_Impl_T.h b/TAO/CIAO/DAnCE/ciao/Servant_Impl_T.h index 45f223f57b5..af8f19a0eb2 100644 --- a/TAO/CIAO/DAnCE/ciao/Servant_Impl_T.h +++ b/TAO/CIAO/DAnCE/ciao/Servant_Impl_T.h @@ -43,48 +43,21 @@ namespace CIAO typename EXEC_VAR, typename CONTEXT> class Servant_Impl : public virtual BASE_SKEL, - public virtual Servant_Impl_Base + public Servant_Impl_Base { public: - Servant_Impl (EXEC * exe, + Servant_Impl (EXEC * exe, Session_Container * c); - virtual ~Servant_Impl (void); - // Operations for CCMObject interface. - - virtual CORBA::Boolean - same_component (CORBA::Object_ptr object_ref - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual ::Components::CCMHome_ptr - get_ccm_home (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual CORBA::Object_ptr - _get_component (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - // CIAO-specific operations. - - void - ciao_preactivate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void - ciao_activate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + virtual ::Components::FacetDescriptions * + get_all_facets (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); - - void - ciao_postactivate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + + virtual ::Components::ConsumerDescriptions * + get_all_consumers (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); - - /// @@NOTE: The busted operation. - void - _ciao_passivate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - + protected: EXEC_VAR executor_; |