summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ORBInitializer.cpp
diff options
context:
space:
mode:
authorbala <bala@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-11-15 00:29:15 +0000
committerbala <bala@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-11-15 00:29:15 +0000
commit73de7e1f2e721ca0b18c774b62cbd19cd67307c7 (patch)
treed1424e0cb07342aef9592c359bb31df40e9d82b9 /TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ORBInitializer.cpp
parentab7a97b5983964a3e27c5ec97c9f1622493b2978 (diff)
downloadATCD-73de7e1f2e721ca0b18c774b62cbd19cd67307c7.tar.gz
ChangeLogTag: Tue Nov 14 18:21:29 2000 Balachandran Natarajan <bala@cs.wustl.edu>
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ORBInitializer.cpp')
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ORBInitializer.cpp82
1 files changed, 82 insertions, 0 deletions
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ORBInitializer.cpp b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ORBInitializer.cpp
new file mode 100644
index 00000000000..a1c2b16555c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ORBInitializer.cpp
@@ -0,0 +1,82 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#include "FT_ORBInitializer.h"
+#include "FT_PolicyFactory.h"
+#include "orbsvcs/FT_CORBAC.h"
+#include "tao/Exception.h"
+
+
+ACE_RCSID (FaultTolerance, FT_ORBInitializer, "$Id$")
+void
+TAO_FT_ORBInitializer::pre_init (
+ PortableInterceptor::ORBInitInfo_ptr
+ TAO_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+
+}
+
+void
+TAO_FT_ORBInitializer::post_init (
+ PortableInterceptor::ORBInitInfo_ptr info
+ TAO_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->register_policy_factories (info
+ TAO_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_FT_ORBInitializer::register_policy_factories (
+ PortableInterceptor::ORBInitInfo_ptr info
+ TAO_ENV_ARG_DECL)
+{
+ // Register the FTCORBA policy factories.
+
+ PortableInterceptor::PolicyFactory_ptr temp_factory =
+ PortableInterceptor::PolicyFactory::_nil ();
+ PortableInterceptor::PolicyFactory_var policy_factory;
+
+ TAO_ENV_ARG_DEFN;
+
+ // This policy factory is used for all FTCORBA related policies.
+
+ ACE_NEW_THROW_EX (temp_factory,
+ TAO_FT_PolicyFactory,
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK;
+
+ policy_factory = temp_factory;
+
+ // Bind the same policy factory to all RTCORBA related policy
+ // types since a single policy factory is used to create each of
+ // the different types of RTCORBA policies.
+
+ CORBA::PolicyType type = FT::REQUEST_DURATION_POLICY;
+ info->register_policy_factory (type,
+ policy_factory.in ()
+ TAO_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ type = FT::HEARTBEAT_POLICY;
+ info->register_policy_factory (type,
+ policy_factory.in ()
+ TAO_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ type = FT::HEARTBEAT_ENABLED_POLICY;
+ info->register_policy_factory (type,
+ policy_factory.in ()
+ TAO_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Transfer ownership of the policy factory to the registry.
+ (void) policy_factory._retn ();
+}