diff options
author | bala <balanatarajan@users.noreply.github.com> | 2000-02-23 16:59:00 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2000-02-23 16:59:00 +0000 |
commit | 8f9cf818c22c1a1be19d675f89b67bed943340b1 (patch) | |
tree | 58ddae0ad68ad9dbc13d1fc1d4ab28adbafbea78 | |
parent | a28934b397baf4bc4e0c0da46f644a2f9037cdd1 (diff) | |
download | ATCD-8f9cf818c22c1a1be19d675f89b67bed943340b1.tar.gz |
*** empty log message ***
-rw-r--r-- | TAO/tao/GIOP_Message_Base.cpp | 1 | ||||
-rw-r--r-- | TAO/tao/IIOP_Acceptor.h | 2 | ||||
-rw-r--r-- | TAO/tao/IIOP_Connector.h | 2 | ||||
-rw-r--r-- | TAO/tao/IIOP_Factory.cpp | 29 | ||||
-rw-r--r-- | TAO/tao/IIOP_Factory.h | 5 | ||||
-rw-r--r-- | TAO/tao/IIOP_Lite_Factory.cpp | 93 | ||||
-rw-r--r-- | TAO/tao/IIOP_Lite_Factory.h | 66 | ||||
-rw-r--r-- | TAO/tao/UIOP_Acceptor.cpp | 8 | ||||
-rw-r--r-- | TAO/tao/UIOP_Acceptor.h | 5 | ||||
-rw-r--r-- | TAO/tao/UIOP_Connect.cpp | 88 | ||||
-rw-r--r-- | TAO/tao/UIOP_Connect.h | 17 | ||||
-rw-r--r-- | TAO/tao/UIOP_Connector.cpp | 29 | ||||
-rw-r--r-- | TAO/tao/UIOP_Connector.h | 5 | ||||
-rw-r--r-- | TAO/tao/UIOP_Factory.h | 6 | ||||
-rw-r--r-- | TAO/tao/UIOP_Lite_Factory.cpp | 97 | ||||
-rw-r--r-- | TAO/tao/UIOP_Lite_Factory.h | 71 |
16 files changed, 438 insertions, 86 deletions
diff --git a/TAO/tao/GIOP_Message_Base.cpp b/TAO/tao/GIOP_Message_Base.cpp index 5ec608b8ca7..9acbfaa0b10 100644 --- a/TAO/tao/GIOP_Message_Base.cpp +++ b/TAO/tao/GIOP_Message_Base.cpp @@ -27,7 +27,6 @@ TAO_GIOP_Message_Base:: // Reset the message type msg.reset (); - cout << "Thaye parameshi "<<endl; TAO_GIOP_Message_Type type = TAO_GIOP_MESSAGERROR; // First convert the Pluggable type to the GIOP specific type. diff --git a/TAO/tao/IIOP_Acceptor.h b/TAO/tao/IIOP_Acceptor.h index db8763aa90e..62cb3846ad9 100644 --- a/TAO/tao/IIOP_Acceptor.h +++ b/TAO/tao/IIOP_Acceptor.h @@ -43,7 +43,7 @@ class TAO_Export TAO_IIOP_Acceptor : public TAO_Acceptor // The IIOP-specific bridge class for the concrete acceptor. // public: - TAO_IIOP_Acceptor (CORBA::Boolean flag); + TAO_IIOP_Acceptor (CORBA::Boolean flag = 0); // Constructor. ~TAO_IIOP_Acceptor (void); diff --git a/TAO/tao/IIOP_Connector.h b/TAO/tao/IIOP_Connector.h index 944c618830b..d7daf444cb9 100644 --- a/TAO/tao/IIOP_Connector.h +++ b/TAO/tao/IIOP_Connector.h @@ -81,7 +81,7 @@ class TAO_Export TAO_IIOP_Connector : public TAO_Connector // public: // = Initialization and termination methods. - TAO_IIOP_Connector (CORBA::Boolean flag); + TAO_IIOP_Connector (CORBA::Boolean flag = 0); // Constructor. // = The TAO_Connector methods, please check the documentation on diff --git a/TAO/tao/IIOP_Factory.cpp b/TAO/tao/IIOP_Factory.cpp index 2091337db6e..84d22b9c27b 100644 --- a/TAO/tao/IIOP_Factory.cpp +++ b/TAO/tao/IIOP_Factory.cpp @@ -1,9 +1,9 @@ // $Id$ + #include "tao/IIOP_Factory.h" #include "tao/IIOP_Acceptor.h" #include "tao/IIOP_Connector.h" #include "ace/Dynamic_Service.h" -#include "ace/Get_Opt.h" ACE_RCSID(tao, IIOP_Factory, "$Id$") @@ -11,14 +11,12 @@ static const char prefix_[] = "iiop"; TAO_IIOP_Protocol_Factory::TAO_IIOP_Protocol_Factory (void) : major_ (TAO_DEF_GIOP_MAJOR), - minor_ (TAO_DEF_GIOP_MINOR), - lite_flag_ (0) + minor_ (TAO_DEF_GIOP_MINOR) { } TAO_IIOP_Protocol_Factory::~TAO_IIOP_Protocol_Factory (void) { - } int @@ -46,29 +44,16 @@ TAO_IIOP_Protocol_Factory::make_acceptor (void) TAO_Acceptor *acceptor = 0; ACE_NEW_RETURN (acceptor, - TAO_IIOP_Acceptor (this->lite_flag_), + TAO_IIOP_Acceptor, 0); return acceptor; } int -TAO_IIOP_Protocol_Factory::init (int argc, - char* argv[]) +TAO_IIOP_Protocol_Factory::init (int /* argc */, + char* /* argv */ []) { - if (argc > 0) - { - if (ACE_OS::strcmp (argv[0], - "GIOP_Lite") == 0) - { - this->lite_flag_ = 1; - } - else - ACE_ERROR_RETURN ((LM_ERROR, - ASYS_TEXT ("(%N|%l)Wrong protocol type \n")), - -1); - - } return 0; } @@ -78,7 +63,7 @@ TAO_IIOP_Protocol_Factory::make_connector (void) TAO_Connector *connector = 0; ACE_NEW_RETURN (connector, - TAO_IIOP_Connector (this->lite_flag_), + TAO_IIOP_Connector, 0); return connector; } @@ -98,5 +83,3 @@ ACE_STATIC_SVC_DEFINE (TAO_IIOP_Protocol_Factory, 0) ACE_FACTORY_DEFINE (TAO, TAO_IIOP_Protocol_Factory) - - diff --git a/TAO/tao/IIOP_Factory.h b/TAO/tao/IIOP_Factory.h index fd87c3762e5..36030c650e2 100644 --- a/TAO/tao/IIOP_Factory.h +++ b/TAO/tao/IIOP_Factory.h @@ -1,6 +1,5 @@ // -*- C++ -*- // $Id$ - // ============================================================================ // // = LIBRARY @@ -30,7 +29,6 @@ class TAO_Export TAO_IIOP_Protocol_Factory : public TAO_Protocol_Factory { public: TAO_IIOP_Protocol_Factory (void); - virtual ~TAO_IIOP_Protocol_Factory (void); // = Service Configurator hooks. @@ -57,9 +55,6 @@ private: int minor_; // Changing the version number can be used to provide backwards // compatibility with old clients. - - CORBA::Boolean lite_flag_; - // Flag for the above. A value of zero represent }; ACE_STATIC_SVC_DECLARE (TAO_IIOP_Protocol_Factory) diff --git a/TAO/tao/IIOP_Lite_Factory.cpp b/TAO/tao/IIOP_Lite_Factory.cpp new file mode 100644 index 00000000000..86bbe570cb0 --- /dev/null +++ b/TAO/tao/IIOP_Lite_Factory.cpp @@ -0,0 +1,93 @@ +// $Id$ +#include "tao/IIOP_Lite_Factory.h" +#include "tao/IIOP_Acceptor.h" +#include "tao/IIOP_Connector.h" +#include "ace/Dynamic_Service.h" +#include "ace/Get_Opt.h" + +ACE_RCSID(tao, IIOP_Factory, "$Id$") + +static const char prefix_[] = "iiop"; + +TAO_IIOP_Lite_Protocol_Factory::TAO_IIOP_Lite_Protocol_Factory (void) + : major_ (TAO_DEF_GIOP_MAJOR), + minor_ (TAO_DEF_GIOP_MINOR) +{ +} + +TAO_IIOP_Lite_Protocol_Factory::~TAO_IIOP_Lite_Protocol_Factory (void) +{ + +} + +int +TAO_IIOP_Lite_Protocol_Factory::match_prefix (const ACE_CString &prefix) +{ + // Check for the proper prefix for this protocol. + return (ACE_OS::strcasecmp (prefix.c_str (), ::prefix_) == 0); +} + +const char * +TAO_IIOP_Lite_Protocol_Factory::prefix (void) const +{ + return ::prefix_; +} + +char +TAO_IIOP_Lite_Protocol_Factory::options_delimiter (void) const +{ + return '/'; +} + +TAO_Acceptor * +TAO_IIOP_Lite_Protocol_Factory::make_acceptor (void) +{ + TAO_Acceptor *acceptor = 0; + + // We are a Lite factory + CORBA::Boolean lite_flag = 1; + ACE_NEW_RETURN (acceptor, + TAO_IIOP_Acceptor (lite_flag), + 0); + + return acceptor; +} + +int +TAO_IIOP_Lite_Protocol_Factory::init (int /*argc*/, + char* /*argv*/ []) +{ + return 0; +} + +TAO_Connector * +TAO_IIOP_Lite_Protocol_Factory::make_connector (void) +{ + TAO_Connector *connector = 0; + + // We are a Lite factory + CORBA::Boolean lite_flag = 1; + + ACE_NEW_RETURN (connector, + TAO_IIOP_Connector (lite_flag), + 0); + return connector; +} + +int +TAO_IIOP_Lite_Protocol_Factory::requires_explicit_endpoint (void) const +{ + return 0; +} + +ACE_STATIC_SVC_DEFINE (TAO_IIOP_Lite_Protocol_Factory, + ASYS_TEXT ("IIOP_Lite_Factory"), + ACE_SVC_OBJ_T, + &ACE_SVC_NAME (TAO_IIOP_Lite_Protocol_Factory), + ACE_Service_Type::DELETE_THIS | + ACE_Service_Type::DELETE_OBJ, + 0) + +ACE_FACTORY_DEFINE (TAO, TAO_IIOP_Lite_Protocol_Factory) + + diff --git a/TAO/tao/IIOP_Lite_Factory.h b/TAO/tao/IIOP_Lite_Factory.h new file mode 100644 index 00000000000..4594bf524ad --- /dev/null +++ b/TAO/tao/IIOP_Lite_Factory.h @@ -0,0 +1,66 @@ +// -*- C++ -*- +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// TAO +// +// = FILENAME +// IIOP_Lite_factory.h +// +// = AUTHOR +// Fred Kuhns <fredk@cs.wustl.edu> +// +// ============================================================================ + +#ifndef TAO_IIOP_LITE_FACTORY_H +#define TAO_IIOP_LITE_FACTORY_H + +#include "tao/Protocol_Factory.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +class TAO_Acceptor; +class TAO_Connector; + +class TAO_Export TAO_IIOP_Lite_Protocol_Factory : + public TAO_Protocol_Factory +{ +public: + TAO_IIOP_Lite_Protocol_Factory (void); + + virtual ~TAO_IIOP_Lite_Protocol_Factory (void); + + // = Service Configurator hooks. + virtual int init (int argc, char* argv[]); + // Dynamic linking hook + + virtual int match_prefix (const ACE_CString &prefix); + // Verify prefix is a match + + virtual const char *prefix (void) const; + // Returns the prefix used by the protocol. + + virtual char options_delimiter (void) const; + // Return the character used to mark where an endpoint ends and + // where its options begin. + + // = Check Protocol_Factory.h for a description of these methods. + virtual TAO_Acceptor *make_acceptor (void); + virtual TAO_Connector *make_connector (void); + virtual int requires_explicit_endpoint (void) const; + +private: + int major_; + int minor_; + // Changing the version number can be used to provide backwards + // compatibility with old clients. +}; + +ACE_STATIC_SVC_DECLARE (TAO_IIOP_Lite_Protocol_Factory) +ACE_FACTORY_DECLARE (TAO, TAO_IIOP_Lite_Protocol_Factory) + +#endif /* TAO_IIOP_Lite_factory_H */ diff --git a/TAO/tao/UIOP_Acceptor.cpp b/TAO/tao/UIOP_Acceptor.cpp index 1a5370a9ed8..f6f31b7e363 100644 --- a/TAO/tao/UIOP_Acceptor.cpp +++ b/TAO/tao/UIOP_Acceptor.cpp @@ -56,7 +56,7 @@ template class TAO_Accept_Strategy<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ -TAO_UIOP_Acceptor::TAO_UIOP_Acceptor (void) +TAO_UIOP_Acceptor::TAO_UIOP_Acceptor (CORBA::Boolean flag) : TAO_Acceptor (TAO_TAG_UIOP_PROFILE), base_acceptor_ (), creation_strategy_ (0), @@ -64,7 +64,8 @@ TAO_UIOP_Acceptor::TAO_UIOP_Acceptor (void) accept_strategy_ (0), version_ (TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR), orb_core_ (0), - unlink_on_close_ (1) + unlink_on_close_ (1), + lite_flag_ (flag) { } @@ -196,7 +197,8 @@ 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_), + TAO_UIOP_CREATION_STRATEGY (this->orb_core_, + this->lite_flag_), -1); ACE_NEW_RETURN (this->concurrency_strategy_, diff --git a/TAO/tao/UIOP_Acceptor.h b/TAO/tao/UIOP_Acceptor.h index be692275ff5..0e9afc08d78 100644 --- a/TAO/tao/UIOP_Acceptor.h +++ b/TAO/tao/UIOP_Acceptor.h @@ -48,7 +48,7 @@ public: // TAO_UIOP_Acceptor (ACE_UNIX_Addr &addr); // Create Acceptor object using addr. - TAO_UIOP_Acceptor (void); + TAO_UIOP_Acceptor (CORBA::Boolean flag = 0); // Create Acceptor object using addr. virtual ~TAO_UIOP_Acceptor (void); @@ -104,6 +104,9 @@ private: // Flag that determines whether or not the rendezvous point should // be unlinked on close. This is really only used when an error // occurs. + + CORBA::Boolean lite_flag_; + // Should we use GIOP lite?? }; # endif /* TAO_HAS_UIOP == 1 */ diff --git a/TAO/tao/UIOP_Connect.cpp b/TAO/tao/UIOP_Connect.cpp index 50f671903ed..8fc2e28a3ec 100644 --- a/TAO/tao/UIOP_Connect.cpp +++ b/TAO/tao/UIOP_Connect.cpp @@ -18,6 +18,10 @@ # include "tao/UIOP_Connect.i" #endif /* ! __ACE_INLINE__ */ +#include "tao/GIOP_Message_Lite.h" +#include "tao/GIOP_Message_Acceptors.h" +#include "tao/GIOP_Message_Connectors.h" + ACE_RCSID(tao, UIOP_Connect, "$Id$") @@ -75,7 +79,8 @@ TAO_UIOP_Server_Connection_Handler::TAO_UIOP_Server_Connection_Handler (ACE_Thre transport_ (this, 0), orb_core_ (0), tss_resources_ (0), - refcount_ (1) + refcount_ (1), + lite_flag_ (0) { // This constructor should *never* get called, it is just here to // make the compiler happy: the default implementation of the @@ -91,19 +96,31 @@ TAO_UIOP_Server_Connection_Handler::TAO_UIOP_Server_Connection_Handler (TAO_ORB_ transport_ (this, orb_core), orb_core_ (orb_core), tss_resources_ (orb_core->get_tss_resources ()), - refcount_ (1) + refcount_ (1), + lite_flag_ (flag) { + if (lite_flag_) + { + ACE_NEW (this->acceptor_factory_, + TAO_GIOP_Message_Lite); + } + else + { + ACE_NEW (this->acceptor_factory_, + TAO_GIOP_Message_Acceptors); + } // OK, Here is a small twist. By now the all the objects cached in // this class would have been constructed. But we would like to make // the one of the objects, precisely the transport object a pointer // to the Messaging object. So, we set this up properly by calling // the messaging_init method on the transport. - this->transport_.messaging_init (& this->acceptor_factory_); + this->transport_.messaging_init (this->acceptor_factory_); } TAO_UIOP_Server_Connection_Handler::~TAO_UIOP_Server_Connection_Handler (void) { + delete this->acceptor_factory_; } int @@ -259,11 +276,11 @@ TAO_UIOP_Server_Connection_Handler::handle_input_i (ACE_HANDLE, this->refcount_++; int result = - this->acceptor_factory_.handle_input (this->transport (), - this->orb_core_, - this->transport_.message_state_, - max_wait_time); - + this->acceptor_factory_->handle_input (this->transport (), + this->orb_core_, + this->transport_.message_state_, + max_wait_time); + if (result == -1 && TAO_debug_level > 0) { ACE_DEBUG ((LM_DEBUG, @@ -304,7 +321,7 @@ TAO_UIOP_Server_Connection_Handler::handle_input_i (ACE_HANDLE, this->transport_.message_state_.reset (0); result = - this->acceptor_factory_.process_connector_messages (this->transport (), + this->acceptor_factory_->process_connector_messages (this->transport (), this->orb_core_, input_cdr, message_type); @@ -514,32 +531,51 @@ TAO_UIOP_Client_Connection_Handler:: init_mesg_protocol (CORBA::Octet major, CORBA::Octet minor) { - if (minor > TAO_DEF_GIOP_MINOR) - minor = TAO_DEF_GIOP_MINOR; - switch (minor) + if (major == TAO_DEF_GIOP_LITE_MAJOR && + minor == TAO_DEF_GIOP_LITE_MINOR) + { + ACE_NEW_RETURN (this->mesg_factory_, + TAO_GIOP_Message_Lite, + -1); + } + else if (major == TAO_DEF_GIOP_MAJOR) + { + if (minor > TAO_DEF_GIOP_MINOR) + minor = TAO_DEF_GIOP_MINOR; + switch (minor) + { + case 0: + ACE_NEW_RETURN (this->mesg_factory_, + TAO_GIOP_Message_Connector_10, + 0); + break; + case 1: + ACE_NEW_RETURN (this->mesg_factory_, + TAO_GIOP_Message_Connector_11, + 0); + break; + default: + if (TAO_debug_level > 0) + { + ACE_ERROR_RETURN ((LM_ERROR, + ASYS_TEXT ("(%N|%l|%p|%t) No matching minor version number\n")), + 0); + } + } + } + else { - case 0: - ACE_NEW_RETURN (this->mesg_factory_, - TAO_GIOP_Message_Connector_10, - 0); - break; - case 1: - ACE_NEW_RETURN (this->mesg_factory_, - TAO_GIOP_Message_Connector_11, - 0); - break; - default: if (TAO_debug_level > 0) { ACE_ERROR_RETURN ((LM_ERROR, - ASYS_TEXT ("(%N|%l|%p|%t) No matching minor version number \n")), + ASYS_TEXT ("(%N|%l|%p|%t) No matching major version number \n")), 0); } } - - // Make the transport know + // Make the transport know this->transport_.messaging_init (this->mesg_factory_); + return 1; } // **************************************************************** diff --git a/TAO/tao/UIOP_Connect.h b/TAO/tao/UIOP_Connect.h index 8b1ff118a54..bedb8e17447 100644 --- a/TAO/tao/UIOP_Connect.h +++ b/TAO/tao/UIOP_Connect.h @@ -33,11 +33,7 @@ #include "tao/corbafwd.h" #include "tao/Wait_Strategy.h" - - -// BALA Temporray include -#include "tao/GIOP_Message_Acceptors.h" -#include "tao/GIOP_Message_Connectors.h" +#include "tao/Pluggable_Messaging.h" // Forward Decls class TAO_ORB_Core; @@ -109,7 +105,7 @@ protected: TAO_ORB_Core *orb_core_; // Cached ORB Core. - TAO_GIOP_Message_Connectors *mesg_factory_; + TAO_Pluggable_Messaging_Interface *mesg_factory_; // The Connector messaging factory }; @@ -157,10 +153,8 @@ protected: TAO_UIOP_Server_Transport transport_; // @@ New transport object reference. - //@@Added by Bala for the time being. This would change to the - // actual factory at a later date - TAO_GIOP_Message_Acceptors acceptor_factory_; - // ///////////////////// + TAO_Pluggable_Messaging_Interface *acceptor_factory_; + // Messaging acceptor factory // = Event Handler overloads @@ -185,6 +179,9 @@ protected: u_long refcount_; // Reference count, to avoid early deletes... + + CORBA::Boolean lite_flag_; + // Should we use GIOP or GIOPlite }; #if defined (__ACE_INLINE__) diff --git a/TAO/tao/UIOP_Connector.cpp b/TAO/tao/UIOP_Connector.cpp index e0858532f94..f9b7a771aac 100644 --- a/TAO/tao/UIOP_Connector.cpp +++ b/TAO/tao/UIOP_Connector.cpp @@ -338,10 +338,11 @@ typedef ACE_Cached_Connect_Strategy<TAO_UIOP_Client_Connection_Handler, TAO_CACHED_CONNECT_STRATEGY; #endif /* ! TAO_USES_ROBUST_CONNECTION_MGMT */ -TAO_UIOP_Connector::TAO_UIOP_Connector (void) +TAO_UIOP_Connector::TAO_UIOP_Connector (CORBA::Boolean flag) : TAO_Connector (TAO_TAG_UIOP_PROFILE), base_connector_ (), - orb_core_ (0) + orb_core_ (0), + lite_flag_ (flag) #if defined (TAO_USES_ROBUST_CONNECTION_MGMT) , cached_connect_strategy_ (0), @@ -488,19 +489,31 @@ TAO_UIOP_Connector::connect (TAO_Profile *profile, return -1; } - const TAO_GIOP_Version& version = uiop_profile->version (); - - if (uiop_profile->hint ()->init_mesg_protocol (version.major, - version.minor) == 0) + transport = result->transport (); + int ret_val = 0; + if (lite_flag_) + { + ret_val = result->init_mesg_protocol (TAO_DEF_GIOP_LITE_MAJOR, + TAO_DEF_GIOP_LITE_MINOR); + } + else + { + // Now that we have the client connection handler object we need to + // set the right messaging protocol for the connection handler. + const TAO_GIOP_Version& version = uiop_profile->version (); + ret_val = uiop_profile->hint ()->init_mesg_protocol (version.major, + version.minor); + } + if (ret_val == -1) { if (TAO_debug_level > 0) { ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%N|%l|%p|%t) init_mesg_protocol () failed \n"))); } + return -1; } - transport = result->transport (); - + return 0; } diff --git a/TAO/tao/UIOP_Connector.h b/TAO/tao/UIOP_Connector.h index 06f4ff8ddaa..c910a3ec723 100644 --- a/TAO/tao/UIOP_Connector.h +++ b/TAO/tao/UIOP_Connector.h @@ -81,7 +81,7 @@ class TAO_Export TAO_UIOP_Connector : public TAO_Connector // public: // = Initialization and termination methods. - TAO_UIOP_Connector (void); + TAO_UIOP_Connector (CORBA::Boolean flag = 0); // Constructor. // @@ Do we want to pass in the tag here or should it be statically // defined? @@ -192,6 +192,9 @@ private: TAO_ORB_Core *orb_core_; // ORB Core. + CORBA::Boolean lite_flag_; + // Do we need to use a GIOP_Lite for sending messages? + #if defined (TAO_USES_ROBUST_CONNECTION_MGMT) TAO_CACHED_CONNECT_STRATEGY *cached_connect_strategy_; // Cached connect strategy. diff --git a/TAO/tao/UIOP_Factory.h b/TAO/tao/UIOP_Factory.h index 2c6f33d986c..967f70b38ad 100644 --- a/TAO/tao/UIOP_Factory.h +++ b/TAO/tao/UIOP_Factory.h @@ -60,12 +60,6 @@ private: // Changing the version number can be used to provide backwards // compatibility with old clients. - char *lite_; - // Command line arguments that would indicate whether we have to use - // GIOP lite or not. - - CORBA::Boolean lite_flag_; - // Flag for the above. A value of zero represent }; ACE_STATIC_SVC_DECLARE (TAO_UIOP_Protocol_Factory) diff --git a/TAO/tao/UIOP_Lite_Factory.cpp b/TAO/tao/UIOP_Lite_Factory.cpp new file mode 100644 index 00000000000..651be0dc1cf --- /dev/null +++ b/TAO/tao/UIOP_Lite_Factory.cpp @@ -0,0 +1,97 @@ +// -*- C++ -*- +// $Id$ + +#include "tao/UIOP_Lite_Factory.h" + +#if TAO_HAS_UIOP == 1 + +#include "tao/UIOP_Acceptor.h" +#include "tao/UIOP_Connector.h" +#include "ace/Dynamic_Service.h" + +ACE_RCSID(tao, UIOP_Lite_Factory, "$Id$") + +static const char prefix_[] = "uiop"; + +TAO_UIOP_Lite_Protocol_Factory::TAO_UIOP_Lite_Protocol_Factory (void) + : major_ (TAO_DEF_GIOP_MAJOR), + minor_ (TAO_DEF_GIOP_MINOR) +{ +} + +TAO_UIOP_Lite_Protocol_Factory::~TAO_UIOP_Lite_Protocol_Factory (void) +{ +} + +int +TAO_UIOP_Lite_Protocol_Factory::match_prefix (const ACE_CString &prefix) +{ + // Check for the proper prefix for this protocol. + return (ACE_OS::strcasecmp (prefix.c_str (), ::prefix_) == 0); +} + +const char * +TAO_UIOP_Lite_Protocol_Factory::prefix (void) const +{ + return ::prefix_; +} + +char +TAO_UIOP_Lite_Protocol_Factory::options_delimiter (void) const +{ + return '|'; +} + +TAO_Acceptor * +TAO_UIOP_Lite_Protocol_Factory::make_acceptor (void) +{ + TAO_Acceptor *acceptor = 0; + + // We are Lite factory + CORBA::Boolean lite_factory = 1; + ACE_NEW_RETURN (acceptor, + TAO_UIOP_Acceptor (lite_factory), + 0); + + return acceptor; +} + +int +TAO_UIOP_Lite_Protocol_Factory::init (int /* argc */, + char* /* argv */ []) +{ + return 0; +} + +TAO_Connector * +TAO_UIOP_Lite_Protocol_Factory::make_connector (void) +{ + TAO_Connector *connector = 0; + + // We are a lite factory + CORBA::Boolean lite_factory = 1; + ACE_NEW_RETURN (connector, + TAO_UIOP_Connector (lite_factory), + 0); + + return connector; +} + +int +TAO_UIOP_Lite_Protocol_Factory::requires_explicit_endpoint (void) const +{ + return 1; +} + +ACE_STATIC_SVC_DEFINE (TAO_UIOP_Lite_Protocol_Factory, + ASYS_TEXT ("UIOP_Lite_Factory"), + ACE_SVC_OBJ_T, + &ACE_SVC_NAME (TAO_UIOP_Lite_Protocol_Factory), + ACE_Service_Type::DELETE_THIS | + ACE_Service_Type::DELETE_OBJ, + 0) + +ACE_FACTORY_DEFINE (TAO, TAO_UIOP_Lite_Protocol_Factory) + + +#endif /* TAO_HAS_UIOP == 1 */ diff --git a/TAO/tao/UIOP_Lite_Factory.h b/TAO/tao/UIOP_Lite_Factory.h new file mode 100644 index 00000000000..6b9bc2314eb --- /dev/null +++ b/TAO/tao/UIOP_Lite_Factory.h @@ -0,0 +1,71 @@ +// -*- C++ -*- +// $Id$ +// ============================================================================ +// +// = LIBRARY +// TAO +// +// = FILENAME +// UIOP_Factory.h +// +// = AUTHOR +// Fred Kuhns <fredk@cs.wustl.edu> +// Ossama Othman <othman@cs.wustl.edu> +// +// ============================================================================ + +#ifndef TAO_UIOP_LITE_FACTORY_H +#define TAO_UIOP_LITE_FACTORY_H + +#include "tao/Protocol_Factory.h" + +# if TAO_HAS_UIOP == 1 + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +class TAO_Acceptor; +class TAO_Connector; + + +class TAO_Export TAO_UIOP_Lite_Protocol_Factory : + public TAO_Protocol_Factory +{ +public: + TAO_UIOP_Lite_Protocol_Factory (void); + virtual ~TAO_UIOP_Lite_Protocol_Factory (void); + + // = Service Configurator hooks. + virtual int init (int argc, char* argv[]); + // Dynamic linking hook + + virtual int match_prefix (const ACE_CString &prefix); + // Verify prefix is a match + + virtual const char *prefix (void) const; + // Returns the prefix used by the protocol. + + virtual char options_delimiter (void) const; + // Return the character used to mark where an endpoint ends and + // where its options begin. + + // = Check Protocol_Factory.h for a description of these methods. + virtual TAO_Acceptor *make_acceptor (void); + virtual TAO_Connector *make_connector (void); + virtual int requires_explicit_endpoint (void) const; + +private: + int major_; + int minor_; + // Changing the version number can be used to provide backwards + // compatibility with old clients. + +}; + +ACE_STATIC_SVC_DECLARE (TAO_UIOP_Lite_Protocol_Factory) +ACE_FACTORY_DECLARE (TAO, TAO_UIOP_Lite_Protocol_Factory) + +# endif /* TAO_HAS_UIOP == 1 */ + +#endif /* TAO_UIOP_LITE_FACTORY_H */ |