BuiltInPluginLoader.cpp

Go to the documentation of this file.
00001 /*
00002  *
00003  *
00004  * Distributed under the OpenDDS License.
00005  * See: http://www.opendds.org/license.html
00006  */
00007 
00008 #include "dds/DCPS/security/BuiltInPluginLoader.h"
00009 #include "dds/DCPS/security/BuiltInSecurityPluginInst.h"
00010 #include "dds/DCPS/security/framework/SecurityRegistry.h"
00011 #include "dds/DCPS/RcHandle_T.h"
00012 
00013 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL
00014 
00015 namespace OpenDDS {
00016 namespace Security {
00017 
00018 static const std::string PLUGIN_NAME("BuiltIn");
00019 
00020 int
00021 BuiltInPluginLoader::init(int /*argc*/, ACE_TCHAR* /*argv*/[])
00022 {
00023   static bool initialized(false);
00024 
00025   if (initialized) return 0;  // already initialized
00026 
00027   SecurityPluginInst_rch plugin = DCPS::make_rch<BuiltInSecurityPluginInst>();
00028   TheSecurityRegistry->register_plugin(PLUGIN_NAME, plugin);
00029 
00030   SecurityConfig_rch default_config =
00031     TheSecurityRegistry->create_config(SecurityRegistry::DEFAULT_CONFIG_NAME,
00032                                        plugin);
00033   TheSecurityRegistry->default_config(default_config);
00034 
00035   initialized = true;
00036 
00037   return 0;
00038 }
00039 
00040 ACE_FACTORY_DEFINE(DdsSecurity, BuiltInPluginLoader);
00041 ACE_STATIC_SVC_DEFINE(
00042   BuiltInPluginLoader,
00043   ACE_TEXT("OpenDDS_Security"),
00044   ACE_SVC_OBJ_T,
00045   &ACE_SVC_NAME(BuiltInPluginLoader),
00046   ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
00047   0)
00048 
00049 } // namespace Security
00050 } // namespace OpenDDS
00051 
00052 OPENDDS_END_VERSIONED_NAMESPACE_DECL
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 10 Aug 2018 for OpenDDS by  doxygen 1.6.1