summaryrefslogtreecommitdiff
path: root/TAO/tao/RTCORBA/RT_PolicyFactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tao/RTCORBA/RT_PolicyFactory.cpp')
-rw-r--r--TAO/tao/RTCORBA/RT_PolicyFactory.cpp55
1 files changed, 55 insertions, 0 deletions
diff --git a/TAO/tao/RTCORBA/RT_PolicyFactory.cpp b/TAO/tao/RTCORBA/RT_PolicyFactory.cpp
index 2e70d3f933d..086b162c0b6 100644
--- a/TAO/tao/RTCORBA/RT_PolicyFactory.cpp
+++ b/TAO/tao/RTCORBA/RT_PolicyFactory.cpp
@@ -45,3 +45,58 @@ TAO_RT_PolicyFactory::create_policy (
ACE_THROW_RETURN (CORBA::PolicyError (CORBA::BAD_POLICY_TYPE),
CORBA::Policy::_nil ());
}
+
+CORBA::Policy_ptr
+TAO_RT_PolicyFactory::_create_policy (
+ CORBA::PolicyType type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CORBA::PolicyError))
+{
+ CORBA::Policy_ptr policy = CORBA::Policy::_nil ();
+
+ if (type == RTCORBA::PRIORITY_MODEL_POLICY_TYPE)
+ {
+ ACE_NEW_THROW_EX (policy,
+ TAO_PriorityModelPolicy,
+ CORBA::NO_MEMORY (
+ CORBA_SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (CORBA::Policy::_nil ());
+
+ return policy;
+ }
+
+ if (type == RTCORBA::PRIORITY_BANDED_CONNECTION_POLICY_TYPE)
+ {
+ ACE_NEW_THROW_EX (policy,
+ TAO_PriorityBandedConnectionPolicy,
+ CORBA::NO_MEMORY (
+ CORBA_SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (CORBA::Policy::_nil ());
+
+ return policy;
+ }
+
+ if (type == RTCORBA::CLIENT_PROTOCOL_POLICY_TYPE)
+ {
+ ACE_NEW_THROW_EX (policy,
+ TAO_ClientProtocolPolicy,
+ CORBA::NO_MEMORY (
+ CORBA_SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (CORBA::Policy::_nil ());
+
+ return policy;
+ }
+
+ ACE_THROW_RETURN (CORBA::PolicyError (CORBA::BAD_POLICY_TYPE),
+ CORBA::Policy::_nil ());
+}