DIOP_Factory.cpp

Go to the documentation of this file.
00001 // DIOP_Factory.cpp,v 1.9 2006/03/10 07:19:18 jtc Exp
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            "DIOP_Factory.cpp,v 1.9 2006/03/10 07:19:18 jtc Exp")
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      major_ (TAO_DEF_GIOP_MAJOR),
00025      minor_ (TAO_DEF_GIOP_MINOR)
00026 {
00027 }
00028 
00029 TAO_DIOP_Protocol_Factory::~TAO_DIOP_Protocol_Factory (void)
00030 {
00031 }
00032 
00033 int
00034 TAO_DIOP_Protocol_Factory::match_prefix (const ACE_CString &prefix)
00035 {
00036   // Check for the proper prefix for this protocol.
00037   return (ACE_OS::strcasecmp (prefix.c_str (), ::the_prefix) == 0);
00038 }
00039 
00040 const char *
00041 TAO_DIOP_Protocol_Factory::prefix (void) const
00042 {
00043   return ::the_prefix;
00044 }
00045 
00046 char
00047 TAO_DIOP_Protocol_Factory::options_delimiter (void) const
00048 {
00049   return '/';
00050 }
00051 
00052 TAO_Acceptor *
00053 TAO_DIOP_Protocol_Factory::make_acceptor (void)
00054 {
00055   TAO_Acceptor *acceptor = 0;
00056 
00057   ACE_NEW_RETURN (acceptor,
00058                   TAO_DIOP_Acceptor,
00059                   0);
00060 
00061   return acceptor;
00062 }
00063 
00064 int
00065 TAO_DIOP_Protocol_Factory::init (int /* argc */,
00066                                  ACE_TCHAR* /* argv */ [])
00067 {
00068   return 0;
00069 }
00070 
00071 TAO_Connector *
00072 TAO_DIOP_Protocol_Factory::make_connector (void)
00073 {
00074   TAO_Connector *connector = 0;
00075 
00076   ACE_NEW_RETURN (connector,
00077                   TAO_DIOP_Connector,
00078                   0);
00079   return connector;
00080 }
00081 
00082 int
00083 TAO_DIOP_Protocol_Factory::requires_explicit_endpoint (void) const
00084 {
00085   // This switch is actually meant to distinguish between pluggable
00086   // protocols which are able to clean up their endpoints and such
00087   // that aren't. E.g. UIOP will leave files, it therefore returns 1,
00088   // IIOP cleans up its endpoint resources, which therefore return 0.
00089   //
00090   // DIOP does clean up endpoint resources, but as DIOP is only
00091   // suitable for special environments, e.g. it supports only one-ways,
00092   // it returns 1 for an other reason than resource clean-up.
00093 
00094   return 1;
00095 }
00096 
00097 TAO_END_VERSIONED_NAMESPACE_DECL
00098 
00099 ACE_STATIC_SVC_DEFINE (TAO_DIOP_Protocol_Factory,
00100                        ACE_TEXT ("DIOP_Factory"),
00101                        ACE_SVC_OBJ_T,
00102                        &ACE_SVC_NAME (TAO_DIOP_Protocol_Factory),
00103                        ACE_Service_Type::DELETE_THIS |
00104                                   ACE_Service_Type::DELETE_OBJ,
00105                        0)
00106 
00107 ACE_FACTORY_DEFINE (TAO_Strategies, TAO_DIOP_Protocol_Factory)
00108 
00109 #endif /* TAO_HAS_DIOP && TAO_HAS_DIOP != 0 */

Generated on Thu Nov 9 13:39:28 2006 for TAO_Strategies by doxygen 1.3.6