diff options
author | kitty <kitty@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-12-03 04:06:55 +0000 |
---|---|---|
committer | kitty <kitty@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-12-03 04:06:55 +0000 |
commit | 664e0d3f52bc756783c81a47989e81fccb227c25 (patch) | |
tree | 8998cbe7a256ea89e992f717c271522781d5b65f | |
parent | 31ed0a579d76c6fc37433f1f2674caf33c990942 (diff) | |
download | ATCD-664e0d3f52bc756783c81a47989e81fccb227c25.tar.gz |
ChangeLogTag:
-rw-r--r-- | ACEXML/compass/Consumer.cpp | 27 | ||||
-rw-r--r-- | ACEXML/compass/Consumer.h | 2 | ||||
-rw-r--r-- | ACEXML/compass/Deployment.cpp | 11 | ||||
-rw-r--r-- | ACEXML/compass/Makefile.Consumer | 4 | ||||
-rw-r--r-- | ACEXML/compass/Makefile.Service | 4 | ||||
-rw-r--r-- | ACEXML/compass/Makefile.Supplier | 4 | ||||
-rw-r--r-- | ACEXML/compass/Service.cpp | 52 | ||||
-rw-r--r-- | ACEXML/compass/Supplier.cpp | 52 | ||||
-rw-r--r-- | ACEXML/compass/Test.cpp | 22 | ||||
-rw-r--r-- | ACEXML/compass/eventchannel.cpf | 2 |
10 files changed, 48 insertions, 132 deletions
diff --git a/ACEXML/compass/Consumer.cpp b/ACEXML/compass/Consumer.cpp index 95a919863ba..d3660daec42 100644 --- a/ACEXML/compass/Consumer.cpp +++ b/ACEXML/compass/Consumer.cpp @@ -15,7 +15,7 @@ createConsumer (int argc, char* argv[]) } Consumer::Consumer (void) - : event_count_ (0), shutdown_ (0) + : event_count_ (0) { } @@ -34,27 +34,9 @@ Consumer::run (int argc, char* argv[]) ACE_DECLARE_NEW_CORBA_ENV; ACE_TRY { - // Prepend a "dummy" program name argument to the Service - // Configurator argument vector. - int new_argc = argc + 1; - - CORBA::StringSeq new_argv (new_argc); - new_argv.length (new_argc); - - // Prevent the ORB from opening the Service Configurator file - // again since the Service Configurator file is already in the - // process of being opened. - new_argv[0] = CORBA::string_dup ("dummy"); - - // Copy the remaining arguments into the new argument vector. - for (int i = new_argc - argc, j = 0; - j < argc; - ++i, ++j) - new_argv[i] = CORBA::string_dup (argv[j]); - // Initialize the ORB. - CORBA::ORB_var orb = CORBA::ORB_init (new_argc, - new_argv.get_buffer (), + CORBA::ORB_var orb = CORBA::ORB_init (argc, + argv, "Consumer" ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; @@ -172,8 +154,7 @@ void Consumer::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { - this->shutdown_ = 1; - this->orb_->destroy (ACE_ENV_ARG_PARAMETER); + this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); } // **************************************************************** diff --git a/ACEXML/compass/Consumer.h b/ACEXML/compass/Consumer.h index 8f9e7738c5d..6338c5c7854 100644 --- a/ACEXML/compass/Consumer.h +++ b/ACEXML/compass/Consumer.h @@ -54,8 +54,6 @@ private: CORBA::ULong event_count_; // Keep track of the number of events received. - CORBA::Boolean shutdown_; - CORBA::ORB_ptr orb_; // The orb, just a pointer because the ORB does not outlive the // run() method... diff --git a/ACEXML/compass/Deployment.cpp b/ACEXML/compass/Deployment.cpp index d256e85c997..ebe206f1b73 100644 --- a/ACEXML/compass/Deployment.cpp +++ b/ACEXML/compass/Deployment.cpp @@ -203,6 +203,12 @@ ACE_TMAIN (int argc, char* argv[]) dsoname.c_str())); return -1; } + else if (ACE_OS::unlink (dsoname.c_str()) < 0) + { + ACE_ERROR ((LM_ERROR, "Unable to unlink local copy %s : %m\n", + dsoname.c_str())); + return -1; + } ACEXML_Char buf[65535]; int bytes = 0; while ((bytes = dll->read (buf, sizeof(buf))) > 0) @@ -270,5 +276,10 @@ ACE_TMAIN (int argc, char* argv[]) ACE_OS::sleep (3); } thr_mgr->wait(); + if (rmdir (temp) < 0) + { + ACE_ERROR ((LM_ERROR, "Unable to cleanup safe temp directory : %m\n")); + return -1; + } return 0; } diff --git a/ACEXML/compass/Makefile.Consumer b/ACEXML/compass/Makefile.Consumer index d30264737cd..bc6b0de80a7 100644 --- a/ACEXML/compass/Makefile.Consumer +++ b/ACEXML/compass/Makefile.Consumer @@ -19,9 +19,9 @@ SHLIB = libConsumer.$(SOEXT) FILES = Consumer LSRC = $(addsuffix .cpp,$(FILES)) -LIBS += -lTAO_RTEvent -lTAO_RTSched -lTAO_CosNaming -lTAO_Svc_Utils -lTAO_IORTable -lTAO_PortableServer -lTAO $(ACELIB) +LIBS += -lTAO_RTEvent -lTAO_RTSched -lTAO_CosNaming -lTAO_Svc_Utils -lTAO_IORTable -lTAO_Messaging -lTAO_PortableServer -lTAO $(ACELIB) -# TAO_ORBSVCS := $(shell sh $(ACE_ROOT)/bin/ace_components --orbsvcs) +TAO_ORBSVCS := $(shell sh $(ACE_ROOT)/bin/ace_components --orbsvcs) CPPFLAGS += -I$(TAO_ROOT) -I$(TAO_ROOT)/orbsvcs \ $(foreach svc, $(TAO_ORBSVCS), -DTAO_ORBSVCS_HAS_$(svc)) diff --git a/ACEXML/compass/Makefile.Service b/ACEXML/compass/Makefile.Service index 42d6662beb8..8822e7056c9 100644 --- a/ACEXML/compass/Makefile.Service +++ b/ACEXML/compass/Makefile.Service @@ -19,9 +19,9 @@ SHLIB = libService.$(SOEXT) FILES = Service LSRC = $(addsuffix .cpp,$(FILES)) -LIBS += -lTAO_RTEvent -lTAO_RTSched -lTAO_CosNaming -lTAO_Svc_Utils -lTAO_IORTable -lTAO_PortableServer -lTAO $(ACELIB) +LIBS += -lTAO_RTEvent -lTAO_RTSched -lTAO_CosNaming -lTAO_Svc_Utils -lTAO_IORTable -lTAO_Messaging -lTAO_PortableServer -lTAO $(ACELIB) -# TAO_ORBSVCS := $(shell sh $(ACE_ROOT)/bin/ace_components --orbsvcs) +TAO_ORBSVCS := $(shell sh $(ACE_ROOT)/bin/ace_components --orbsvcs) CPPFLAGS += -I$(TAO_ROOT) -I$(TAO_ROOT)/orbsvcs \ $(foreach svc, $(TAO_ORBSVCS), -DTAO_ORBSVCS_HAS_$(svc)) diff --git a/ACEXML/compass/Makefile.Supplier b/ACEXML/compass/Makefile.Supplier index 3833725a097..3d03470a3db 100644 --- a/ACEXML/compass/Makefile.Supplier +++ b/ACEXML/compass/Makefile.Supplier @@ -19,9 +19,9 @@ SHLIB = libSupplier.$(SOEXT) FILES = Supplier LSRC = $(addsuffix .cpp,$(FILES)) -LIBS += -lTAO_RTEvent -lTAO_RTSched -lTAO_CosNaming -lTAO_Svc_Utils -lTAO_IORTable -lTAO_PortableServer -lTAO $(ACELIB) +LIBS += -lTAO_RTEvent -lTAO_RTSched -lTAO_CosNaming -lTAO_Svc_Utils -lTAO_IORTable -lTAO_Messaging -lTAO_PortableServer -lTAO $(ACELIB) -# TAO_ORBSVCS := $(shell sh $(ACE_ROOT)/bin/ace_components --orbsvcs) +TAO_ORBSVCS := $(shell sh $(ACE_ROOT)/bin/ace_components --orbsvcs) CPPFLAGS += -I$(TAO_ROOT) -I$(TAO_ROOT)/orbsvcs \ $(foreach svc, $(TAO_ORBSVCS), -DTAO_ORBSVCS_HAS_$(svc)) diff --git a/ACEXML/compass/Service.cpp b/ACEXML/compass/Service.cpp index 9b84ccabde6..249a3d9d063 100644 --- a/ACEXML/compass/Service.cpp +++ b/ACEXML/compass/Service.cpp @@ -53,27 +53,9 @@ Service::run (int argc, char* argv[]) ACE_DECLARE_NEW_CORBA_ENV; ACE_TRY { - // Prepend a "dummy" program name argument to the Service - // Configurator argument vector. - int new_argc = argc + 1; - - CORBA::StringSeq new_argv (new_argc); - new_argv.length (new_argc); - - // Prevent the ORB from opening the Service Configurator file - // again since the Service Configurator file is already in the - // process of being opened. - new_argv[0] = CORBA::string_dup ("dummy"); - - // Copy the remaining arguments into the new argument vector. - for (int i = new_argc - argc, j = 0; - j < argc; - ++i, ++j) - new_argv[i] = CORBA::string_dup (argv[j]); - // Initialize the ORB. - CORBA::ORB_var orb = CORBA::ORB_init (new_argc, - new_argv.get_buffer (), + CORBA::ORB_var orb = CORBA::ORB_init (argc, + argv, "Service" ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; @@ -120,37 +102,11 @@ Service::run (int argc, char* argv[]) naming_client->bind (ec_name, event_channel.in() ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - int done = 0; - // Wait for events, using work_pending()/perform_work() may help // or using another thread, this example is too simple for that. - while (!done) - { - CORBA::Boolean pending = - orb->work_pending (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (pending) - { - orb->perform_work (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_TRY - { - CORBA::Object_var ec_obj = - naming_client->resolve (ec_name - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCH (CosNaming::NamingContext::NotFound, ex) - { - ACE_DEBUG ((LM_DEBUG, "EventChannel has been destroyed\n")); - done = 1; - break; - } - ACE_ENDTRY; - } + ACE_Time_Value tv (90, 0); + orb->run (tv); } ACE_CATCHANY { diff --git a/ACEXML/compass/Supplier.cpp b/ACEXML/compass/Supplier.cpp index 29b240cd4f9..f69970145dc 100644 --- a/ACEXML/compass/Supplier.cpp +++ b/ACEXML/compass/Supplier.cpp @@ -33,27 +33,9 @@ Supplier::run (int argc, char* argv[]) ACE_DECLARE_NEW_CORBA_ENV; ACE_TRY { - // Prepend a "dummy" program name argument to the Service - // Configurator argument vector. - int new_argc = argc + 1; - - CORBA::StringSeq new_argv (new_argc); - new_argv.length (new_argc); - - // Prevent the ORB from opening the Service Configurator file - // again since the Service Configurator file is already in the - // process of being opened. - new_argv[0] = CORBA::string_dup ("dummy"); - - // Copy the remaining arguments into the new argument vector. - for (int i = new_argc - argc, j = 0; - j < argc; - ++i, ++j) - new_argv[i] = CORBA::string_dup (argv[j]); - // Initialize the ORB. - CORBA::ORB_var orb = CORBA::ORB_init (new_argc, - new_argv.get_buffer (), + CORBA::ORB_var orb = CORBA::ORB_init (argc, + argv, "Consumer" ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; @@ -120,7 +102,7 @@ Supplier::run (int argc, char* argv[]) ACE_TRY_CHECK; // Push the events... - ACE_Time_Value sleep_time (0, 30000); // 10 milliseconds + ACE_Time_Value sleep_time (0, 10000); // 10 milliseconds RtecEventComm::EventSet event (1); event.length (1); @@ -136,30 +118,32 @@ Supplier::run (int argc, char* argv[]) } ACE_OS::sleep (3); + naming_client->unbind (ec_name ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + // Disconnect from the EC consumer->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; ACE_DEBUG ((LM_DEBUG, "Push Consumer disconnected\n")); - naming_client->unbind (ec_name ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - // Destroy the EC.... event_channel->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - ACE_DEBUG ((LM_DEBUG, "Destroying the EventChannel\n")); + ACE_DEBUG ((LM_DEBUG, "EventChannel destroyed\n")); // Deactivate this object... - PortableServer::ObjectId_var id = - poa->servant_to_id (this ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; +// PortableServer::ObjectId_var id = +// poa->servant_to_id (this ACE_ENV_ARG_PARAMETER); +// ACE_TRY_CHECK; - // Destroy the POA - poa->destroy (1, 0 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } +// poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER); +// ACE_TRY_CHECK; + +// // Destroy the POA +// poa->destroy (1, 0 ACE_ENV_ARG_PARAMETER); +// ACE_TRY_CHECK; + +} ACE_CATCHANY { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Supplier::run"); diff --git a/ACEXML/compass/Test.cpp b/ACEXML/compass/Test.cpp index 36eb658f6f1..06ee25970a1 100644 --- a/ACEXML/compass/Test.cpp +++ b/ACEXML/compass/Test.cpp @@ -6,7 +6,6 @@ #include "ace/SString.h" #include "tao/ORB_Core.h" -static int myargc = 0; static ACE_ARGV myargv; void* @@ -45,29 +44,21 @@ create_dll (void* name) if (ACE_OS::strcmp (dllname, "Service") == 0) { serviceargv.add (myargv.argv()); -// serviceargv.add ("-ORBsvcconf"); -// serviceargv.add ("ec.conf"); + serviceargv.add ("-ECDispatching"); + serviceargv.add ("mt"); return (void*)factory (serviceargv.argc(), serviceargv.argv()); } - return (void*)factory (myargc, myargv.argv()); + return (void*)factory (myargv.argc(), myargv.argv()); } int main (int argc, char* argv[]) { - myargc = argc; myargv.add (argv); - const ACE_TCHAR* services[] = { "Service", "Supplier", "Consumer" }; + const ACE_TCHAR* services[] = { "Service", "Consumer", "Supplier" }; ACE_Thread_Manager* thr_mgr = ACE_Thread_Manager::instance(); - -// if (TAO_Singleton_Manager::instance ()->init (0) == -1) -// ACE_ERROR_RETURN ((LM_ERROR, -// "Test::init -- ORB pre-initialization " -// "failed.\n"), -// -1); // No exceptions available yet, so return -// // an error status. for (size_t i = 0; i < 3; ++i) { if (thr_mgr->spawn (create_dll,(void*)services[i]) == -1) @@ -78,11 +69,6 @@ main (int argc, char* argv[]) } ACE_OS::sleep (3); } -// if (TAO_Singleton_Manager::instance ()->fini () == -1) -// ACE_ERROR_RETURN ((LM_ERROR, -// "Test::fini -- ORB pre-termination " -// "failed."), -// -1); thr_mgr->wait(); return 0; } diff --git a/ACEXML/compass/eventchannel.cpf b/ACEXML/compass/eventchannel.cpf index 4a88992bfa5..086a77b8c99 100644 --- a/ACEXML/compass/eventchannel.cpf +++ b/ACEXML/compass/eventchannel.cpf @@ -4,7 +4,7 @@ <struct name="ECProperties" type="ACEXML_EC_Property"> <description>Configuration for a Simple Event Channel</description> <simple name="ECDispatching" type="string"> - <value>reactive</value> + <value>mt</value> </simple> <simple name="ECFiltering" type="string"> <value>basic</value> |