diff options
author | kirthika <kirthika@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-07-19 22:53:00 +0000 |
---|---|---|
committer | kirthika <kirthika@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-07-19 22:53:00 +0000 |
commit | da32261b5d1be0f7681ffeb965b875d1c2174d49 (patch) | |
tree | 58dc996f59f02590320fb1383515aa548c8d0309 | |
parent | 25df7a0aa62ea877637a56c8cb37b57d698b12b6 (diff) | |
download | ATCD-da32261b5d1be0f7681ffeb965b875d1c2174d49.tar.gz |
Added accept_strategy to teh open call on teh base acceptor
-rw-r--r-- | TAO/tao/UIOP_Acceptor.cpp | 46 | ||||
-rw-r--r-- | TAO/tao/UIOP_Acceptor.h | 13 |
2 files changed, 51 insertions, 8 deletions
diff --git a/TAO/tao/UIOP_Acceptor.cpp b/TAO/tao/UIOP_Acceptor.cpp index 5f0ca844935..e28cee165d6 100644 --- a/TAO/tao/UIOP_Acceptor.cpp +++ b/TAO/tao/UIOP_Acceptor.cpp @@ -36,6 +36,8 @@ ACE_RCSID(tao, UIOP_Acceptor, "$Id$") TAO_UIOP_Acceptor::TAO_UIOP_Acceptor (void) : TAO_Acceptor (TAO_IOP_TAG_UNIX_IOP), base_acceptor_ (), + creation_strategy_ (0), + concurrency_strategy_ (0), version_ (TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR), orb_core_ (0), unlink_on_close_ (1) @@ -44,10 +46,9 @@ TAO_UIOP_Acceptor::TAO_UIOP_Acceptor (void) TAO_UIOP_Acceptor::~TAO_UIOP_Acceptor (void) { - // Explicitly call close() to aid in post-error resource clean up. - // close() is called to ensure that the rendezvous point is removed - // from the filesystem. - this->close (); + delete this->creation_strategy_; + delete this->concurrency_strategy_; + delete this->accept_strategy_; } int @@ -155,11 +156,28 @@ TAO_UIOP_Acceptor::open_i (TAO_ORB_Core* orb_core, { this->orb_core_ = orb_core; + ACE_NEW_RETURN (this->creation_strategy_, + TAO_UIOP_CREATION_STRATEGY (this->orb_core_), + -1); + + ACE_NEW_RETURN (this->concurrency_strategy_, + TAO_UIOP_CONCURRENCY_STRATEGY (this->orb_core_), + -1); + + ACE_NEW_RETURN (this->accept_strategy_, + TAO_UIOP_ACCEPT_STRATEGY (this->orb_core_, + this->tag ()), + -1); + ACE_UNIX_Addr addr; this->rendezvous_point (addr, rendezvous); - if (this->base_acceptor_.open (orb_core, addr) != 0) + if (this->base_acceptor_.open (addr, + this->orb_core_->reactor (), + this->creation_strategy_, + this->accept_strategy_, + this->concurrency_strategy_) == -1) { // Don't unlink an existing rendezvous point since it may be in // use by another UIOP server/client. @@ -237,12 +255,26 @@ TAO_UIOP_Acceptor::endpoint_count (void) #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) template class ACE_Acceptor<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR>; -template class TAO_Acceptor_Impl<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR>; +template class ACE_Strategy_Acceptor<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR>; +template class ACE_Accept_Strategy<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR>; +template class ACE_Creation_Strategy<TAO_UIOP_Server_Connection_Handler>; +template class ACE_Concurrency_Strategy<TAO_UIOP_Server_Connection_Handler>; +template class ACE_Scheduling_Strategy<TAO_UIOP_Server_Connection_Handler>; +template class TAO_Creation_Strategy<TAO_UIOP_Server_Connection_Handler>; +template class TAO_Concurrency_Strategy<TAO_UIOP_Server_Connection_Handler>; +template class TAO_Accept_Strategy<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR, TAO_UIOP_Connector>; #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) #pragma instantiate ACE_Acceptor<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR> -#pragma instantiate TAO_Acceptor_Impl<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR> +#pragma instantiate ACE_Strategy_Acceptor<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR> +#pragma instantiate ACE_Accept_Strategy<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR> +#pragma instantiate ACE_Creation_Strategy<TAO_UIOP_Server_Connection_Handler> +#pragma instantiate ACE_Concurrency_Strategy<TAO_UIOP_Server_Connection_Handler> +#pragma instantiate ACE_Scheduling_Strategy<TAO_UIOP_Server_Connection_Handler> +#pragma instantiate TAO_Creation_Strategy<TAO_UIOP_Server_Connection_Handler> +#pragma instantiate TAO_Concurrency_Strategy<TAO_UIOP_Server_Connection_Handler> +#pragma instantiate TAO_Accept_Strategy<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR, TAO_UIOP_Connector> #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/tao/UIOP_Acceptor.h b/TAO/tao/UIOP_Acceptor.h index 67417e11644..3ea57b4edfc 100644 --- a/TAO/tao/UIOP_Acceptor.h +++ b/TAO/tao/UIOP_Acceptor.h @@ -34,6 +34,9 @@ #include "tao/UIOP_Connect.h" #include "tao/Acceptor_Impl.h" +// Forward declaration. +class TAO_UIOP_Connector; + // TAO UIOP_Acceptor concrete call defination class TAO_Export TAO_UIOP_Acceptor : public TAO_Acceptor @@ -79,7 +82,10 @@ public: CORBA::ULong endpoint_count (void); // return the number of profiles this will generate - typedef TAO_Acceptor_Impl<TAO_UIOP_Server_Connection_Handler,ACE_LSOCK_ACCEPTOR> TAO_UIOP_BASE_ACCEPTOR; + typedef ACE_Strategy_Acceptor<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR> TAO_UIOP_BASE_ACCEPTOR; + typedef TAO_Creation_Strategy<TAO_UIOP_Server_Connection_Handler> TAO_UIOP_CREATION_STRATEGY; + typedef TAO_Concurrency_Strategy<TAO_UIOP_Server_Connection_Handler> TAO_UIOP_CONCURRENCY_STRATEGY; + typedef TAO_Accept_Strategy<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR, TAO_UIOP_Connector> TAO_UIOP_ACCEPT_STRATEGY; private: int open_i (TAO_ORB_Core *orb_core, const char *rendezvous); @@ -93,6 +99,11 @@ private: TAO_UIOP_BASE_ACCEPTOR base_acceptor_; // the concrete acceptor, as a pointer to its base class. + TAO_UIOP_CREATION_STRATEGY *creation_strategy_; + TAO_UIOP_CONCURRENCY_STRATEGY *concurrency_strategy_; + TAO_UIOP_ACCEPT_STRATEGY *accept_strategy_; + // Acceptor strategies. + TAO_GIOP_Version version_; // The GIOP version for this endpoint |