diff options
author | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-01-13 21:44:53 +0000 |
---|---|---|
committer | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-01-13 21:44:53 +0000 |
commit | 6b8f6ac79517d73fd1b588c5c2c0911cbb64896a (patch) | |
tree | 79cfb148d7a951f907675ebef3bca6e6f8110b2d | |
parent | 25fb70d19f9bd6e2e6df6db2b311fcc58f00a0a0 (diff) | |
download | ATCD-6b8f6ac79517d73fd1b588c5c2c0911cbb64896a.tar.gz |
*** empty log message ***
-rw-r--r-- | TAO/CIAO/ChangeLog | 10 | ||||
-rw-r--r-- | TAO/CIAO/docs/releasenotes.html | 14 | ||||
-rw-r--r-- | TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.cpp | 66 | ||||
-rw-r--r-- | TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.h | 63 | ||||
-rw-r--r-- | TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.inl | 142 | ||||
-rw-r--r-- | TAO/CIAO/docs/templates/Executor.idl | 15 |
6 files changed, 308 insertions, 2 deletions
diff --git a/TAO/CIAO/ChangeLog b/TAO/CIAO/ChangeLog index 5c5d6536447..84f440bad8f 100644 --- a/TAO/CIAO/ChangeLog +++ b/TAO/CIAO/ChangeLog @@ -1,3 +1,13 @@ +Mon Jan 13 15:23:09 2003 Nanbor Wang <nanbor@cs.wustl.edu> + + * docs/templates/Executor.idl: Added meta-code for user-defined + oeprations, factory operations, and finder operations. + + * docs/templates/CIAO_Glue_Session_Template.cpp: + * docs/templates/CIAO_Glue_Session_Template.h: + * docs/templates/CIAO_Glue_Session_Template.inl: Filled in the + rest of the CIDL generated Servant Glue code templates. + Mon Jan 13 11:18:37 2003 Nanbor Wang <nanbor@cs.wustl.edu> * ciao/Component_Base.idl: diff --git a/TAO/CIAO/docs/releasenotes.html b/TAO/CIAO/docs/releasenotes.html index 26b21a22dc5..b031d99bf07 100644 --- a/TAO/CIAO/docs/releasenotes.html +++ b/TAO/CIAO/docs/releasenotes.html @@ -19,6 +19,20 @@ <ol> <li><h3>Latest News</h3> <ul> + <li>Mon Jan 13 2003 - Finished the first round effort to + create a meta-code to describe how the CIDL compiler + should generated the container specific glue code. These + templates are available <a href="templates/">here</a>. + These templates can also be used to help handcrafting the + examples I'm working on. + + <li>Mon Jan 6 2003 - Both Jeff and Boris are working on the + CIDL compiler implementation. + + <li>Tue Dec 24 2002 - Started working a multi-component + handcrafted example in <a + href="../examples/handcrafted/Display/">examples/handcrafted/Display/</a> + <li>Sat Dec 21 2002 - Added *nix Makefiles, MPC specifications and created MPC templates for CIAO clients, component implementations, and server tools.<p> diff --git a/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.cpp b/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.cpp index ada085a8c64..ba9fd00ceab 100644 --- a/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.cpp +++ b/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.cpp @@ -894,3 +894,69 @@ CORBA::Object_ptr return ho._retn (); } + +////////////////////////////////////////////////////////////////// +// Component Home Glue code implementation +////////////////////////////////////////////////////////////////// + +[component name]_ptr +[ciao module name]::[home name]_Servant::_ciao_create_helper (::Components::EnterpriseComponent_ptr c + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CreateFailure)) +{ + CCM_[component name]_var hw = CCM_[component name]::_narrow (com + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + // Acquiring the home reference and pass it to the component servant + CORBA::Object_var hobj= this->container_->get_objref (this + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + ::Components::[home name]_var home = ::Components::[home name]::_narrow (hobj.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + CIAO_[component name]_Servant *svt = new CIAO_[component name]_Servant (hw.in (), + home.in (), + this->container_); + return svt->_ciao_activate_component (ACE_ENV_ARG_PARAMETER); +} + +// Operations for Implicit Home interface +[component name]_ptr +[ciao module name]::[home name]_Servant::create (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CreateFailure)) +{ + if (this->executor_.in () == 0) + ACE_THROW_RETURN (CORBA::INTERNAL (), 0); + + Components::EnterpriseComponent_var com = + this->executor_->create (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + return this->_ciao_create_helper (com + ACE_ENV_ARG_PARAMETER); +} + +// Operations for CCMHome interface +void +[ciao module name]::[home name]_Servant::remove_component (Components::CCMObject_ptr comp + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::RemoveFailure)) +{ + if (CORBA::is_nil (comp)) + ACE_THROW (CORBA::INTERNAL (), 0); // What is the right exception to throw here? + + comp->remove (ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + // Removing the object reference? get the servant from the POA with + // the objref, and call remove() on the component, deactivate the + // component, and then remove-ref the servant? + this->container_->uninstall (comp + ACE_ENV_ARG_PARAMETER); +} diff --git a/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.h b/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.h index 6e83e42eb41..f98d4c62276 100644 --- a/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.h +++ b/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.h @@ -502,7 +502,7 @@ namespace CIAO_GLUE [eventtype]Consumer_var consumes_[consumer name]_; ##end foreach [consumer name] with [eventtype] -}; + }; ////////////////////////////////////////////////////////////////// @@ -516,7 +516,7 @@ namespace CIAO_GLUE public: // Ctor. [home anem]_Servant (CCM_[home name]_ptr exe, - CIAO::Session_Container *c); + CIAO::Session_Container *c); // Dtor. ~[home name]_Servant (void); @@ -524,11 +524,64 @@ namespace CIAO_GLUE // User defined and inherited operations // (Factories, Finders, and explicit operations.) +##foreach [operation] in (all explicit operations in [home basename] including its parents) + + // The operation decl here. + +## end foreach opeartion + +##foreach [factory name] in (all factory operations in [home basename] including its parents) + // for factory operations inherit from parent home(s), they should return + // the corresponding component types their homes manage + [component name]_ptr [factory name] (.... ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + ::Components::CreateFailure, + ....)); +##end foreach [factory name] + +##foreach [finder name] in (all finder operations in [home basename] including its parents) + // for finder operations inherit from parent home(s), they should return + // the corresponding component types their homes manage + [component name]_ptr [finder name] (.... ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::FinderFailure, + ....)); +##end foreach [finder name] + +## if [home name] is a keyless home + // Operations for KeylessHome interface virtual ::Components::CCMObject_ptr create_component (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException, Components::CreateFailure)); +## else [home basename] is keyed home with [key type] + + // We do not support key'ed home at the moment but we might + // as well generate the mapping. + [component name]_ptr create ([key type]_ptr key) + ACE_THROW_SPEC ((CORBA::SystemException, + ::Components::CreationFailure, + ::Components::DuplicateKeyValue, + ::Components::InvalidKey)); + + [component name]_ptr find_by_primary_key ([key type]_ptr key) + ACE_THROW_SPEC ((CORBA::SystemException, + ::Components::FinderFailure, + ::Components::UnknownKeyValue, + ::Components::InvalidKey)); + + void remove ([key type]_ptr key) + ACE_THROW_SPEC ((CORBA::SystemException, + ::Components::RemoveFailure, + ::Components::UnknownKeyValue, + ::Components::InvalidKey)); + + [key type]_ptr get_primary_key ([component name]_ptr comp) + ACE_THROW_SPEC ((CORBA::SystemException)); + +## endif (keyed or keyless home) + // Operations for Implicit Home interface virtual [component name]_ptr create (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException, @@ -545,6 +598,12 @@ namespace CIAO_GLUE Components::RemoveFailure)); protected: + // Helper method for factory operations. + [component name]_ptr _ciao_create_helper (::Components::EnterpriseComponent_ptr c + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CreateFailure)); + // My Executor. CCM_[home name]_var executor_; diff --git a/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.inl b/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.inl index 35c0ce19b6f..799b3daa7a3 100644 --- a/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.inl +++ b/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.inl @@ -465,3 +465,145 @@ ACE_INLINE [eventtype]Consumer_ptr ACE_ENV_ARG_PARAMETER); } ##end foreach [publish name] with [eventtype] + +////////////////////////////////////////////////////////////////// +// Component Home Glue code implementation +////////////////////////////////////////////////////////////////// + +ACE_INLINE +[ciao module name]::[home name]_Servant::[home name]_Servant (CCM_[home name]_ptr exe, + CIAO::Session_Container *c) + : executor_ (CCM_[home name]::_duplicate (exe)), + container_ (c) +{ +} + +ACE_INLINE +[ciao module name]::[home name]_Servant::~[home name]_Servant (void) +{ +} + +##foreach [operation] in (all explicit operations in [home basename] including its parents) + +// The operation impl here. This can simply be relayed to the underlying executor... + +## end foreach opeartion + +##foreach [factory name] in (all factory operations in [home basename] including its parents) +// for factory operations inherit from parent home(s), they should return +// the corresponding component types their homes manage +ACE_INLINE [component name]_ptr +[ciao module name]::[home name]_Servant::[factory name] (.... ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + ::Components::CreateFailure, + ....)) +{ + Components::EnterpriseComponent_var com = + this->executor_->[factory name] (.... ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + return this->create_helper (com ACE_ENV_ARG_PARAMETER); +} +##end foreach [factory name] + +##foreach [finder name] in (all finder operations in [home basename] including its parents) +// for finder operations inherit from parent home(s), they should return +// the corresponding component types their homes manage +ACE_INLINE [component name]_ptr +[ciao module name]::[home name]_Servant::[finder name] (.... ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::FinderFailure, + ....)) +{ + Components::EnterpriseComponent_var com = + this->executor_->[finder name] (.... ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + // Do we create a new object reference referring to the same object, + // or do we try to create a different objref referring to the same object? + return this->create_helper (com ACE_ENV_ARG_PARAMETER); +} +##end foreach [finder name] + +## if [home name] is a keyless home + + // Operations for KeylessHome interface +ACE_INLINE ::Components::CCMObject_ptr +[ciao module name]::[home name]_Servant::create_component (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CreateFailure)) +{ + // Simply forward to the create method. + return this->create (ACE_ENV_SINGLE_ARG_PARAMETER); +} + +## else [home basename] is keyed home with [key type] + + // We do not support key'ed home at the moment but we might + // as well generate the mapping. +ACE_INLINE [component name]_ptr +[ciao module name]::[home name]_Servant::create ([key type]_ptr key) + ACE_THROW_SPEC ((CORBA::SystemException, + ::Components::CreationFailure, + ::Components::DuplicateKeyValue, + ::Components::InvalidKey)) +{ + // @@ TO-DO when we suppor keyed home. + + ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); +} + +ACE_INLINE [component name]_ptr +[ciao module name]::[home name]_Servant::find_by_primary_key ([key type]_ptr key) + ACE_THROW_SPEC ((CORBA::SystemException, + ::Components::FinderFailure, + ::Components::UnknownKeyValue, + ::Components::InvalidKey)) +{ + // @@ TO-DO when we suppor keyed home. + + ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); +} + + +ACE_INLINE void +[ciao module name]::[home name]_Servant::remove ([key type]_ptr key) + ACE_THROW_SPEC ((CORBA::SystemException, + ::Components::RemoveFailure, + ::Components::UnknownKeyValue, + ::Components::InvalidKey)) +{ + // @@ TO-DO when we suppor keyed home. + + ACE_THROW (CORBA::NO_IMPLEMENT ()); +} + +ACE_INLINE [key type]_ptr +[ciao module name]::[home name]_Servant::get_primary_key ([component name]_ptr comp) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + // @@ TO-DO when we suppor keyed home. + + ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); +} + +## endif (keyed or keyless home) + + +// Operations for CCMHome interface +ACE_INLINE ::CORBA::IRObject_ptr +[ciao module name]::[home name]_Servant::get_component_def (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + // @@ TO-DO. Contact IfR? + + ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); +} + +ACE_INLINE CORBA::IRObject_ptr get_home_def (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + // @@ TO-DO. Contact IfR? + + ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); +} diff --git a/TAO/CIAO/docs/templates/Executor.idl b/TAO/CIAO/docs/templates/Executor.idl index 83fe3cb383d..f229f8a40ab 100644 --- a/TAO/CIAO/docs/templates/Executor.idl +++ b/TAO/CIAO/docs/templates/Executor.idl @@ -162,6 +162,21 @@ module [module_name] { , [interface name] ## end foreach [interface name] { +##foreach [operation] in (all explicit operations defined in [home basename]) + + // The operation decl here. + +## end foreach opeartion + +##foreach [factory name] in (all factory operations defined in [home basename]) + ::Enterprise::EnterpriseComponent [factory name] (....) + raise (Components::CreateFailure, ....); +##end foreach [factory name] + +##foreach [finder name] in (all finder operations defined in [home basename]) + ::Enterprise::EnterpriseComponent [finder name] (....) + raise (Components::FinderFailure, ....); +##end foreach [finder name] }; local interface CCM_[home basename]Implicit |