diff options
author | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-03-17 04:16:24 +0000 |
---|---|---|
committer | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-03-17 04:16:24 +0000 |
commit | a16d1380475188a59c17b3fbc3108c7cfb3cab19 (patch) | |
tree | 7e2ae736c0ea0d8c08674ed2ca61d38301dfd41d | |
parent | 3d46f3d676cb4a33273fcd1b8f3b29e0df3ee98a (diff) | |
download | ATCD-a16d1380475188a59c17b3fbc3108c7cfb3cab19.tar.gz |
*** empty log message ***
14 files changed, 175 insertions, 10 deletions
diff --git a/TAO/CIAO/ChangeLog b/TAO/CIAO/ChangeLog index b494ffa1ae6..67dcaed73f8 100644 --- a/TAO/CIAO/ChangeLog +++ b/TAO/CIAO/ChangeLog @@ -1,3 +1,25 @@ +Sun Mar 16 21:57:10 2003 Nanbor Wang <nanbor@cs.wustl.edu> + + * docs/templates/CIAO_Glue_Session_Template.h: + * docs/templates/CIAO_Glue_Session_Template.inl: + * examples/handcrafted/Display/GPS/GPS_svnt.h: + * examples/handcrafted/Display/GPS/GPS_svnt.inl: + * examples/handcrafted/Display/NavDisplay/NavDisplay_svnt.h: + * examples/handcrafted/Display/NavDisplay/NavDisplay_svnt.inl: + * examples/handcrafted/Display/RateGen/RateGen_svnt.cpp: + * examples/handcrafted/Display/RateGen/RateGen_svnt.h: + * examples/handcrafted/Display/RateGen/RateGen_svnt.inl: Added + code to support SessionComponent::set_session_context operation + and make sure the Context objects also inherit from + TAO_Local_RefCounted_Object. + + * examples/handcrafted/Hello/helloE.idl: + * examples/handcrafted/Hello/hello_executors.h: + * examples/handcrafted/Hello/hello_servants.cpp: + * examples/handcrafted/Hello/hello_servants.h: Changed to implement + component specific context as a SessionContext, plus the + aforementioned changes. + Sun Mar 16 11:43:20 2003 Nanbor Wang <nanbor@cs.wustl.edu> * docs/ConfigValues.html: diff --git a/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.h b/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.h index 97f85da6811..dae90ae5981 100644 --- a/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.h +++ b/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.h @@ -24,6 +24,7 @@ #include "[idl-name]EC.h" // Source in the executor mapping // that component implementations use #include "ciao/Container_Base.h" //Source in the container interface definitions +#include "tao/LocalObject.h" #include "ace/Active_Map_Manager_T.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) @@ -85,7 +86,8 @@ namespace CIAO_GLUE ////////////////////////////////////////////////////////////////// // Component specific context implementation class [SERVANT]_Export [component name]_Context : - public virtual CCM_[component name]_Context + public virtual CCM_[component name]_Context, + public virtual TAO_Local_RefCounted_Object { public: // We will allow the the servant glue code we generate to access diff --git a/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.inl b/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.inl index 64e5d908865..9c7373f92f8 100644 --- a/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.inl +++ b/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.inl @@ -171,6 +171,26 @@ ACE_INLINE container_ (c) { this->context_ = new [ciao module name]::[component name]_Context (h, c, this); + + ACE_TRY_NEW_ENV + { + Components::SessionComponent_var scom = + Components::SessionComponent::_narrow (exe + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (! CORBA::is_nil (scom.in ())) + { + scom->set_session_context (this->context_ + ACE_ENV_ARG_PARAMETER); + } + } + ACE_CATCHANY + { + // @@ Ignore any exceptions? What happens if + // set_session_context throws an CCMException? + } + ACE_ENDTRY; } ACE_INLINE diff --git a/TAO/CIAO/examples/handcrafted/Display/GPS/GPS_svnt.h b/TAO/CIAO/examples/handcrafted/Display/GPS/GPS_svnt.h index 6c090265564..fbd9c9c808d 100644 --- a/TAO/CIAO/examples/handcrafted/Display/GPS/GPS_svnt.h +++ b/TAO/CIAO/examples/handcrafted/Display/GPS/GPS_svnt.h @@ -24,6 +24,7 @@ #include "GPSEC.h" // Source in the executor mapping // that component implementations use #include "ciao/Container_Base.h" //Source in the container interface definitions +#include "tao/LocalObject.h" #include "ace/Active_Map_Manager_T.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) @@ -44,7 +45,8 @@ namespace CIAO_GLUE_HUDisplay ////////////////////////////////////////////////////////////////// // Component specific context implementation class GPS_SVNT_Export GPS_Context : - public virtual HUDisplay::CCM_GPS_Context + public virtual HUDisplay::CCM_GPS_Context, + public virtual TAO_Local_RefCounted_Object { public: // We will allow the the servant glue code we generate to access diff --git a/TAO/CIAO/examples/handcrafted/Display/GPS/GPS_svnt.inl b/TAO/CIAO/examples/handcrafted/Display/GPS/GPS_svnt.inl index 3cadf2954f3..02747acbd91 100644 --- a/TAO/CIAO/examples/handcrafted/Display/GPS/GPS_svnt.inl +++ b/TAO/CIAO/examples/handcrafted/Display/GPS/GPS_svnt.inl @@ -100,6 +100,26 @@ CIAO_GLUE_HUDisplay::GPS_Servant::GPS_Servant (HUDisplay::CCM_GPS_ptr exe, container_ (c) { this->context_ = new CIAO_GLUE_HUDisplay::GPS_Context (h, c, this); + + ACE_TRY_NEW_ENV + { + Components::SessionComponent_var scom = + Components::SessionComponent::_narrow (exe + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (! CORBA::is_nil (scom.in ())) + { + scom->set_session_context (this->context_ + ACE_ENV_ARG_PARAMETER); + } + } + ACE_CATCHANY + { + // @@ Ignore any exceptions? What happens if + // set_session_context throws an CCMException? + } + ACE_ENDTRY; } ACE_INLINE diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplay/NavDisplay_svnt.h b/TAO/CIAO/examples/handcrafted/Display/NavDisplay/NavDisplay_svnt.h index 000a2e5b782..67416b10b0e 100644 --- a/TAO/CIAO/examples/handcrafted/Display/NavDisplay/NavDisplay_svnt.h +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplay/NavDisplay_svnt.h @@ -24,6 +24,7 @@ #include "NavDisplayEC.h" // Source in the executor mapping // that component implementations use #include "ciao/Container_Base.h" //Source in the container interface definitions +#include "tao/LocalObject.h" #include "ace/Active_Map_Manager_T.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) @@ -42,7 +43,8 @@ namespace CIAO_GLUE_HUDisplay ////////////////////////////////////////////////////////////////// // Component specific context implementation class NAVDISPLAY_SVNT_Export NavDisplay_Context : - public virtual HUDisplay::CCM_NavDisplay_Context + public virtual HUDisplay::CCM_NavDisplay_Context, + public virtual TAO_Local_RefCounted_Object { public: // We will allow the the servant glue code we generate to access diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplay/NavDisplay_svnt.inl b/TAO/CIAO/examples/handcrafted/Display/NavDisplay/NavDisplay_svnt.inl index 99b44f784cc..085bc85e4ce 100644 --- a/TAO/CIAO/examples/handcrafted/Display/NavDisplay/NavDisplay_svnt.inl +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplay/NavDisplay_svnt.inl @@ -100,6 +100,26 @@ CIAO_GLUE_HUDisplay::NavDisplay_Servant::NavDisplay_Servant (HUDisplay::CCM_NavD container_ (c) { this->context_ = new CIAO_GLUE_HUDisplay::NavDisplay_Context (h, c, this); + + ACE_TRY_NEW_ENV + { + Components::SessionComponent_var scom = + Components::SessionComponent::_narrow (exe + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (! CORBA::is_nil (scom.in ())) + { + scom->set_session_context (this->context_ + ACE_ENV_ARG_PARAMETER); + } + } + ACE_CATCHANY + { + // @@ Ignore any exceptions? What happens if + // set_session_context throws an CCMException? + } + ACE_ENDTRY; } ACE_INLINE diff --git a/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGen_svnt.cpp b/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGen_svnt.cpp index da098c4ee4e..fcb6f489528 100644 --- a/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGen_svnt.cpp +++ b/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGen_svnt.cpp @@ -570,7 +570,7 @@ CIAO_GLUE_HUDisplay::RateGenHome_Servant::create (ACE_ENV_SINGLE_ARG_DECL) ACE_CHECK_RETURN (0); return this->_ciao_create_helper (com - ACE_ENV_ARG_PARAMETER); + ACE_ENV_ARG_PARAMETER); } // Operations for CCMHome interface diff --git a/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGen_svnt.h b/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGen_svnt.h index cda3caf507f..2e7c5fb055e 100644 --- a/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGen_svnt.h +++ b/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGen_svnt.h @@ -21,6 +21,7 @@ #include "RateGenEC.h" // Source in the executor mapping // that component implementations use #include "ciao/Container_Base.h" //Source in the container interface definitions +#include "tao/LocalObject.h" #include "ace/Active_Map_Manager_T.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) @@ -32,7 +33,8 @@ namespace CIAO_GLUE_HUDisplay ////////////////////////////////////////////////////////////////// // Component specific context implementation class RATEGEN_SVNT_Export RateGen_Context : - public virtual HUDisplay::CCM_RateGen_Context + public virtual HUDisplay::CCM_RateGen_Context, + public virtual TAO_Local_RefCounted_Object { public: // We will allow the the servant glue code we generate to access diff --git a/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGen_svnt.inl b/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGen_svnt.inl index ad61010e49e..8990e71c950 100644 --- a/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGen_svnt.inl +++ b/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGen_svnt.inl @@ -101,6 +101,26 @@ CIAO_GLUE_HUDisplay::RateGen_Servant::RateGen_Servant (HUDisplay::CCM_RateGen_pt container_ (c) { this->context_ = new CIAO_GLUE_HUDisplay::RateGen_Context (h, c, this); + + ACE_TRY_NEW_ENV + { + Components::SessionComponent_var scom = + Components::SessionComponent::_narrow (exe + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (! CORBA::is_nil (scom.in ())) + { + scom->set_session_context (this->context_ + ACE_ENV_ARG_PARAMETER); + } + } + ACE_CATCHANY + { + // @@ Ignore any exceptions? What happens if + // set_session_context throws an CCMException? + } + ACE_ENDTRY; } ACE_INLINE diff --git a/TAO/CIAO/examples/handcrafted/Hello/helloE.idl b/TAO/CIAO/examples/handcrafted/Hello/helloE.idl index 3a338ef3a7e..d07e3a95677 100644 --- a/TAO/CIAO/examples/handcrafted/Hello/helloE.idl +++ b/TAO/CIAO/examples/handcrafted/Hello/helloE.idl @@ -28,7 +28,7 @@ local interface CCM_HelloWorld }; local interface CCM_HelloWorld_Context - : ::Components::CCMContext + : ::Components::SessionContext { }; diff --git a/TAO/CIAO/examples/handcrafted/Hello/hello_executors.h b/TAO/CIAO/examples/handcrafted/Hello/hello_executors.h index 397802e1d4d..322a89dff48 100644 --- a/TAO/CIAO/examples/handcrafted/Hello/hello_executors.h +++ b/TAO/CIAO/examples/handcrafted/Hello/hello_executors.h @@ -8,7 +8,9 @@ #include "helloEC.h" #include "hello_executors_export.h" -class HelloWorld_Impl : public virtual CCM_HelloWorld +class HelloWorld_Impl : + public virtual CCM_HelloWorld, + public virtual TAO_Local_RefCounted_Object { public: /// Default ctor. @@ -24,7 +26,9 @@ public: )); }; -class HelloHome_Impl : public virtual CCM_HelloHome +class HelloHome_Impl : + public virtual CCM_HelloHome, + public virtual TAO_Local_RefCounted_Object { public: /// Default ctor. diff --git a/TAO/CIAO/examples/handcrafted/Hello/hello_servants.cpp b/TAO/CIAO/examples/handcrafted/Hello/hello_servants.cpp index 964fede30af..9121b602679 100644 --- a/TAO/CIAO/examples/handcrafted/Hello/hello_servants.cpp +++ b/TAO/CIAO/examples/handcrafted/Hello/hello_servants.cpp @@ -20,6 +20,32 @@ CIAO_HelloWorld_Context::~CIAO_HelloWorld_Context () } +// Operations for ::Components::SessionContext interface +CORBA::Object_ptr +CIAO_HelloWorld_Context::get_CCM_object (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::IllegalState)) +{ + // @@ How do I check for IllegalState here? When it's not in a + // callback operation... + // ACE_THROW_RETURN (::Components::IllegalState (), 0); + + if (CORBA::is_nil (this->component_.in ())) + { + CORBA::Object_var obj = this->container_->get_objref (this->servant_ + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + this->component_ = HelloWorld::_narrow (obj.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (CORBA::is_nil (this->component_.in ())) + ACE_THROW_RETURN (CORBA::INTERNAL (), 0); // This should not happen... + } + return HelloWorld::_duplicate (this->component_.in ()); +} + // Operations for HellowWorld attributes, event source, and // receptable defined in CCM_HelloWorld_Context. @@ -88,6 +114,25 @@ CIAO_HelloWorld_Servant::CIAO_HelloWorld_Servant (CCM_HelloWorld_ptr exe, container_ (c) { this->context_ = new CIAO_HelloWorld_Context (h, c, this); + + ACE_TRY_NEW_ENV; + { + Components::SessionComponent_var temp = + Components::SessionComponent::_narrow (exe + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (! CORBA::is_nil (temp.in ())) + { + temp->set_session_context (this->context_.in ()); + } + } + ACE_CATCHANY + { + // @@ Ignore any exceptions? What happens if + // set_session_context throws an CCMException? + } + ACE_ENDTRY; } CIAO_HelloWorld_Servant::~CIAO_HelloWorld_Servant (void) diff --git a/TAO/CIAO/examples/handcrafted/Hello/hello_servants.h b/TAO/CIAO/examples/handcrafted/Hello/hello_servants.h index 02cb8dc18f6..8bfe575cc28 100644 --- a/TAO/CIAO/examples/handcrafted/Hello/hello_servants.h +++ b/TAO/CIAO/examples/handcrafted/Hello/hello_servants.h @@ -24,11 +24,13 @@ #include "helloS.h" #include "helloEC.h" #include "ciao/Container_Base.h" +#include "tao/LocalObject.h" class CIAO_HelloWorld_Servant; class HELLO_SERVANT_Export CIAO_HelloWorld_Context : - public virtual CCM_HelloWorld_Context + public virtual CCM_HelloWorld_Context, + public virtual TAO_Local_RefCounted_Object { public: // Ctor. @@ -64,7 +66,11 @@ public: ACE_THROW_SPEC ((CORBA::SystemException, Components::IllegalState)); - + // Operations for ::Components::SessionContext interface + virtual CORBA::Object_ptr + get_CCM_object (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::IllegalState)); protected: ::Components::CCMHome_var home_; |