DIOP_Factory.cpp

Go to the documentation of this file.
00001 // $Id: DIOP_Factory.cpp 78792 2007-07-05 12:19:09Z johnnyw $
00002 
00003 #include "tao/Strategies/DIOP_Factory.h"
00004 
00005 #if defined (TAO_HAS_DIOP) && (TAO_HAS_DIOP != 0)
00006 
00007 #include "tao/Strategies/DIOP_Acceptor.h"
00008 #include "tao/Strategies/DIOP_Connector.h"
00009 
00010 #include "tao/ORB_Constants.h"
00011 
00012 #include "ace/OS_NS_strings.h"
00013 
00014 ACE_RCSID (Strategies,
00015            DIOP_Factory,
00016            "$Id: DIOP_Factory.cpp 78792 2007-07-05 12:19:09Z johnnyw $")
00017 
00018 static const char the_prefix[] = "diop";
00019 
00020 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00021 
00022 TAO_DIOP_Protocol_Factory::TAO_DIOP_Protocol_Factory (void)
00023   :  TAO_Protocol_Factory (TAO_TAG_DIOP_PROFILE)
00024 {
00025 }
00026 
00027 TAO_DIOP_Protocol_Factory::~TAO_DIOP_Protocol_Factory (void)
00028 {
00029 }
00030 
00031 int
00032 TAO_DIOP_Protocol_Factory::match_prefix (const ACE_CString &prefix)
00033 {
00034   // Check for the proper prefix for this protocol.
00035   return (ACE_OS::strcasecmp (prefix.c_str (), ::the_prefix) == 0);
00036 }
00037 
00038 const char *
00039 TAO_DIOP_Protocol_Factory::prefix (void) const
00040 {
00041   return ::the_prefix;
00042 }
00043 
00044 char
00045 TAO_DIOP_Protocol_Factory::options_delimiter (void) const
00046 {
00047   return '/';
00048 }
00049 
00050 TAO_Acceptor *
00051 TAO_DIOP_Protocol_Factory::make_acceptor (void)
00052 {
00053   TAO_Acceptor *acceptor = 0;
00054 
00055   ACE_NEW_RETURN (acceptor,
00056                   TAO_DIOP_Acceptor,
00057                   0);
00058 
00059   return acceptor;
00060 }
00061 
00062 int
00063 TAO_DIOP_Protocol_Factory::init (int /* argc */, ACE_TCHAR* /* argv */ [])
00064 {
00065   return 0;
00066 }
00067 
00068 TAO_Connector *
00069 TAO_DIOP_Protocol_Factory::make_connector (void)
00070 {
00071   TAO_Connector *connector = 0;
00072 
00073   ACE_NEW_RETURN (connector,
00074                   TAO_DIOP_Connector,
00075                   0);
00076   return connector;
00077 }
00078 
00079 int
00080 TAO_DIOP_Protocol_Factory::requires_explicit_endpoint (void) const
00081 {
00082   // This switch is actually meant to distinguish between pluggable
00083   // protocols which are able to clean up their endpoints and such
00084   // that aren't. E.g. UIOP will leave files, it therefore returns 1,
00085   // IIOP cleans up its endpoint resources, which therefore return 0.
00086   //
00087   // DIOP does clean up endpoint resources, but as DIOP is only
00088   // suitable for special environments, e.g. it supports only one-ways,
00089   // it returns 1 for an other reason than resource clean-up.
00090 
00091   return 1;
00092 }
00093 
00094 TAO_END_VERSIONED_NAMESPACE_DECL
00095 
00096 ACE_STATIC_SVC_DEFINE (TAO_DIOP_Protocol_Factory,
00097                        ACE_TEXT ("DIOP_Factory"),
00098                        ACE_SVC_OBJ_T,
00099                        &ACE_SVC_NAME (TAO_DIOP_Protocol_Factory),
00100                        ACE_Service_Type::DELETE_THIS |
00101                                   ACE_Service_Type::DELETE_OBJ,
00102                        0)
00103 
00104 ACE_FACTORY_DEFINE (TAO_Strategies, TAO_DIOP_Protocol_Factory)
00105 
00106 #endif /* TAO_HAS_DIOP && TAO_HAS_DIOP != 0 */

Generated on Sun Jan 27 15:59:47 2008 for TAO_Strategies by doxygen 1.3.6