summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TAO/ChangeLog29
-rw-r--r--TAO/docs/Options.html4
-rw-r--r--TAO/tao/Codeset/Codeset.cpp24
-rw-r--r--TAO/tao/Codeset/Codeset_Manager_Factory.cpp7
-rw-r--r--TAO/tao/Codeset/Codeset_Manager_Factory.h6
-rw-r--r--TAO/tao/Codeset/UTF16_BOM_Factory.cpp3
-rw-r--r--TAO/tao/Codeset/UTF8_Latin1_Factory.cpp1
-rw-r--r--TAO/tao/Codeset_Manager.cpp17
-rw-r--r--TAO/tao/Codeset_Manager.h16
-rw-r--r--TAO/tao/Codeset_Manager_Factory_Base.cpp45
-rw-r--r--TAO/tao/Codeset_Manager_Factory_Base.h67
-rw-r--r--TAO/tao/Makefile.am2
-rw-r--r--TAO/tao/ORB_Core.cpp24
-rw-r--r--TAO/tao/orbconf.h6
-rw-r--r--TAO/tao/tao.mpc2
15 files changed, 199 insertions, 54 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 2dc0cb4e82b..556cc973d46 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,12 +1,37 @@
+Fri Jul 15 16:17:34 2005 Phil Mesnier <mesnier_p@ociweb.com>
+
+ * docs/Options.html:
+ * tao/Codeset_Manager.cpp:
+ * tao/Codeset_Manager.h:
+ * tao/Makefile.am:
+ * tao/ORB_Core.cpp:
+ * tao/orbconf.h:
+ * tao/tao.mpc:
+ * tao/Codeset/Codeset.cpp:
+ * tao/Codeset/Codeset_Manager_Factory.cpp:
+ * tao/Codeset/Codeset_Manager_Factory.h:
+ * tao/Codeset/UTF16_BOM_Factory.cpp:
+ * tao/Codeset/UTF8_Latin1_Factory.cpp:
+
+ Another round of changes to reconcile the differences between
+ static and dynamic libraries. Static applications must
+ explicitly link libTAO_Codeset and include "tao/Codeset/Codeset"
+ to enable codeset support. Failing to do the include will cause
+ none of the TAO_Codeset code to actually link. Thus merely
+ adding -lTAO_Codeset to the link line is benign if no codeset
+ support is desired. The link line is modified automatically for
+ MPC projects depending on taoexe if the negotiate_codesets
+ feature is enabled in default.features.
+
Fri Jul 15 11:00:03 2005 Gary Maxey <gary.maxey@hp.com>
- * TAO_IDL/be/be_visitor_valuebox/valuebox_ci.cpp:
+ * TAO_IDL/be/be_visitor_valuebox/valuebox_ci.cpp:
Fixed platform-specific errors.
Fri Jul 15 08:48:55 2005 Gary Maxey <gary.maxey@hp.com>
- * tests/OBV/ValueBox/client.cpp:
+ * tests/OBV/ValueBox/client.cpp:
Fixed platform-specific errors.
diff --git a/TAO/docs/Options.html b/TAO/docs/Options.html
index 604b7db6965..00cd5f67782 100644
--- a/TAO/docs/Options.html
+++ b/TAO/docs/Options.html
@@ -382,7 +382,9 @@ also removes the ability to interoperate with ORBs on systems using
alternative character or wide charater encodings. The default value may be set
at compile time by defining <CODE>TAO_NEGOTIATE_CODESETS 0</CODE> in
<CODE>orbconf.h</CODE>. Codeset negotiation support is enabled by default in
-TAO as shipped.</td>
+TAO as shipped.<br> <bold>Note to static lib users</bold> In order to build
+TAO statically and get the codeset negotiation feature, two additional steps
+are needed to ensure the TAO_Codeset library is linked in and initalized. Add the MPC feature "negotiate_codesets=1" to the default.features file and regenerate your makefiles, and add <CODE>#include "tao/Codeset/Codeset.h"</CODE> somewhere in your application source, such as the cpp file containing your main.</td>
</tr>
<tr>
<td><code>-ORBSingleReadOptimization</code> <em>boolean (0|1)</em></td>
diff --git a/TAO/tao/Codeset/Codeset.cpp b/TAO/tao/Codeset/Codeset.cpp
index 0a6af8c35dc..aaf6c477eae 100644
--- a/TAO/tao/Codeset/Codeset.cpp
+++ b/TAO/tao/Codeset/Codeset.cpp
@@ -13,6 +13,11 @@
#include "Codeset.h"
#include "Codeset_Manager_Factory.h"
+#include "UTF8_Latin1_Factory.h"
+#include "UTF16_BOM_Factory.h"
+
+#include "ace/Dynamic_Service.h"
+
ACE_RCSID (Codeset, Codeset, "$Id$")
@@ -20,5 +25,22 @@ ACE_RCSID (Codeset, Codeset, "$Id$")
int
TAO_Codeset_Initializer::init (void)
{
- return ACE_Service_Config::process_directive (ace_svc_desc_TAO_Codeset_Manager_Factory);
+ int result = 0;
+
+ result += ACE_Service_Config::process_directive
+ (ace_svc_desc_TAO_UTF8_Latin1_Factory);
+
+ result += ACE_Service_Config::process_directive
+ (ace_svc_desc_TAO_UTF16_BOM_Factory);
+
+ TAO_Codeset_Manager_Factory *cmf = ACE_Dynamic_Service<TAO_Codeset_Manager_Factory>::instance("TAO_Codeset");
+
+ if (cmf != 0)
+ {
+ return result;
+ }
+
+ result += ACE_Service_Config::process_directive
+ (ace_svc_desc_TAO_Codeset_Manager_Factory,1); // force replacement
+ return result;
}
diff --git a/TAO/tao/Codeset/Codeset_Manager_Factory.cpp b/TAO/tao/Codeset/Codeset_Manager_Factory.cpp
index 435aeab0afb..2c1f20f4501 100644
--- a/TAO/tao/Codeset/Codeset_Manager_Factory.cpp
+++ b/TAO/tao/Codeset/Codeset_Manager_Factory.cpp
@@ -23,6 +23,13 @@ TAO_Codeset_Manager_Factory::~TAO_Codeset_Manager_Factory ()
{
}
+int
+TAO_Codeset_Manager_Factory::is_default() const
+{
+ return 0;
+}
+
+
TAO_Codeset_Manager *
TAO_Codeset_Manager_Factory::create (TAO_ORB_Core *oc)
{
diff --git a/TAO/tao/Codeset/Codeset_Manager_Factory.h b/TAO/tao/Codeset/Codeset_Manager_Factory.h
index 98c7b0743aa..fd6cecb8ac6 100644
--- a/TAO/tao/Codeset/Codeset_Manager_Factory.h
+++ b/TAO/tao/Codeset/Codeset_Manager_Factory.h
@@ -24,7 +24,7 @@
#endif /* ACE_LACKS_PRAGMA_ONCE */
#include "ace/Service_Config.h"
-#include "tao/Codeset_Manager.h"
+#include "tao/Codeset_Manager_Factory_Base.h"
// ****************************************************************
@@ -36,11 +36,13 @@
*/
class TAO_Codeset_Export TAO_Codeset_Manager_Factory :
- public TAO_Codeset_Factory
+ public TAO_Codeset_Manager_Factory_Base
{
public:
virtual ~TAO_Codeset_Manager_Factory ();
virtual TAO_Codeset_Manager *create(TAO_ORB_Core *orb_core);
+ virtual int is_default(void) const;
+
};
diff --git a/TAO/tao/Codeset/UTF16_BOM_Factory.cpp b/TAO/tao/Codeset/UTF16_BOM_Factory.cpp
index 15045bf4c0b..ea3c0b2a35e 100644
--- a/TAO/tao/Codeset/UTF16_BOM_Factory.cpp
+++ b/TAO/tao/Codeset/UTF16_BOM_Factory.cpp
@@ -35,14 +35,13 @@ template class ACE_Dynamic_Service<TAO_UTF16_BOM_Factory>;
#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
ACE_STATIC_SVC_DEFINE (TAO_UTF16_BOM_Factory,
- ACE_TEXT ("TAO_UTF16_BOM_Factory"),
+ ACE_TEXT ("UTF16_BOM_Factory"),
ACE_SVC_OBJ_T,
&ACE_SVC_NAME (TAO_UTF16_BOM_Factory),
ACE_Service_Type::DELETE_THIS
| ACE_Service_Type::DELETE_OBJ,
0)
ACE_FACTORY_DEFINE (TAO_Codeset, TAO_UTF16_BOM_Factory)
-ACE_STATIC_SVC_REQUIRE (TAO_UTF16_BOM_Factory)
TAO_UTF16_BOM_Factory::TAO_UTF16_BOM_Factory ()
: translator_ (0)
diff --git a/TAO/tao/Codeset/UTF8_Latin1_Factory.cpp b/TAO/tao/Codeset/UTF8_Latin1_Factory.cpp
index a98e9fc16bf..05b3184ae99 100644
--- a/TAO/tao/Codeset/UTF8_Latin1_Factory.cpp
+++ b/TAO/tao/Codeset/UTF8_Latin1_Factory.cpp
@@ -23,7 +23,6 @@ ACE_STATIC_SVC_DEFINE (TAO_UTF8_Latin1_Factory,
| ACE_Service_Type::DELETE_OBJ,
0)
ACE_FACTORY_DEFINE (TAO_Codeset, TAO_UTF8_Latin1_Factory)
-ACE_STATIC_SVC_REQUIRE (TAO_UTF8_Latin1_Factory)
TAO_UTF8_Latin1_Factory::TAO_UTF8_Latin1_Factory()
: translator_ (0)
diff --git a/TAO/tao/Codeset_Manager.cpp b/TAO/tao/Codeset_Manager.cpp
index 75206adfcaf..6da7f490c30 100644
--- a/TAO/tao/Codeset_Manager.cpp
+++ b/TAO/tao/Codeset_Manager.cpp
@@ -1,20 +1,7 @@
// $Id$
-#include "tao/TAO_Server_Request.h"
-#include "tao/operation_details.h"
-#include "tao/Transport.h"
-#include "tao/Profile.h"
-#include "tao/SystemException.h"
-#include "tao/debug.h"
-#include "tao/CDR.h"
-
#include "Codeset_Manager.h"
-#include "ace/Dynamic_Service.h"
-#include "ace/Codeset_Registry.h"
-#include "ace/OS_NS_string.h"
-
-
ACE_RCSID (tao,
Codeset_Manager,
"$Id$")
@@ -23,7 +10,3 @@ ACE_RCSID (tao,
TAO_Codeset_Manager::~TAO_Codeset_Manager ()
{
}
-
-TAO_Codeset_Factory::~TAO_Codeset_Factory ()
-{
-}
diff --git a/TAO/tao/Codeset_Manager.h b/TAO/tao/Codeset_Manager.h
index 083be9500fa..4bb79a1e1c4 100644
--- a/TAO/tao/Codeset_Manager.h
+++ b/TAO/tao/Codeset_Manager.h
@@ -23,7 +23,6 @@
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
-#include "ace/Service_Object.h"
#include "TAO_Export.h"
class ACE_WChar_Codeset_Translator;
@@ -86,21 +85,6 @@ public:
};
-// ****************************************************************
-
-/**
- * @class TAO_Codeset_Manager_Factory_Base
- *
- * @brief Abstract Base class for creating instances of the codeset manager.
- */
-
-class TAO_Export TAO_Codeset_Factory : public ACE_Service_Object
-{
-public:
- virtual ~TAO_Codeset_Factory ();
- virtual TAO_Codeset_Manager *create(TAO_ORB_Core *orb_core) = 0;
-};
-
#include /**/ "ace/post.h"
#endif /* TAO_CODESET_MANAGER_H */
diff --git a/TAO/tao/Codeset_Manager_Factory_Base.cpp b/TAO/tao/Codeset_Manager_Factory_Base.cpp
new file mode 100644
index 00000000000..37c3d544447
--- /dev/null
+++ b/TAO/tao/Codeset_Manager_Factory_Base.cpp
@@ -0,0 +1,45 @@
+// $Id$
+
+#include "ORB_Core.h"
+#include "Codeset_Manager.h"
+#include "Codeset_Manager_Factory_Base.h"
+
+ACE_RCSID (tao,
+ Codeset_Manager_Factory_Base,
+ "$Id$")
+
+TAO_Codeset_Manager_Factory_Base::~TAO_Codeset_Manager_Factory_Base ()
+{
+}
+
+int
+TAO_Codeset_Manager_Factory_Base::is_default() const
+{
+ return 1;
+}
+
+TAO_Codeset_Manager *
+TAO_Codeset_Manager_Factory_Base::create (TAO_ORB_Core *)
+{
+ return 0;
+
+}
+
+int
+TAO_Codeset_Manager_Factory_Base::initialize (void)
+{
+ return ACE_Service_Config::process_directive
+ (ace_svc_desc_TAO_Codeset_Manager_Factory_Base);
+}
+
+static int
+TAO_Requires_Codeset_Manager_Factory_Base =
+TAO_Codeset_Manager_Factory_Base::initialize ();
+
+ACE_FACTORY_DEFINE (TAO, TAO_Codeset_Manager_Factory_Base)
+ACE_STATIC_SVC_DEFINE (TAO_Codeset_Manager_Factory_Base,
+ ACE_TEXT ("TAO_Codeset"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_Codeset_Manager_Factory_Base),
+ ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
+ 0)
diff --git a/TAO/tao/Codeset_Manager_Factory_Base.h b/TAO/tao/Codeset_Manager_Factory_Base.h
new file mode 100644
index 00000000000..84bf95005dd
--- /dev/null
+++ b/TAO/tao/Codeset_Manager_Factory_Base.h
@@ -0,0 +1,67 @@
+// This may look like C, but it's really -*- C++ -*-
+
+//=============================================================================
+/*
+ * @file Codeset_Manager_Factory_Base.h
+ *
+ * $Id$
+ *
+ * Interface for the TAO CodeSet Manager.
+ *
+ * @author Mahesh Vedantam <mahesh#ociweb.com>
+ */
+//=============================================================================
+
+#ifndef TAO_CODESET_MANAGER_FACTORY_BASE_H
+#define TAO_CODESET_MANAGER_FACTORY_BASE_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/Service_Object.h"
+#include "ace/Service_Config.h"
+#include "TAO_Export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class TAO_ORB_Core;
+class TAO_Codeset_Manager;
+
+/**
+ * @class TAO_Codeset_Manager_Factory_Base
+ *
+ * @brief Base class for creating instances of the codeset manager.
+ *
+ * @description The base also provides a default implementation which
+ * instantiates nothing. This default impl is replaced by the actual
+ * implementation is libTAO_Codeset is loaded.
+ *
+ */
+
+class TAO_Export TAO_Codeset_Manager_Factory_Base : public ACE_Service_Object
+{
+public:
+ virtual ~TAO_Codeset_Manager_Factory_Base ();
+
+ /// Create makes a new instance of the codeset manager for every
+ /// call. This allows multiple ORBs to have their own (or none).
+ /// This default implementation returns a null pointer only.
+ virtual TAO_Codeset_Manager *create(TAO_ORB_Core *orb_core);
+
+ /// Is_default is called by the ORB Core to determine if it needs
+ /// to reload the factory with a dynamically linked libTAO_Codeset.
+ /// Statically linked applications get derive implementation by
+ /// including "tao/Codeset/Codeset.h" somewhere in their source code.
+ virtual int is_default (void) const;
+
+ /// Static initializer ensures the factory is loaded
+ static int initialize (void);
+};
+
+ACE_STATIC_SVC_DECLARE (TAO_Codeset_Manager_Factory_Base)
+ACE_FACTORY_DECLARE (TAO, TAO_Codeset_Manager_Factory_Base)
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_CODESET_MANAGER_FACTORY_BASE_H */
diff --git a/TAO/tao/Makefile.am b/TAO/tao/Makefile.am
index 34f48dba745..6c399308737 100644
--- a/TAO/tao/Makefile.am
+++ b/TAO/tao/Makefile.am
@@ -70,6 +70,7 @@ libTAO_la_SOURCES = \
ClientRequestInterceptor_Adapter_Factory.cpp \
Client_Strategy_Factory.cpp \
Codeset_Manager.cpp \
+ Codeset_Manager_Factory_Base.cpp \
Codeset_Translator_Base.cpp \
Collocated_Invocation.cpp \
Collocation_Proxy_Broker.cpp \
@@ -426,6 +427,7 @@ nobase_include_HEADERS = \
ClientRequestInterceptor_Adapter_Factory.h \
Client_Strategy_Factory.h \
Codeset_Manager.h \
+ Codeset_Manager_Factory_Base.h \
Codeset_Translator_Base.h \
Collocated_Invocation.h \
Collocation_Proxy_Broker.h \
diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp
index 010f9fb4f9a..ce889af66ff 100644
--- a/TAO/tao/ORB_Core.cpp
+++ b/TAO/tao/ORB_Core.cpp
@@ -36,6 +36,7 @@
#include "PolicyFactory_Registry_Factory.h"
#include "ORBInitializer_Registry_Adapter.h"
#include "Codeset_Manager.h"
+#include "Codeset_Manager_Factory_Base.h"
#if (TAO_HAS_CORBA_MESSAGING == 1)
#include "Policy_Manager.h"
@@ -352,7 +353,7 @@ TAO_ORB_Core::init (int &argc, char *argv[] ACE_ENV_ARG_DECL)
this->lock_,
-1);
-#if defined (TAO_NEGOTIATE_CODESETS) && (TAO_NEGOTIATE_CODESETS == 1)
+#if (TAO_NEGOTIATE_CODESETS == 1)
int negotiate_codesets = 1;
#else
int negotiate_codesets = 0;
@@ -895,7 +896,6 @@ TAO_ORB_Core::init (int &argc, char *argv[] ACE_ENV_ARG_DECL)
{
negotiate_codesets =
(ACE_OS::atoi (current_arg));
-
arg_shifter.consume_arg ();
}
else if ((current_arg = arg_shifter.get_the_parameter
@@ -2392,17 +2392,22 @@ TAO_ORB_Core::load_codeset_manager ()
if (this->orb_params()->negotiate_codesets() == 0)
return;
- TAO_Codeset_Factory *factory =
- ACE_Dynamic_Service<TAO_Codeset_Factory>::instance ("TAO_Codeset");
- if (factory == 0)
+ 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("remove TAO_Codeset");
ACE_Service_Config::process_directive
(ACE_DYNAMIC_SERVICE_DIRECTIVE("TAO_Codeset",
"TAO_Codeset",
- "_make_TAO_Codeset_Manager_Factory",
+ "_make_TAO_Codeset_Manager_Manager_Factory_Base",
""));
factory =
- ACE_Dynamic_Service<TAO_Codeset_Factory>::instance ("TAO_Codeset");
+ ACE_Dynamic_Service<TAO_Codeset_Manager_Factory_Base>::instance ("TAO_Codeset");
+#endif
}
if (factory == 0)
{
@@ -2416,6 +2421,11 @@ TAO_ORB_Core::load_codeset_manager ()
this->codeset_manager_ = factory->create (this);
if (this->codeset_manager_)
this->codeset_manager_->open();
+ else
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("(%P|%t) ORB_Core: ")
+ ACE_TEXT("Codeset Manager not available\n")));
}
diff --git a/TAO/tao/orbconf.h b/TAO/tao/orbconf.h
index a87e7488d3c..7fadcd77817 100644
--- a/TAO/tao/orbconf.h
+++ b/TAO/tao/orbconf.h
@@ -81,11 +81,7 @@
// to the first request. The use of codeset negotiation also causes
// libTAO_Codeset to be linked in.
#if !defined (TAO_NEGOTIATE_CODESETS)
-# if defined (TAO_AS_STATIC_LIBS)
-# define TAO_NEGOTIATE_CODESETS 0
-# else
-# define TAO_NEGOTIATE_CODESETS 1
-# endif /* TAO_AS_STATIC_LIBS */
+# define TAO_NEGOTIATE_CODESETS 1
#endif /*TAO_NEGOTIATE_CODESETS*/
// The default size of TAO's ORB table, i.e. the one used as the
diff --git a/TAO/tao/tao.mpc b/TAO/tao/tao.mpc
index 34e75dc03ec..d39583ab38f 100644
--- a/TAO/tao/tao.mpc
+++ b/TAO/tao/tao.mpc
@@ -42,6 +42,7 @@ project(TAO) : acelib, core, tao_output, taodefaults, pidl, extra_core {
Client_Strategy_Factory.cpp
ClientRequestInterceptor_Adapter_Factory.cpp
Codeset_Manager.cpp
+ Codeset_Manager_Factory_Base.cpp
Codeset_Translator_Base.cpp
Collocated_Invocation.cpp
Collocation_Proxy_Broker.cpp
@@ -349,6 +350,7 @@ project(TAO) : acelib, core, tao_output, taodefaults, pidl, extra_core {
ClientRequestInterceptor_Adapter.h
Client_Strategy_Factory.h
Codeset_Manager.h
+ Codeset_Manager_Factory_Base.h
Codeset_Translator_Base.h
// Codeset_Translator_Factory.h *** file is for backwardscompatibility only
// *** there should be no dependencies on it