diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2009-12-09 15:58:24 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2009-12-09 15:58:24 +0000 |
commit | c2f7fbe6038d8633872a5bad88edcc75a5cabdf2 (patch) | |
tree | eb132df5a6446216cbba2dccbe15af996fac2b4c | |
parent | ab639f59e1f98eda1efb92b6c04b0290a0710045 (diff) | |
download | ATCD-c2f7fbe6038d8633872a5bad88edcc75a5cabdf2.tar.gz |
Wed Dec 9 15:58:08 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu>
-rw-r--r-- | CIAO/ChangeLog | 18 | ||||
-rw-r--r-- | CIAO/connectors/ami4ccm/examples/Hello/AMI/AMI_exec.cpp | 43 | ||||
-rw-r--r-- | CIAO/connectors/ami4ccm/examples/Hello/AMI/AMI_exec.h | 7 | ||||
-rw-r--r-- | CIAO/connectors/ami4ccm/examples/Hello/Sender/Hello_Sender_exec.cpp | 14 |
4 files changed, 55 insertions, 27 deletions
diff --git a/CIAO/ChangeLog b/CIAO/ChangeLog index f3622cf3735..7a89b0333ac 100644 --- a/CIAO/ChangeLog +++ b/CIAO/ChangeLog @@ -1,14 +1,22 @@ +Wed Dec 9 15:58:08 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> + + * connectors/ami4ccm/examples/Hello/AMI/AMI_exec.h: + * connectors/ami4ccm/examples/Hello/AMI/AMI_exec.cpp: + * connectors/ami4ccm/examples/Hello/Sender/Hello_Sender_exec.cpp: + + Bugfixes. + Tue Dec 8 21:54:06 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> * DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp: Resolved a bug whereby connection endpoints in the original plan would be copied into two separate connections in a child plan. - + * DAnCE/NodeApplication/NodeApplication_Impl.cpp: - Bugfix with connection logic. - + Bugfix with connection logic. + * connectors/ami4ccm/examples/Hello/AMI/AMI.idl: * connectors/ami4ccm/examples/Hello/AMI/AMI_exec.h: * connectors/ami4ccm/examples/Hello/AMI/AMI_exec.cpp: @@ -20,8 +28,8 @@ Tue Dec 8 21:54:06 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> * connectors/ami4ccm/examples/Hello/descriptors/Plan.cdp: * connectors/ami4ccm/examples/Hello/descriptors/run_test.pl: - Ported to new local interface support. - + Ported to new local interface support. + Mon Dec 7 18:21:43 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> * docs/schema/Basic_Deployment_Data.xsd: diff --git a/CIAO/connectors/ami4ccm/examples/Hello/AMI/AMI_exec.cpp b/CIAO/connectors/ami4ccm/examples/Hello/AMI/AMI_exec.cpp index f6c49890d88..1324efdc30d 100644 --- a/CIAO/connectors/ami4ccm/examples/Hello/AMI/AMI_exec.cpp +++ b/CIAO/connectors/ami4ccm/examples/Hello/AMI/AMI_exec.cpp @@ -69,8 +69,7 @@ namespace CIAO_Hello_AMI_AMI_AMI_Impl //============================================================ // Facet Executor Implementation Class: AMI_MyFoo_exec_i //============================================================ - AMI_MyFoo_exec_i::AMI_MyFoo_exec_i ( - ::Hello::MyFoo_ptr receiver_foo) + AMI_MyFoo_exec_i::AMI_MyFoo_exec_i () { // @@TODO: This is all sorts of wrong. We should be using the container ORB. @@ -82,12 +81,6 @@ namespace CIAO_Hello_AMI_AMI_AMI_Impl CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, ACE_TEXT ("AMI_foo_client")); - ami_foo_server_ = ::Hello::MyFoo::_duplicate (receiver_foo); - - if (CORBA::is_nil (ami_foo_server_.in ())) - { - printf ("Server is NIL\n"); - } // Activate POA to handle the call back. CORBA::Object_var poa_object = orb->resolve_initial_references("RootPOA"); @@ -109,14 +102,32 @@ namespace CIAO_Hello_AMI_AMI_AMI_Impl AMI_MyFoo_exec_i::~AMI_MyFoo_exec_i (void) { } - + + void + AMI_MyFoo_exec_i::provide_receiver (::Hello::MyFoo_ptr receiver_foo) + { + ami_foo_server_ = ::Hello::MyFoo::_duplicate (receiver_foo); + + if (CORBA::is_nil (ami_foo_server_.in ())) + { + printf ("Server is NIL\n"); + throw CORBA::BAD_PARAM (); + } + } + // Operations from ::CCM_AMI::AMI_ami_foo - + void AMI_MyFoo_exec_i::sendc_foo ( ::Hello_AMI::AMI_MyFooCallback_ptr ami_handler, const char * in_str) { + if (CORBA::is_nil (ami_foo_server_.in ())) + { + printf ("AMI(FOO) error: ami_foo_server_ reference is nil\n"); + return; + } + printf ("AMI (FOO) :\tsendc_foo <%s>\n", in_str); ::CCM_CORBA_AMI_MyFoo_Impl::AMI_MyFoo_reply_handler* handler = new ::CCM_CORBA_AMI_MyFoo_Impl::AMI_MyFoo_reply_handler (ami_handler); @@ -187,11 +198,13 @@ namespace CIAO_Hello_AMI_AMI_AMI_Impl //============================================================ AMI_exec_i::AMI_exec_i (void) + : myfoo_ (0) { } AMI_exec_i::~AMI_exec_i (void) { + delete myfoo_; } // Supported operations and attributes. @@ -203,7 +216,8 @@ namespace CIAO_Hello_AMI_AMI_AMI_Impl ::Hello_AMI::CCM_AMI_MyFoo_ptr AMI_exec_i::get_perform_asynch_my_foo (void) { - return new AMI_MyFoo_exec_i (receiver_foo_.in ()); + this->myfoo_ = new AMI_MyFoo_exec_i (); + return this->myfoo_; } // Operations from Components::SessionComponent. @@ -223,14 +237,15 @@ namespace CIAO_Hello_AMI_AMI_AMI_Impl void AMI_exec_i::configuration_complete (void) { - /* Your code here. */ + receiver_foo_ = + this->context_->get_connection_my_foo_receiver (); + + this->myfoo_->provide_receiver (receiver_foo_.in ()); } void AMI_exec_i::ccm_activate (void) { - receiver_foo_ = - this->context_->get_connection_my_foo_receiver (); ::CCM_CORBA_AMI_MyFoo_Impl::CORBA_MyFoo_server* foo_srv = new ::CCM_CORBA_AMI_MyFoo_Impl::CORBA_MyFoo_server (receiver_foo_.in ()); printf ("AMI :\tStarting MyFoo CORBA server thread.\n"); diff --git a/CIAO/connectors/ami4ccm/examples/Hello/AMI/AMI_exec.h b/CIAO/connectors/ami4ccm/examples/Hello/AMI/AMI_exec.h index e5c56d9e438..32b8207f526 100644 --- a/CIAO/connectors/ami4ccm/examples/Hello/AMI/AMI_exec.h +++ b/CIAO/connectors/ami4ccm/examples/Hello/AMI/AMI_exec.h @@ -59,9 +59,12 @@ namespace CIAO_Hello_AMI_AMI_AMI_Impl public virtual ::CORBA::LocalObject { public: - AMI_MyFoo_exec_i (::Hello::MyFoo_ptr receiver_foo); + AMI_MyFoo_exec_i (); virtual ~AMI_MyFoo_exec_i (void); + + void provide_receiver (::Hello::MyFoo_ptr receiver_foo); + virtual void sendc_foo ( ::Hello_AMI::AMI_MyFooCallback_ptr ami_handler, @@ -119,6 +122,8 @@ namespace CIAO_Hello_AMI_AMI_AMI_Impl ::Hello_AMI_AMI::CCM_AMI_Context_var context_; ::Hello_AMI::AMI_MyFooCallback_var callback_foo_; ::Hello::MyFoo_var receiver_foo_; + + AMI_MyFoo_exec_i *myfoo_; }; extern "C" AMI_EXEC_Export ::Components::EnterpriseComponent_ptr diff --git a/CIAO/connectors/ami4ccm/examples/Hello/Sender/Hello_Sender_exec.cpp b/CIAO/connectors/ami4ccm/examples/Hello/Sender/Hello_Sender_exec.cpp index 15c66c77a5f..960f80fb361 100644 --- a/CIAO/connectors/ami4ccm/examples/Hello/Sender/Hello_Sender_exec.cpp +++ b/CIAO/connectors/ami4ccm/examples/Hello/Sender/Hello_Sender_exec.cpp @@ -190,17 +190,17 @@ namespace CIAO_Hello_AMI_Sender_Impl else { printf ("Sender (ASYNCH) :\tInvoke Asynchronous calls\n"); - my_foo_ami_->sendc_foo (0, "Do something asynchronous"); - my_foo_ami_->sendc_hello (0); - my_foo_ami_->sendc_get_rw_attrib(0); - my_foo_ami_->sendc_set_rw_attrib(0, 15); - my_foo_ami_->sendc_get_ro_attrib(0); + my_foo_ami_->sendc_foo (new MyFoo_callback_exec_i (), "Do something asynchronous"); + my_foo_ami_->sendc_hello (new MyFoo_callback_exec_i ()); + my_foo_ami_->sendc_get_rw_attrib(new MyFoo_callback_exec_i ()); + my_foo_ami_->sendc_set_rw_attrib(new MyFoo_callback_exec_i (), 15); + my_foo_ami_->sendc_get_ro_attrib(new MyFoo_callback_exec_i ()); printf ("Sender (ASYNCH) :\tInvoked Asynchronous calls\n"); } } printf ("Sender (ASYNCH) :\tInvoke Asynchronous calls to test except handling\n"); - my_foo_ami_->sendc_foo (0, ""); - my_foo_ami_->sendc_set_rw_attrib(0, 0); + my_foo_ami_->sendc_foo (new MyFoo_callback_exec_i (), ""); + my_foo_ami_->sendc_set_rw_attrib(new MyFoo_callback_exec_i (), 0); printf ("Sender (ASYNCH) :\tInvoked Asynchronous call.\n"); return 0; } |