summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2005-01-25 20:46:50 +0000
committerjai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2005-01-25 20:46:50 +0000
commit23af6abc53338ebfc0d16119a46c5b2eba34a2af (patch)
tree8e13a8e09f8860cefd5f401e2c136ac09031ee6e
parentaf3bf20bf67fc328497450178ed617cb169b1a2c (diff)
downloadATCD-23af6abc53338ebfc0d16119a46c5b2eba34a2af.tar.gz
*** empty log message ***
-rw-r--r--TAO/CIAO/DAnCE/ciao/Dynamic_Component_Servant_T.cpp6
-rw-r--r--TAO/CIAO/DAnCE/ciao/Servant_Impl_T.cpp34
-rw-r--r--TAO/CIAO/DAnCE/ciao/Servant_Impl_T.h11
-rw-r--r--TAO/CIAO/DAnCE/examples/Hello/Sender/Sender_exec_1.cpp5
-rw-r--r--TAO/CIAO/DAnCE/examples/Hello/Sender/Sender_exec_2.cpp11
-rw-r--r--TAO/CIAO/DAnCE/examples/Hello/Sender/Sender_svnt.cpp.with-connections156
6 files changed, 204 insertions, 19 deletions
diff --git a/TAO/CIAO/DAnCE/ciao/Dynamic_Component_Servant_T.cpp b/TAO/CIAO/DAnCE/ciao/Dynamic_Component_Servant_T.cpp
index 053cb482d52..6d44811b457 100644
--- a/TAO/CIAO/DAnCE/ciao/Dynamic_Component_Servant_T.cpp
+++ b/TAO/CIAO/DAnCE/ciao/Dynamic_Component_Servant_T.cpp
@@ -97,9 +97,9 @@ namespace CIAO
if (component_removed_ == 1)
{
- svt->ciao_preactivate ();
- svt->ciao_activate ();
- svt->ciao_postactivate ();
+ // svt->ciao_preactivate ();
+ // svt->ciao_activate ();
+ // svt->ciao_postactivate ();
component_removed_ = 0;
}
diff --git a/TAO/CIAO/DAnCE/ciao/Servant_Impl_T.cpp b/TAO/CIAO/DAnCE/ciao/Servant_Impl_T.cpp
index 8805a78d271..2277645ae55 100644
--- a/TAO/CIAO/DAnCE/ciao/Servant_Impl_T.cpp
+++ b/TAO/CIAO/DAnCE/ciao/Servant_Impl_T.cpp
@@ -18,6 +18,9 @@ namespace CIAO
Session_Container * c
)
: Servant_Impl_Base (home, home_servant, c),
+ activated_ (0),
+ pre_activated_ (0),
+ post_activated_ (0),
executor_ (EXEC::_duplicate (exe))
{
}
@@ -172,7 +175,11 @@ namespace CIAO
if (! ::CORBA::is_nil (temp.in ()))
{
- temp->ciao_preactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ if (this->pre_activated_ == 0)
+ {
+ this->pre_activated_ = 1;
+ temp->ciao_preactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
}
}
@@ -194,7 +201,11 @@ namespace CIAO
if (! ::CORBA::is_nil (temp.in ()))
{
- temp->ccm_activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ if (this->activated_ == 0)
+ {
+ this->activated_ = 1;
+ temp->ccm_activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
}
}
@@ -217,7 +228,11 @@ namespace CIAO
if (! ::CORBA::is_nil (temp.in ()))
{
- temp->ciao_postactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ if (this->post_activated_ == 0)
+ {
+ this->post_activated_ = 1;
+ temp->ciao_postactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
}
}
@@ -225,6 +240,19 @@ namespace CIAO
typename EXEC,
typename EXEC_VAR,
typename CONTEXT>
+ CORBA::Boolean
+ Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, CONTEXT>::is_activated (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ return this->pre_activated_;
+ }
+
+ 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
diff --git a/TAO/CIAO/DAnCE/ciao/Servant_Impl_T.h b/TAO/CIAO/DAnCE/ciao/Servant_Impl_T.h
index 19a17a5b33a..246bcdbef35 100644
--- a/TAO/CIAO/DAnCE/ciao/Servant_Impl_T.h
+++ b/TAO/CIAO/DAnCE/ciao/Servant_Impl_T.h
@@ -91,10 +91,19 @@ namespace CIAO
_ciao_passivate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException));
+ CORBA::Boolean
+ is_activated (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
protected:
+
+ CORBA::Boolean activated_;
+ CORBA::Boolean pre_activated_;
+ CORBA::Boolean post_activated_;
+
EXEC_VAR executor_;
- CONTEXT * context_;
+ CONTEXT * context_;
};
}
diff --git a/TAO/CIAO/DAnCE/examples/Hello/Sender/Sender_exec_1.cpp b/TAO/CIAO/DAnCE/examples/Hello/Sender/Sender_exec_1.cpp
index 6d9554e0b62..ba2c3edd5dd 100644
--- a/TAO/CIAO/DAnCE/examples/Hello/Sender/Sender_exec_1.cpp
+++ b/TAO/CIAO/DAnCE/examples/Hello/Sender/Sender_exec_1.cpp
@@ -35,7 +35,7 @@ Sender_Impl::Sender_exec_1_i::get_push_message (ACE_ENV_SINGLE_ARG_DECL_NOT_USED
ACE_THROW_SPEC ((CORBA::SystemException))
{
ACE_DEBUG ((LM_DEBUG,
- "Sender_Impl::Sender_exec.i::get_push_message called\n "));
+ "Sender_Impl::Sender_exec_1_i::get_push_message called\n"));
return ( new Message_Impl_1 (*this) );
}
@@ -110,7 +110,8 @@ Sender_Impl::Sender_exec_1_i::ccm_passivate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
::Components::ConsumerDescriptions_var cons_desc =
sender->get_all_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN (0);
- // ACE_DEBUG ((LM_DEBUG, "length of consumers is %d\n", cons_desc->length ()));
+
+ ACE_DEBUG ((LM_DEBUG, "length of consumers is %d\n", cons_desc->length ()));
this->base_exec_->consumers (cons_desc._retn ());
}
diff --git a/TAO/CIAO/DAnCE/examples/Hello/Sender/Sender_exec_2.cpp b/TAO/CIAO/DAnCE/examples/Hello/Sender/Sender_exec_2.cpp
index 41ce1aa6e2e..8e24cab97c6 100644
--- a/TAO/CIAO/DAnCE/examples/Hello/Sender/Sender_exec_2.cpp
+++ b/TAO/CIAO/DAnCE/examples/Hello/Sender/Sender_exec_2.cpp
@@ -35,7 +35,7 @@ Sender_Impl::Sender_exec_2_i::get_push_message (ACE_ENV_SINGLE_ARG_DECL_NOT_USED
ACE_THROW_SPEC ((CORBA::SystemException))
{
ACE_DEBUG ((LM_DEBUG,
- "Sender_Impl::Sender_exec.i::get_push_message called\n "));
+ "Sender_Impl::Sender_exec_2_i::get_push_message called\n"));
return ( new Message_Impl_2 (*this) );
}
@@ -86,26 +86,17 @@ Sender_Impl::Sender_exec_2_i::ccm_activate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
::Components::ConsumerDescriptions_var c =
this->base_exec_->consumers ();
- ACE_DEBUG ((LM_DEBUG, "i got the consumer list\n"));
-
- ACE_DEBUG ((LM_DEBUG, "length of consumers is %d\n", c->length ()));
-
if (CORBA::is_nil (this->context_.in ()))
ACE_THROW (CORBA::INTERNAL ());
ACE_CHECK;
- ACE_DEBUG ((LM_DEBUG, "obtained the context\n"));
CORBA::Object_var o =
this->context_->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_DEBUG ((LM_DEBUG, "i got the context and the object \n"));
-
Hello::Sender_var sender =
Hello::Sender::_narrow (o.in ()
ACE_ENV_ARG_PARAMETER);
- ACE_DEBUG ((LM_DEBUG, "length of consumers is %d\n", c->length ()));
-
for (CORBA::ULong cnt = 0;
cnt != c->length ();
++cnt)
diff --git a/TAO/CIAO/DAnCE/examples/Hello/Sender/Sender_svnt.cpp.with-connections b/TAO/CIAO/DAnCE/examples/Hello/Sender/Sender_svnt.cpp.with-connections
index e13b182d578..1780118da5a 100644
--- a/TAO/CIAO/DAnCE/examples/Hello/Sender/Sender_svnt.cpp.with-connections
+++ b/TAO/CIAO/DAnCE/examples/Hello/Sender/Sender_svnt.cpp.with-connections
@@ -248,6 +248,18 @@ namespace Sender_Impl
const ::Components::ConfigValues &descr
ACE_ENV_ARG_DECL_NOT_USED)
{
+ if (this->is_activated () == 0)
+ {
+ this->ciao_preactivate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ this->ciao_activate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ this->ciao_postactivate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+
for (CORBA::ULong i = 0;
i < descr.length ();
++i)
@@ -273,6 +285,18 @@ namespace Sender_Impl
ACE_ENV_SINGLE_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
+ if (this->is_activated () == 0)
+ {
+ this->ciao_preactivate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ this->ciao_activate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ this->ciao_postactivate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+
if (! ::CORBA::is_nil (this->provide_push_message_.in ()))
{
return ::Hello::ReadMessage::_duplicate (this->provide_push_message_.in ());
@@ -362,6 +386,18 @@ namespace Sender_Impl
::CORBA::SystemException,
::Components::ExceededConnectionLimit))
{
+ if (this->is_activated () == 0)
+ {
+ this->ciao_preactivate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ this->ciao_activate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ this->ciao_postactivate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+
return this->context_->subscribe_click_out (
c
ACE_ENV_ARG_PARAMETER);
@@ -375,6 +411,18 @@ namespace Sender_Impl
::CORBA::SystemException,
::Components::InvalidConnection))
{
+ if (this->is_activated () == 0)
+ {
+ this->ciao_preactivate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ this->ciao_activate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ this->ciao_postactivate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+
return this->context_->unsubscribe_click_out (
ck
ACE_ENV_ARG_PARAMETER);
@@ -392,6 +440,18 @@ namespace Sender_Impl
::Components::AlreadyConnected,
::Components::ExceededConnectionLimit))
{
+ if (this->is_activated () == 0)
+ {
+ this->ciao_preactivate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ this->ciao_activate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ this->ciao_postactivate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+
// If the component has no receptacles, this will be unused.
ACE_UNUSED_ARG (connection);
@@ -415,6 +475,18 @@ namespace Sender_Impl
::Components::CookieRequired,
::Components::NoConnection))
{
+ if (this->is_activated () == 0)
+ {
+ this->ciao_preactivate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ this->ciao_activate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ this->ciao_postactivate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+
if (name == 0)
{
ACE_THROW_RETURN (
@@ -440,6 +512,18 @@ namespace Sender_Impl
::Components::AlreadyConnected,
::Components::InvalidConnection))
{
+ if (this->is_activated () == 0)
+ {
+ this->ciao_preactivate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ this->ciao_activate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ this->ciao_postactivate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+
if (emitter_name == 0)
{
ACE_THROW (::CORBA::BAD_PARAM ());
@@ -460,6 +544,18 @@ namespace Sender_Impl
::Components::InvalidConnection,
::Components::ExceededConnectionLimit))
{
+ if (this->is_activated () == 0)
+ {
+ this->ciao_preactivate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ this->ciao_activate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ this->ciao_postactivate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+
// Just in case there are no if blocks
ACE_UNUSED_ARG (subscribe);
@@ -499,6 +595,18 @@ namespace Sender_Impl
::Components::InvalidName,
::Components::InvalidConnection))
{
+ if (this->is_activated () == 0)
+ {
+ this->ciao_preactivate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ this->ciao_activate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ this->ciao_postactivate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+
// Just in case there are no if blocks
ACE_UNUSED_ARG (ck);
@@ -527,6 +635,18 @@ namespace Sender_Impl
ACE_THROW_SPEC ((
::CORBA::SystemException))
{
+ if (this->is_activated () == 0)
+ {
+ this->ciao_preactivate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ this->ciao_activate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ this->ciao_postactivate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+
if (name == 0)
{
ACE_THROW_RETURN (
@@ -549,6 +669,18 @@ namespace Sender_Impl
ACE_ENV_SINGLE_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
+ if (this->is_activated () == 0)
+ {
+ this->ciao_preactivate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ this->ciao_activate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ this->ciao_postactivate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+
this->executor_->start (
ACE_ENV_SINGLE_ARG_PARAMETER);
}
@@ -560,6 +692,18 @@ namespace Sender_Impl
ACE_ENV_SINGLE_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
+ if (this->is_activated () == 0)
+ {
+ this->ciao_preactivate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ this->ciao_activate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ this->ciao_postactivate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+
return this->executor_->local_message (
ACE_ENV_SINGLE_ARG_PARAMETER);
}
@@ -570,6 +714,18 @@ namespace Sender_Impl
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
+ if (this->is_activated () == 0)
+ {
+ this->ciao_preactivate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ this->ciao_activate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ this->ciao_postactivate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+
this->executor_->local_message (
local_message
ACE_ENV_ARG_PARAMETER);