[Ace-users] Re: [ciao-users] Strange behavior of components
Gan Deng
gan.deng at vanderbilt.edu
Wed Sep 12 21:01:06 CDT 2007
Hi Santos,
> I need your help to solve a strange problem I'm having in my
> application. I have two components of the same type (same
> implementation). The Client component has a valuetype in which I keep
> the attributes I need to copy to the others components of the type
> Component I create after it. So I need to transfer the valuetype field
> values from one component to another component of the same type. For
> that, the Client component has a facet called IStateFacet with the
> methods get_value () and set_value (). get_value returns a valuetype
> ValueData and set_value receives as parameter a valuetype ValueData. I
> have a client code ( TransferValues.cpp) that gets the IStateFacet of
> the source and destination Client components and call get_state in the
> source Client and set_state in the destination component as shown below:
>
> Application::IStateFacet_var state_source_fac =
> client->provide_state_fac();
> Application::IStateFacet_var state_dest_fac =
> new_client->provide_state_fac();
> Application::ValueData_var cli_state = new OBV_Application::ValueData();
> cli_state = state_source_fac->get_state();
> state_dest_fac->set_state(cli_state.in ());
>
> Beside the Client components I have two other components: RateGen and
> LogRecorder. The RateGen and the LogRecorder are connected by event
> source and sink ports. I use the pulse_Generator class to generate
> events to the LogRecorder. When I start the RateGen and LogRecorder they
> work fine. But when I run the TransferValues.cpp the RateGen and
> LogRecorder components get affect somehow that I receive the exception
> "terminate called after throwing an instance of 'CORBA::TRANSIENT'" when
> the "push_timeout" method of RateGen_exec_i is called. I can't
> understand why the set_state method is messing with the operation of
> RateGen and LogRecorder once they are not connected with the Client
> components. If I comment the the line
> "state_dest_fac->set_state(cli_state.in ());" the execution occurs fine.
>
> The implementation of push_timeout is as follows (copied from the
> BasicSP example of CIAO):
>
> void RateGen_exec_i::push_timeout () ///Sending events
> {
> ACE_DEBUG ((LM_DEBUG, "RateGen_exec_i push_timeout begins.\n"));
> Control::TimeOut_var ev = new OBV_Control::TimeOut;
> this->context_->push_timeout (ev.in <http://ev.in> ());
> ACE_DEBUG ((LM_DEBUG, "RateGen_exec_i push_timeout ends.\n"));
> }
>
> I will appreciatte if someone can help me understand what is hapenning.
I read through your email twice and finally understood it ,but I'm not
sure you experienced such strange runtime behavior since it is
impossible to tell without debugging into it. Could you please debug
into the problem with some debugger and see why the exception is thrown
in the first place?
Thanks,
Gan
More information about the Ace-users
mailing list