summaryrefslogtreecommitdiff
path: root/TAO/tao/Messaging
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tao/Messaging')
-rw-r--r--TAO/tao/Messaging/Messaging_ORBInitializer.cpp41
-rw-r--r--TAO/tao/Messaging/Messaging_PolicyFactory.cpp70
-rw-r--r--TAO/tao/Messaging/Messaging_Policy_i.cpp58
-rw-r--r--TAO/tao/Messaging/Messaging_Policy_i.h2
4 files changed, 73 insertions, 98 deletions
diff --git a/TAO/tao/Messaging/Messaging_ORBInitializer.cpp b/TAO/tao/Messaging/Messaging_ORBInitializer.cpp
index c8cd20ea464..d6980d1c7ef 100644
--- a/TAO/tao/Messaging/Messaging_ORBInitializer.cpp
+++ b/TAO/tao/Messaging/Messaging_ORBInitializer.cpp
@@ -2,13 +2,13 @@
#include "Messaging_ORBInitializer.h"
-
-
#include "Messaging_Policy_i.h"
#include "Messaging_PolicyFactory.h"
#include "tao/ORB_Core.h"
-ACE_RCSID (Messaging, Messaging_ORBInitializer, "$Id$")
+ACE_RCSID (Messaging,
+ Messaging_ORBInitializer,
+ "$Id$")
void
TAO_Messaging_ORBInitializer::pre_init (
@@ -33,7 +33,7 @@ TAO_Messaging_ORBInitializer::post_init (
ACE_THROW_SPEC ((CORBA::SystemException))
{
this->register_policy_factories (info
- ACE_ENV_ARG_PARAMETER);
+ ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
}
@@ -66,27 +66,26 @@ TAO_Messaging_ORBInitializer::register_policy_factories (
// the different types of Messaging policies.
CORBA::PolicyType type[] = {
- TAO_MESSAGING_RELATIVE_RT_TIMEOUT_POLICY_TYPE
- , TAO_MESSAGING_SYNC_SCOPE_POLICY_TYPE
+ Messaging::RELATIVE_RT_TIMEOUT_POLICY_TYPE
+ , Messaging::SYNC_SCOPE_POLICY_TYPE
#if (TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1)
, TAO_BUFFERING_CONSTRAINT_POLICY_TYPE
#endif /* TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1 */
- , TAO_MESSAGING_REBIND_POLICY_TYPE
- , TAO_MESSAGING_REQUEST_PRIORITY_POLICY_TYPE
- , TAO_MESSAGING_REPLY_PRIORITY_POLICY_TYPE
- , TAO_MESSAGING_REQUEST_START_TIME_POLICY_TYPE
- , TAO_MESSAGING_REQUEST_END_TIME_POLICY_TYPE
- , TAO_MESSAGING_REPLY_START_TIME_POLICY_TYPE
- , TAO_MESSAGING_REPLY_END_TIME_POLICY_TYPE
- , TAO_MESSAGING_RELATIVE_REQ_TIMEOUT_POLICY_TYPE
- , TAO_MESSAGING_ROUTING_POLICY_TYPE
- , TAO_MESSAGING_MAX_HOPS_POLICY_TYPE
- , TAO_MESSAGING_QUEUE_ORDER_POLICY_TYPE
+ , Messaging::REBIND_POLICY_TYPE
+ , Messaging::REQUEST_PRIORITY_POLICY_TYPE
+ , Messaging::REPLY_PRIORITY_POLICY_TYPE
+ , Messaging::REQUEST_START_TIME_POLICY_TYPE
+ , Messaging::REQUEST_END_TIME_POLICY_TYPE
+ , Messaging::REPLY_START_TIME_POLICY_TYPE
+ , Messaging::REPLY_END_TIME_POLICY_TYPE
+ , Messaging::RELATIVE_REQ_TIMEOUT_POLICY_TYPE
+ , Messaging::ROUTING_POLICY_TYPE
+ , Messaging::MAX_HOPS_POLICY_TYPE
+ , Messaging::QUEUE_ORDER_POLICY_TYPE
};
- for (CORBA::PolicyType *i = type;
- i != type + sizeof(type)/sizeof(type[0]);
- ++i)
+ const CORBA::PolicyType *end = type + sizeof (type) / sizeof (type[0]);
+ for (CORBA::PolicyType *i = type; i != end; ++i)
{
ACE_TRY
{
@@ -116,5 +115,3 @@ TAO_Messaging_ORBInitializer::register_policy_factories (
ACE_CHECK;
}
}
-
-
diff --git a/TAO/tao/Messaging/Messaging_PolicyFactory.cpp b/TAO/tao/Messaging/Messaging_PolicyFactory.cpp
index 0cae6016abf..cca84d13935 100644
--- a/TAO/tao/Messaging/Messaging_PolicyFactory.cpp
+++ b/TAO/tao/Messaging/Messaging_PolicyFactory.cpp
@@ -1,14 +1,11 @@
-// -*- C++ -*-
-//
-// $Id$
-
#include "Messaging_PolicyFactory.h"
-ACE_RCSID (tao, Messaging_PolicyFactory, "$Id$")
-
-
+ACE_RCSID (tao,
+ Messaging_PolicyFactory,
+ "$Id$")
#include "Messaging_Policy_i.h"
+
#include "tao/PolicyC.h"
#include "tao/Buffering_Constraint_Policy.h"
@@ -20,52 +17,37 @@ TAO_Messaging_PolicyFactory::create_policy (
ACE_THROW_SPEC ((CORBA::SystemException,
CORBA::PolicyError))
{
- switch (type)
- {
-
#if (TAO_HAS_RELATIVE_ROUNDTRIP_TIMEOUT_POLICY == 1)
-
- case TAO_MESSAGING_RELATIVE_RT_TIMEOUT_POLICY_TYPE:
- return TAO_RelativeRoundtripTimeoutPolicy::create (
- value
- ACE_ENV_ARG_PARAMETER);
-
+ if (type == Messaging::RELATIVE_RT_TIMEOUT_POLICY_TYPE)
+ return TAO_RelativeRoundtripTimeoutPolicy::create (value
+ ACE_ENV_ARG_PARAMETER);
#endif /* TAO_HAS_RELATIVE_ROUNDTRIP_TIMEOUT_POLICY == 1 */
-
#if (TAO_HAS_SYNC_SCOPE_POLICY == 1)
-
- case TAO_MESSAGING_SYNC_SCOPE_POLICY_TYPE:
- return TAO_Sync_Scope_Policy::create (value
- ACE_ENV_ARG_PARAMETER);
-
+ if (type == Messaging::SYNC_SCOPE_POLICY_TYPE)
+ return TAO_Sync_Scope_Policy::create (value
+ ACE_ENV_ARG_PARAMETER);
#endif /* TAO_HAS_SYNC_SCOPE_POLICY == 1 */
#if (TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1)
-
- case TAO_BUFFERING_CONSTRAINT_POLICY_TYPE:
- return TAO_Buffering_Constraint_Policy::create (value
- ACE_ENV_ARG_PARAMETER);
-
+ if (type == TAO_BUFFERING_CONSTRAINT_POLICY_TYPE)
+ return TAO_Buffering_Constraint_Policy::create (value
+ ACE_ENV_ARG_PARAMETER);
#endif /* TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1 */
- case TAO_MESSAGING_REBIND_POLICY_TYPE:
- case TAO_MESSAGING_REQUEST_PRIORITY_POLICY_TYPE:
- case TAO_MESSAGING_REPLY_PRIORITY_POLICY_TYPE:
- case TAO_MESSAGING_REQUEST_START_TIME_POLICY_TYPE:
- case TAO_MESSAGING_REQUEST_END_TIME_POLICY_TYPE:
- case TAO_MESSAGING_REPLY_START_TIME_POLICY_TYPE:
- case TAO_MESSAGING_REPLY_END_TIME_POLICY_TYPE:
- case TAO_MESSAGING_RELATIVE_REQ_TIMEOUT_POLICY_TYPE:
- case TAO_MESSAGING_ROUTING_POLICY_TYPE:
- case TAO_MESSAGING_MAX_HOPS_POLICY_TYPE:
- case TAO_MESSAGING_QUEUE_ORDER_POLICY_TYPE:
- ACE_THROW_RETURN (CORBA::PolicyError (CORBA::UNSUPPORTED_POLICY),
- CORBA::Policy::_nil ());
-
- default:
- break;
- }
+ if (type == Messaging::REBIND_POLICY_TYPE
+ || type == Messaging::REQUEST_PRIORITY_POLICY_TYPE
+ || type == Messaging::REPLY_PRIORITY_POLICY_TYPE
+ || type == Messaging::REQUEST_START_TIME_POLICY_TYPE
+ || type == Messaging::REQUEST_END_TIME_POLICY_TYPE
+ || type == Messaging::REPLY_START_TIME_POLICY_TYPE
+ || type == Messaging::REPLY_END_TIME_POLICY_TYPE
+ || type == Messaging::RELATIVE_REQ_TIMEOUT_POLICY_TYPE
+ || type == Messaging::ROUTING_POLICY_TYPE
+ || type == Messaging::MAX_HOPS_POLICY_TYPE
+ || type == Messaging::QUEUE_ORDER_POLICY_TYPE)
+ ACE_THROW_RETURN (CORBA::PolicyError (CORBA::UNSUPPORTED_POLICY),
+ CORBA::Policy::_nil ());
ACE_UNUSED_ARG (value);
diff --git a/TAO/tao/Messaging/Messaging_Policy_i.cpp b/TAO/tao/Messaging/Messaging_Policy_i.cpp
index 6db2b579946..06de6392af9 100644
--- a/TAO/tao/Messaging/Messaging_Policy_i.cpp
+++ b/TAO/tao/Messaging/Messaging_Policy_i.cpp
@@ -4,7 +4,9 @@
#include "tao/Stub.h"
#include "tao/debug.h"
-ACE_RCSID(TAO, Messaging_Policy_i, "$Id$")
+ACE_RCSID (TAO,
+ Messaging_Policy_i,
+ "$Id$")
#if (TAO_HAS_RELATIVE_ROUNDTRIP_TIMEOUT_POLICY == 1)
@@ -12,12 +14,14 @@ ACE_RCSID(TAO, Messaging_Policy_i, "$Id$")
#include "tao/Messaging/Messaging_Policy_i.i"
#endif /* __ACE_INLINE__ */
-TAO_RelativeRoundtripTimeoutPolicy::TAO_RelativeRoundtripTimeoutPolicy (const TimeBase::TimeT& relative_expiry)
+TAO_RelativeRoundtripTimeoutPolicy::TAO_RelativeRoundtripTimeoutPolicy (
+ const TimeBase::TimeT& relative_expiry)
: relative_expiry_ (relative_expiry)
{
}
-TAO_RelativeRoundtripTimeoutPolicy::TAO_RelativeRoundtripTimeoutPolicy (const TAO_RelativeRoundtripTimeoutPolicy &rhs)
+TAO_RelativeRoundtripTimeoutPolicy::TAO_RelativeRoundtripTimeoutPolicy (
+ const TAO_RelativeRoundtripTimeoutPolicy &rhs)
: Messaging::RelativeRoundtripTimeoutPolicy (),
TAO_Local_RefCounted_Object (),
relative_expiry_ (rhs.relative_expiry_)
@@ -25,19 +29,19 @@ TAO_RelativeRoundtripTimeoutPolicy::TAO_RelativeRoundtripTimeoutPolicy (const TA
}
TimeBase::TimeT
-TAO_RelativeRoundtripTimeoutPolicy::relative_expiry (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+TAO_RelativeRoundtripTimeoutPolicy::relative_expiry (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException))
{
return this->relative_expiry_;
}
CORBA::PolicyType
-TAO_RelativeRoundtripTimeoutPolicy::policy_type (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+TAO_RelativeRoundtripTimeoutPolicy::policy_type (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException))
{
- // Future policy implementors: notice how this minimizes the
- // footprint of the class.
- return TAO_MESSAGING_RELATIVE_RT_TIMEOUT_POLICY_TYPE;
+ return Messaging::RELATIVE_RT_TIMEOUT_POLICY_TYPE;
}
void
@@ -46,12 +50,10 @@ TAO_RelativeRoundtripTimeoutPolicy::hook (TAO_ORB_Core *orb_core,
int &has_timeout,
ACE_Time_Value &time_value)
{
- CORBA::Policy_var policy = 0;
-
- if (stub == 0)
- policy = orb_core->stubless_relative_roundtrip_timeout ();
- else
- policy = stub->relative_roundtrip_timeout ();
+ CORBA::Policy_var policy =
+ (stub == 0
+ ? orb_core->stubless_relative_roundtrip_timeout ()
+ : stub->relative_roundtrip_timeout ());
if (CORBA::is_nil (policy.in ()))
{
@@ -61,8 +63,9 @@ TAO_RelativeRoundtripTimeoutPolicy::hook (TAO_ORB_Core *orb_core,
ACE_TRY_NEW_ENV
{
Messaging::RelativeRoundtripTimeoutPolicy_var p =
- Messaging::RelativeRoundtripTimeoutPolicy::_narrow (policy.in ()
- ACE_ENV_ARG_PARAMETER);
+ Messaging::RelativeRoundtripTimeoutPolicy::_narrow (
+ policy.in ()
+ ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
TimeBase::TimeT t = p->relative_expiry (ACE_ENV_SINGLE_ARG_PARAMETER);
@@ -78,13 +81,13 @@ TAO_RelativeRoundtripTimeoutPolicy::hook (TAO_ORB_Core *orb_core,
if (TAO_debug_level > 0)
{
CORBA::ULong msecs =
- ACE_static_cast(CORBA::ULong, microseconds / 1000);
+ ACE_static_cast (CORBA::ULong, microseconds / 1000);
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("TAO (%P|%t) Timeout is <%u>\n"),
msecs));
}
}
- ACE_CATCH (CORBA::Exception, ex)
+ ACE_CATCHANY
{
// Ignore all exceptions...
}
@@ -198,18 +201,10 @@ void
TAO_Sync_Scope_Policy::hook (TAO_ORB_Core *orb_core,
TAO_Stub *stub,
int &has_synchronization,
- int &scope)
+ Messaging::SyncScope &scope)
{
- CORBA::Policy_var policy;
-
- if (stub == 0)
- {
- CORBA::Policy_ptr tmp;
- orb_core->stubless_sync_scope (tmp);
- policy = tmp;
- }
- else
- policy = stub->sync_scope ();
+ CORBA::Policy_var policy =
+ (stub == 0 ? orb_core->stubless_sync_scope () : stub->sync_scope ());
if (CORBA::is_nil (policy.in ()))
{
@@ -231,9 +226,10 @@ TAO_Sync_Scope_Policy::hook (TAO_ORB_Core *orb_core,
CORBA::COMPLETED_NO));
has_synchronization = 1;
- scope = p->synchronization ();
+ scope = p->synchronization (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
}
- ACE_CATCH (CORBA::Exception, ex)
+ ACE_CATCHANY
{
// Ignore all exceptions...
}
diff --git a/TAO/tao/Messaging/Messaging_Policy_i.h b/TAO/tao/Messaging/Messaging_Policy_i.h
index 23b3d5772f9..8dba81af5b9 100644
--- a/TAO/tao/Messaging/Messaging_Policy_i.h
+++ b/TAO/tao/Messaging/Messaging_Policy_i.h
@@ -113,7 +113,7 @@ public:
static void hook (TAO_ORB_Core *orb_core,
TAO_Stub *stub,
int &has_synchronization,
- int &scope);
+ Messaging::SyncScope &scope);
/// Helper method for the implementation of
/// CORBA::ORB::create_policy.