summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Mesnier <mesnier_p@ociweb.com>2006-05-05 18:55:51 +0000
committerPhil Mesnier <mesnier_p@ociweb.com>2006-05-05 18:55:51 +0000
commit119742c56e587a13f19bac0b837addd170548631 (patch)
treee2b08f9eef696a0aa70b09a5f79dbc57aed06848
parent843d611ad286c5dfb94540d1d2a4e2e7301ca266 (diff)
downloadATCD-119742c56e587a13f19bac0b837addd170548631.tar.gz
ChangeLog tag: Fri May 5 18:48:45 UTC 2006 Phil Mesnier <mesnier_p@ociweb.com>
-rw-r--r--TAO/ChangeLog19
-rw-r--r--TAO/tao/TAO_Internal.cpp48
-rw-r--r--TAO/tao/default_resource.cpp32
3 files changed, 68 insertions, 31 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 2ccd2553fcd..84484fcd774 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,22 @@
+Fri May 5 18:48:45 UTC 2006 Phil Mesnier <mesnier_p@ociweb.com>
+
+ * tao/TAO_Internal.cpp:
+ * tao/default_resource.cpp:
+ In addtion to the reorganization Iliyan did, it was discovered
+ that the codeset library was not getting properly
+ initialized. When the codeset negotiation feature was made
+ optional for footprint considerations, the loading of the
+ codeset library was put into the default Resource
+ Factory. However now that we have the potential for multiple
+ service repositories, it was no longer sufficient do such late
+ initialization of the codeset library. Doing so put it codeset
+ manager and default translators in the configuration context of
+ the first ORB, not in the global configuration context. Moving
+ the bootstrap loading of the Codeset library to TAO internals
+ resolves that. The -ORBNegotiateCodeset flag is still evaluated
+ making codeset loading optional. It will be loaded to the global
+ configuration context by the first ORB that needs it.
+
Fri May 5 18:05:04 UTC 2006 Iliyan Jeliazkov <iliyan@ociweb.com>
* tests/ORB_Local_Config/Bug_1459/Test.cpp:
diff --git a/TAO/tao/TAO_Internal.cpp b/TAO/tao/TAO_Internal.cpp
index e696e393121..753a0697424 100644
--- a/TAO/tao/TAO_Internal.cpp
+++ b/TAO/tao/TAO_Internal.cpp
@@ -17,6 +17,8 @@
#include "tao/Default_Protocols_Hooks.h"
#include "tao/Default_Thread_Lane_Resources_Manager.h"
#include "tao/Default_Collocation_Resolver.h"
+#include "tao/Codeset_Manager_Factory_Base.h"
+#include "tao/Codeset_Manager.h"
#include "tao/debug.h"
#include "tao/StringSeqC.h"
@@ -125,6 +127,12 @@ namespace
TAO_DEFAULT_SERVER_STRATEGY_FACTORY_ARGS;
char const * client_strategy_factory_args =
TAO_DEFAULT_CLIENT_STRATEGY_FACTORY_ARGS;
+
+#if (TAO_NEGOTIATE_CODESETS == 1)
+ bool negotiate_codesets = true;
+#else
+ bool negotiate_codesets = false;
+#endif /* TAO_NEGOTIATE_CODESETS */
}
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -320,6 +328,37 @@ namespace
void
register_global_services_i (ACE_Service_Gestalt * pcfg)
{
+ // This has to be done before intializing the resource factory. Codesets is a special
+ // library since its configuration is optional and it may be linked statically.
+ if (negotiate_codesets)
+ {
+ TAO_Codeset_Manager_Factory_Base *factory =
+ ACE_Dynamic_Service<TAO_Codeset_Manager_Factory_Base>::instance ("TAO_Codeset");
+ if (factory == 0 || factory->is_default())
+ {
+#if !defined (TAO_AS_STATIC_LIBS)
+ // only for dynamic libs, check to see if default factory and if so,
+ // remove it
+ ACE_Service_Config::process_directive
+ (ACE_REMOVE_SERVICE_DIRECTIVE("TAO_Codeset"));
+ ACE_Service_Config::process_directive
+ (ACE_DYNAMIC_SERVICE_DIRECTIVE("TAO_Codeset",
+ "TAO_Codeset",
+ "_make_TAO_Codeset_Manager_Factory",
+ ""));
+ factory =
+ ACE_Dynamic_Service<TAO_Codeset_Manager_Factory_Base>::instance ("TAO_Codeset");
+#endif
+ }
+ if (factory == 0)
+ {
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT("(%P|%t) ORB_Core: ")
+ ACE_TEXT("Unable to initialize Codeset Manager\n")));
+ }
+ }
+
pcfg->process_directive (ace_svc_desc_TAO_Default_Resource_Factory);
pcfg->process_directive (ace_svc_desc_TAO_Default_Client_Strategy_Factory);
pcfg->process_directive (ace_svc_desc_TAO_Default_Server_Strategy_Factory);
@@ -359,6 +398,7 @@ namespace
// calling them if we're not invoking the svc.conf file?
// @@ They are needed for platforms that have no file system,
// like VxWorks.
+
if (resource_factory_args != 0)
{
pcfg->process_directive
@@ -574,6 +614,14 @@ namespace
arg_shifter.consume_arg ();
}
else if (0 != (current_arg = arg_shifter.get_the_parameter
+ (ACE_TEXT ("-ORBNegotiateCodesets"))))
+ {
+ negotiate_codesets =
+ (ACE_OS::atoi (current_arg));
+ // don't consume, the ORB_Core::init will use it again.
+
+ }
+ else if (0 != (current_arg = arg_shifter.get_the_parameter
(ACE_TEXT ("-ORBDebugLevel"))))
{
TAO_debug_level =
diff --git a/TAO/tao/default_resource.cpp b/TAO/tao/default_resource.cpp
index 3de123a5310..3986ee1e040 100644
--- a/TAO/tao/default_resource.cpp
+++ b/TAO/tao/default_resource.cpp
@@ -1171,41 +1171,11 @@ TAO_Default_Resource_Factory::disable_factory (void)
TAO_Codeset_Manager *
TAO_Default_Resource_Factory::codeset_manager(void)
{
- static int initialized = 0;
- if (this->codeset_manager_ || initialized)
+ if (this->codeset_manager_)
return this->codeset_manager_;
- initialized = 1;
TAO_Codeset_Manager_Factory_Base *factory =
ACE_Dynamic_Service<TAO_Codeset_Manager_Factory_Base>::instance ("TAO_Codeset");
- if (factory == 0 || factory->is_default())
- {
-#if !defined (TAO_AS_STATIC_LIBS)
- // only for dynamic libs, check to see if default factory and if so,
- // remove it
- ACE_Service_Config::process_directive
- (ACE_REMOVE_SERVICE_DIRECTIVE("TAO_Codeset"));
- ACE_Service_Config::process_directive
- (ACE_DYNAMIC_SERVICE_DIRECTIVE("TAO_Codeset",
- "TAO_Codeset",
- "_make_TAO_Codeset_Manager_Factory",
- ""));
- factory =
- ACE_Dynamic_Service<TAO_Codeset_Manager_Factory_Base>::instance ("TAO_Codeset");
-
- principal_ = new ACE_Dynamic_Service_Dependency (ACE_TEXT ("TAO_Codeset"));
-
-#endif
- }
- if (factory == 0)
- {
- if (TAO_debug_level > 0)
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT("(%P|%t) ORB_Core: ")
- ACE_TEXT("Unable to initialize Codeset Manager\n")));
- return 0;
- }
-
this->codeset_manager_ = factory->create ();
return this->codeset_manager_;