summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2006-01-13 12:47:26 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2006-01-13 12:47:26 +0000
commit285539aed322bc62feef4cd67f83ef84b0681681 (patch)
tree16e201d03f0b8dc75e320e451dc11431edc6dea3
parent06173c6b4590358cc9f50acefb01747515740c8a (diff)
downloadATCD-285539aed322bc62feef4cd67f83ef84b0681681.tar.gz
ChangeLogTag: Fri Jan 13 12:30:12 UTC 2006 Johnny Willemsen <jwillemsen@remedy.nl>
-rw-r--r--TAO/tao/Messaging/ExceptionHolder_i.cpp20
-rw-r--r--TAO/tao/Messaging/ExceptionHolder_i.h19
-rw-r--r--TAO/tao/Messaging/Messaging_ORBInitializer.cpp42
-rw-r--r--TAO/tao/Messaging/Messaging_ORBInitializer.h4
4 files changed, 85 insertions, 0 deletions
diff --git a/TAO/tao/Messaging/ExceptionHolder_i.cpp b/TAO/tao/Messaging/ExceptionHolder_i.cpp
index 915d0785284..880f31b6d7d 100644
--- a/TAO/tao/Messaging/ExceptionHolder_i.cpp
+++ b/TAO/tao/Messaging/ExceptionHolder_i.cpp
@@ -15,6 +15,12 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL
namespace TAO
{
+ ExceptionHolder::ExceptionHolder (void) :
+ data_ (0),
+ count_ (0)
+ {
+ }
+
ExceptionHolder::ExceptionHolder (
::CORBA::Boolean is_system_exception,
::CORBA::Boolean byte_order,
@@ -57,6 +63,20 @@ namespace TAO
// todo convert exceptionlist to something we can really use.
this->raise_exception (ACE_ENV_SINGLE_ARG_PARAMETER);
}
+
+ CORBA::ValueBase *
+ ExceptionHolderFactory::create_for_unmarshal (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ {
+ TAO::ExceptionHolder* ret_val = 0;
+ ACE_NEW_THROW_EX (ret_val,
+ ExceptionHolder,
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ return ret_val;
+ }
+
}
TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/tao/Messaging/ExceptionHolder_i.h b/TAO/tao/Messaging/ExceptionHolder_i.h
index c4148f96af4..5b5e369bccc 100644
--- a/TAO/tao/Messaging/ExceptionHolder_i.h
+++ b/TAO/tao/Messaging/ExceptionHolder_i.h
@@ -26,6 +26,7 @@
#include "tao/Messaging/ExceptionHolderA.h"
#include "tao/Messaging/ExceptionHolderC.h"
+#include "tao/ValueType/ValueFactory.h"
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -48,6 +49,8 @@ namespace TAO
public virtual ::CORBA::DefaultValueRefCountBase
{
public:
+ ExceptionHolder (void);
+
ExceptionHolder (
::CORBA::Boolean is_system_exception,
::CORBA::Boolean byte_order,
@@ -72,6 +75,22 @@ namespace TAO
CORBA::ULong const count_;
};
+
+ /**
+ * @class ExceptionHolderFactory
+ *
+ * @brief OBV factory implementation.
+ *
+ * Factory for ExceptionHolder
+ */
+ class TAO_Messaging_Export ExceptionHolderFactory :
+ public virtual CORBA::ValueFactoryBase
+ {
+ public:
+ virtual CORBA::ValueBase * create_for_unmarshal (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+ };
+
}
TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/tao/Messaging/Messaging_ORBInitializer.cpp b/TAO/tao/Messaging/Messaging_ORBInitializer.cpp
index 81c8d9820d2..aa5642b22b7 100644
--- a/TAO/tao/Messaging/Messaging_ORBInitializer.cpp
+++ b/TAO/tao/Messaging/Messaging_ORBInitializer.cpp
@@ -5,7 +5,10 @@
#include "Messaging_Policy_i.h"
#include "Connection_Timeout_Policy_i.h"
#include "Messaging_PolicyFactory.h"
+#include "ExceptionHolder_i.h"
#include "tao/ORB_Core.h"
+#include "tao/PI/ORBInitInfo.h"
+#include "tao/Valuetype/ValueFactory.h"
ACE_RCSID (Messaging,
Messaging_ORBInitializer,
@@ -44,9 +47,48 @@ TAO_Messaging_ORBInitializer::post_init (
this->register_policy_factories (info
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
+
+ this->register_value_factory (info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
}
void
+TAO_Messaging_ORBInitializer::register_value_factory (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+{
+ // Narrow to a TAO_ORBInitInfo object to get access to the
+ // orb_core() TAO extension.
+ TAO_ORBInitInfo_var tao_info =
+ TAO_ORBInitInfo::_narrow (info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (tao_info.in ()))
+ {
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) TAO_Messaging_ORBInitializer::register_value_factory:\n"
+ "(%P|%t) Unable to narrow "
+ "\"PortableInterceptor::ORBInitInfo_ptr\" to\n"
+ "(%P|%t) \"TAO_ORBInitInfo *.\"\n"));
+
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ TAO::ExceptionHolderFactory *base_factory = 0;
+ ACE_NEW (base_factory,
+ TAO::ExceptionHolderFactory);
+ CORBA::ValueFactory_var factory = base_factory;
+
+ tao_info->orb_core()->orb ()->register_value_factory (
+ Messaging::ExceptionHolder::_tao_obv_static_repository_id (),
+ base_factory
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+}
+void
TAO_Messaging_ORBInitializer::register_policy_factories (
PortableInterceptor::ORBInitInfo_ptr info
ACE_ENV_ARG_DECL)
diff --git a/TAO/tao/Messaging/Messaging_ORBInitializer.h b/TAO/tao/Messaging/Messaging_ORBInitializer.h
index 6b7ad2e69de..d937d417ad4 100644
--- a/TAO/tao/Messaging/Messaging_ORBInitializer.h
+++ b/TAO/tao/Messaging/Messaging_ORBInitializer.h
@@ -66,6 +66,10 @@ private:
PortableInterceptor::ORBInitInfo_ptr info
ACE_ENV_ARG_DECL);
+ /// Register ExceptionHolder value factory
+ void register_value_factory (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL);
};
TAO_END_VERSIONED_NAMESPACE_DECL