summaryrefslogtreecommitdiff
path: root/TAO/tests/RTCORBA/Profile_And_Endpoint_Selection/client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tests/RTCORBA/Profile_And_Endpoint_Selection/client.cpp')
-rw-r--r--TAO/tests/RTCORBA/Profile_And_Endpoint_Selection/client.cpp225
1 files changed, 71 insertions, 154 deletions
diff --git a/TAO/tests/RTCORBA/Profile_And_Endpoint_Selection/client.cpp b/TAO/tests/RTCORBA/Profile_And_Endpoint_Selection/client.cpp
index 61acf71eab9..e7db2d0dbcc 100644
--- a/TAO/tests/RTCORBA/Profile_And_Endpoint_Selection/client.cpp
+++ b/TAO/tests/RTCORBA/Profile_And_Endpoint_Selection/client.cpp
@@ -105,20 +105,17 @@ public:
RTCORBA::RTORB_ptr rt_orb,
CORBA::PolicyManager_ptr policy_manager);
- void vanilla_invocations (ACE_ENV_SINGLE_ARG_DECL);
+ void vanilla_invocations (void);
- void priority_invocations (int debug
- ACE_ENV_ARG_DECL);
+ void priority_invocations (int debug);
- void set_client_protocols_policies (int debug
- ACE_ENV_ARG_DECL);
+ void set_client_protocols_policies (int debug);
- void set_priority_bands (int debug
- ACE_ENV_ARG_DECL);
+ void set_priority_bands (int debug);
- void set_private_connection_policies (ACE_ENV_SINGLE_ARG_DECL);
+ void set_private_connection_policies (void);
- void reset_policies (ACE_ENV_SINGLE_ARG_DECL);
+ void reset_policies (void);
private:
@@ -142,7 +139,7 @@ public:
int svc (void);
- void validate_connection (ACE_ENV_SINGLE_ARG_DECL);
+ void validate_connection (void);
private:
Client client_;
@@ -165,7 +162,7 @@ Worker_Thread::Worker_Thread (ACE_Thread_Manager &thread_manager,
}
void
-Worker_Thread::validate_connection (ACE_ENV_SINGLE_ARG_DECL)
+Worker_Thread::validate_connection (void)
{
// Try to validate the connection several times, ignoring transient
// exceptions. If the connection can still not be setup, return
@@ -175,54 +172,44 @@ Worker_Thread::validate_connection (ACE_ENV_SINGLE_ARG_DECL)
int current_attempt = 0;
for (;;)
{
- ACE_TRY
+ try
{
++current_attempt;
- this->test_->_validate_connection (inconsistent_policies.out ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ this->test_->_validate_connection (inconsistent_policies.out ());
// If successful, we are done.
return;
}
- ACE_CATCH (CORBA::TRANSIENT, exception)
+ catch (const CORBA::TRANSIENT& )
{
// If we have reach our maximum number of tries, throw exception.
if (current_attempt == max_attempts)
- ACE_RE_THROW;
+ throw;
// Otherwise, ignore...
}
- ACE_CATCHANY
+ catch (const CORBA::Exception&)
{
// Rethrow any other exceptions.
- ACE_RE_THROW;
+ throw;
}
- ACE_ENDTRY;
- ACE_CHECK;
}
}
int
Worker_Thread::svc (void)
{
- ACE_TRY_NEW_ENV
+ try
{
- this->current_->the_priority (this->priority_
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ this->current_->the_priority (this->priority_);
- this->validate_connection (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ this->validate_connection ();
- this->client_.vanilla_invocations (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ this->client_.vanilla_invocations ();
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- "Worker Thread exception:");
+ ex._tao_print_exception ("Worker Thread exception:");
}
- ACE_ENDTRY;
return 0;
}
@@ -240,18 +227,16 @@ Client::Client (test_ptr test,
}
void
-Client::vanilla_invocations (ACE_ENV_SINGLE_ARG_DECL)
+Client::vanilla_invocations (void)
{
for (int i = 0; i < iterations; i++)
{
- this->test_->method (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK;
+ this->test_->method ();
}
}
void
-Client::priority_invocations (int debug
- ACE_ENV_ARG_DECL)
+Client::priority_invocations (int debug)
{
ULong_Array priorities;
int result =
@@ -317,8 +302,7 @@ Client::priority_invocations (int debug
}
void
-Client::set_client_protocols_policies (int debug
- ACE_ENV_ARG_DECL)
+Client::set_client_protocols_policies (int debug)
{
CORBA::PolicyList policies;
@@ -327,9 +311,7 @@ Client::set_client_protocols_policies (int debug
protocols_file,
this->rt_orb_.in (),
policies,
- debug
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
+ debug);
if (result != 0)
{
ACE_ERROR ((LM_ERROR,
@@ -339,14 +321,11 @@ Client::set_client_protocols_policies (int debug
}
this->policy_manager_->set_policy_overrides (policies,
- CORBA::ADD_OVERRIDE
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
+ CORBA::ADD_OVERRIDE);
}
void
-Client::set_priority_bands (int debug
- ACE_ENV_ARG_DECL)
+Client::set_priority_bands (int debug)
{
CORBA::PolicyList policies;
@@ -355,9 +334,7 @@ Client::set_priority_bands (int debug
bands_file,
this->rt_orb_.in (),
policies,
- debug
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
+ debug);
if (result != 0)
{
ACE_ERROR ((LM_ERROR,
@@ -367,36 +344,29 @@ Client::set_priority_bands (int debug
}
this->policy_manager_->set_policy_overrides (policies,
- CORBA::ADD_OVERRIDE
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
+ CORBA::ADD_OVERRIDE);
}
void
-Client::set_private_connection_policies (ACE_ENV_SINGLE_ARG_DECL)
+Client::set_private_connection_policies (void)
{
CORBA::PolicyList policies;
policies.length (1);
policies[0] =
- this->rt_orb_->create_private_connection_policy (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK;
+ this->rt_orb_->create_private_connection_policy ();
this->policy_manager_->set_policy_overrides (policies,
- CORBA::ADD_OVERRIDE
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
+ CORBA::ADD_OVERRIDE);
}
void
-Client::reset_policies (ACE_ENV_SINGLE_ARG_DECL)
+Client::reset_policies (void)
{
CORBA::PolicyList empty_policies;
this->policy_manager_->set_policy_overrides (empty_policies,
- CORBA::SET_OVERRIDE
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
+ CORBA::SET_OVERRIDE);
}
class Task : public ACE_Task_Base
@@ -422,51 +392,33 @@ Task::Task (ACE_Thread_Manager &thread_manager,
int
Task::svc (void)
{
- ACE_TRY_NEW_ENV
+ try
{
CORBA::Object_var object =
- this->orb_->resolve_initial_references ("RTORB"
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ this->orb_->resolve_initial_references ("RTORB");
RTCORBA::RTORB_var rt_orb =
- RTCORBA::RTORB::_narrow (object.in ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ RTCORBA::RTORB::_narrow (object.in ());
object =
- this->orb_->resolve_initial_references ("ORBPolicyManager"
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ this->orb_->resolve_initial_references ("ORBPolicyManager");
CORBA::PolicyManager_var policy_manager =
- CORBA::PolicyManager::_narrow (object.in ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ CORBA::PolicyManager::_narrow (object.in ());
object =
- this->orb_->resolve_initial_references ("RTCurrent"
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ this->orb_->resolve_initial_references ("RTCurrent");
RTCORBA::Current_var current =
- RTCORBA::Current::_narrow (object.in ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ RTCORBA::Current::_narrow (object.in ());
- current->the_priority (0
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ current->the_priority (0);
object =
- this->orb_->string_to_object (ior
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ this->orb_->string_to_object (ior);
test_var test =
- test::_narrow (object.in ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ test::_narrow (object.in ());
Client client (test.in (),
this->orb_.in (),
@@ -474,86 +426,56 @@ Task::svc (void)
rt_orb.in (),
policy_manager.in ());
- client.vanilla_invocations (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ client.vanilla_invocations ();
- client.set_private_connection_policies (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ client.set_private_connection_policies ();
- client.vanilla_invocations (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ client.vanilla_invocations ();
- client.reset_policies (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ client.reset_policies ();
- client.set_client_protocols_policies (debug
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ client.set_client_protocols_policies (debug);
- client.vanilla_invocations (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ client.vanilla_invocations ();
- client.set_private_connection_policies (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ client.set_private_connection_policies ();
- client.vanilla_invocations (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ client.vanilla_invocations ();
- client.reset_policies (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ client.reset_policies ();
- client.set_priority_bands (debug
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ client.set_priority_bands (debug);
- client.priority_invocations (debug
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ client.priority_invocations (debug);
- client.set_private_connection_policies (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ client.set_private_connection_policies ();
- client.priority_invocations (debug
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ client.priority_invocations (debug);
- client.reset_policies (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ client.reset_policies ();
- client.set_priority_bands (debug
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ client.set_priority_bands (debug);
- client.set_client_protocols_policies (0
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ client.set_client_protocols_policies (0);
- client.priority_invocations (0
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ client.priority_invocations (0);
- client.set_private_connection_policies (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ client.set_private_connection_policies ();
- client.priority_invocations (debug
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ client.priority_invocations (debug);
- client.reset_policies (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ client.reset_policies ();
if (shutdown_server)
{
- test->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ test->shutdown ();
}
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Error!");
+ ex._tao_print_exception ("Error!");
return -1;
}
- ACE_ENDTRY;
return 0;
}
@@ -561,16 +483,13 @@ Task::svc (void)
int
main (int argc, char **argv)
{
- ACE_DECLARE_NEW_CORBA_ENV;
- ACE_TRY
+ try
{
CORBA::ORB_var orb =
CORBA::ORB_init (argc,
argv,
- 0
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ 0);
int parse_args_result =
parse_args (argc, argv);
@@ -619,13 +538,11 @@ main (int argc, char **argv)
thread_manager.wait ();
ACE_ASSERT (result != -1);
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Error!");
+ ex._tao_print_exception ("Error!");
return -1;
}
- ACE_ENDTRY;
- ACE_CHECK_RETURN (-1);
return 0;
}