From be0f471bf31364c4e2994427a5e8febbd47345dc Mon Sep 17 00:00:00 2001 From: ls1 Date: Thu, 12 Aug 2004 17:02:36 +0000 Subject: *** empty log message *** --- TAO/CIAO/tools/XML_Helpers/Cascadable_DocHandler.h | 5 ++-- TAO/orbsvcs/orbsvcs/Event/EC_Basic_Factory.cpp | 7 +----- TAO/orbsvcs/orbsvcs/Event/EC_Default_Factory.cpp | 8 +------ TAO/orbsvcs/orbsvcs/Event/EC_Null_Factory.cpp | 7 +----- .../Event/EC_Reactive_Timeout_Generator.cpp | 27 +++++++++++++++++++++- .../orbsvcs/Event/EC_Reactive_Timeout_Generator.h | 6 ++++- 6 files changed, 37 insertions(+), 23 deletions(-) diff --git a/TAO/CIAO/tools/XML_Helpers/Cascadable_DocHandler.h b/TAO/CIAO/tools/XML_Helpers/Cascadable_DocHandler.h index 6bb7b0f1428..25dd7736706 100644 --- a/TAO/CIAO/tools/XML_Helpers/Cascadable_DocHandler.h +++ b/TAO/CIAO/tools/XML_Helpers/Cascadable_DocHandler.h @@ -15,6 +15,7 @@ #include /**/ "ace/pre.h" #include "ACEXML/common/DefaultHandler.h" #include "ACEXML/common/XMLReader.h" +#include "XML_Helpers_Export.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) #pragma once @@ -65,7 +66,7 @@ namespace CIAO * @sa ACEXML_DefaultHandler * @sa DocHandler_Context */ - class Cascadable_DocHandler : public ACEXML_DefaultHandler + class CIAO_XML_HELPERS_Export Cascadable_DocHandler : public ACEXML_DefaultHandler { public: /** @@ -202,7 +203,7 @@ namespace CIAO * * @brief This DocHandler ignore and skip over a specific tag. */ - class Skip_DocHandler : public Cascadable_DocHandler + class CIAO_XML_HELPERS_Export Skip_DocHandler : public Cascadable_DocHandler { public: /// Constructor. diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Basic_Factory.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Basic_Factory.cpp index 6bfc17ea60f..8a3529cdc81 100644 --- a/TAO/orbsvcs/orbsvcs/Event/EC_Basic_Factory.cpp +++ b/TAO/orbsvcs/orbsvcs/Event/EC_Basic_Factory.cpp @@ -123,12 +123,7 @@ TAO_EC_Basic_Factory::destroy_proxy_push_consumer (TAO_EC_ProxyPushConsumer *x) TAO_EC_Timeout_Generator* TAO_EC_Basic_Factory::create_timeout_generator (TAO_EC_Event_Channel_Base *) { - int argc = 0; - char **argv = 0; - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, ""); - ACE_Reactor *reactor = orb->orb_core ()->reactor (); - return new TAO_EC_Reactive_Timeout_Generator (reactor); + return new TAO_EC_Reactive_Timeout_Generator (0); } void diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Default_Factory.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Default_Factory.cpp index 9d33bbecd68..711329bc9d0 100644 --- a/TAO/orbsvcs/orbsvcs/Event/EC_Default_Factory.cpp +++ b/TAO/orbsvcs/orbsvcs/Event/EC_Default_Factory.cpp @@ -589,13 +589,7 @@ TAO_EC_Default_Factory::create_timeout_generator (TAO_EC_Event_Channel_Base *) { if (this->timeout_ == 0) { - int argc = 0; - char **argv = 0; - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, this->orbid_.c_str ()); - - ACE_Reactor *reactor = orb->orb_core ()->reactor (); - return new TAO_EC_Reactive_Timeout_Generator (reactor); + return new TAO_EC_Reactive_Timeout_Generator (0); } #if 0 else if (this->timeout_ == 1) diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Null_Factory.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Null_Factory.cpp index 841bd6656c7..46b5db53840 100644 --- a/TAO/orbsvcs/orbsvcs/Event/EC_Null_Factory.cpp +++ b/TAO/orbsvcs/orbsvcs/Event/EC_Null_Factory.cpp @@ -120,12 +120,7 @@ TAO_EC_Null_Factory::destroy_proxy_push_consumer (TAO_EC_ProxyPushConsumer *x) TAO_EC_Timeout_Generator* TAO_EC_Null_Factory::create_timeout_generator (TAO_EC_Event_Channel_Base *) { - int argc = 0; - char **argv = 0; - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, ""); - ACE_Reactor *reactor = orb->orb_core ()->reactor (); - return new TAO_EC_Reactive_Timeout_Generator (reactor); + return new TAO_EC_Reactive_Timeout_Generator (0); } void diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_Timeout_Generator.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_Timeout_Generator.cpp index 52c7eb79c11..5ded89f208b 100644 --- a/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_Timeout_Generator.cpp +++ b/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_Timeout_Generator.cpp @@ -3,6 +3,7 @@ #include "EC_Reactive_Timeout_Generator.h" #include "ace/Reactor.h" +#include "ace/Thread_Manager.h" #if ! defined (__ACE_INLINE__) #include "EC_Reactive_Timeout_Generator.i" @@ -14,17 +15,41 @@ ACE_RCSID (Event, TAO_EC_Reactive_Timeout_Generator:: TAO_EC_Reactive_Timeout_Generator (ACE_Reactor *reactor) - : reactor_ (reactor) + : reactor_ (reactor), + reactor_impl_(0) { + if(!reactor_) + { + reactor_impl_ = new ACE_TP_Reactor(); + reactor_ = new ACE_Reactor(reactor_impl_); + } } TAO_EC_Reactive_Timeout_Generator::~TAO_EC_Reactive_Timeout_Generator (void) { + if(reactor_impl_) + { + reactor_->end_reactor_event_loop(); + + delete reactor_; + delete reactor_impl_; + } } void TAO_EC_Reactive_Timeout_Generator::activate (void) { + ACE_Thread_Manager::instance()->spawn((ACE_THR_FUNC) run_svc, this); +} + +void +TAO_EC_Reactive_Timeout_Generator::run_svc(void *arg) +{ + TAO_EC_Reactive_Timeout_Generator *obj + = ACE_static_cast(TAO_EC_Reactive_Timeout_Generator*, arg); + + obj->reactor_->run_reactor_event_loop(); + } void diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_Timeout_Generator.h b/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_Timeout_Generator.h index e75afbcc5fc..b18186cfaeb 100644 --- a/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_Timeout_Generator.h +++ b/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_Timeout_Generator.h @@ -18,6 +18,7 @@ #include /**/ "ace/pre.h" #include "EC_Timeout_Generator.h" +#include "ace/TP_Reactor.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -37,7 +38,7 @@ class TAO_RTEvent_Export TAO_EC_Reactive_Timeout_Generator { public: /// Constructor. - /// If is 0 then we use the reactor in the ORB singleton. + /// If is 0 then we create a new reactor. TAO_EC_Reactive_Timeout_Generator (ACE_Reactor *reactor = 0); /// destructor @@ -53,8 +54,11 @@ public: int id); private: + static void run_svc(void *arg); + /// The reactor ACE_Reactor *reactor_; + ACE_TP_Reactor *reactor_impl_; /// An adapter to receive the timeout events. TAO_EC_Timeout_Adapter event_handler_; -- cgit v1.2.1