summaryrefslogtreecommitdiff
path: root/TAO/tests/Big_Oneways
diff options
context:
space:
mode:
authorelliott_c <elliott_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-01-25 18:17:52 +0000
committerelliott_c <elliott_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-01-25 18:17:52 +0000
commit2ee7b7eed4c0cc10f4ec25b186b04202af01b565 (patch)
tree08a8a649c90559cf5b2228c1caad15515902613e /TAO/tests/Big_Oneways
parentc979767a00db4ea1299af482033a68829cc16675 (diff)
downloadATCD-2ee7b7eed4c0cc10f4ec25b186b04202af01b565.tar.gz
ChangeLogTag: Thu Jan 25 17:39:59 UTC 2007 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'TAO/tests/Big_Oneways')
-rw-r--r--TAO/tests/Big_Oneways/Coordinator.cpp17
-rw-r--r--TAO/tests/Big_Oneways/Coordinator.h6
-rw-r--r--TAO/tests/Big_Oneways/Peer.cpp5
-rw-r--r--TAO/tests/Big_Oneways/Peer.h3
-rw-r--r--TAO/tests/Big_Oneways/Session.cpp59
-rw-r--r--TAO/tests/Big_Oneways/Session.h9
-rw-r--r--TAO/tests/Big_Oneways/Session_Control.cpp7
-rw-r--r--TAO/tests/Big_Oneways/Session_Control.h3
-rw-r--r--TAO/tests/Big_Oneways/client.cpp22
-rw-r--r--TAO/tests/Big_Oneways/server.cpp28
10 files changed, 63 insertions, 96 deletions
diff --git a/TAO/tests/Big_Oneways/Coordinator.cpp b/TAO/tests/Big_Oneways/Coordinator.cpp
index 1cc9653db42..1cad2f4c83d 100644
--- a/TAO/tests/Big_Oneways/Coordinator.cpp
+++ b/TAO/tests/Big_Oneways/Coordinator.cpp
@@ -29,8 +29,7 @@ Coordinator::create_session_list (Test::Session_Control_ptr session_control,
CORBA::ULong payload_size,
CORBA::ULong thread_count,
CORBA::ULong message_count,
- Test::Session_List &session_list
- ACE_ENV_ARG_DECL)
+ Test::Session_List &session_list)
{
session_list.length (this->peer_count_);
CORBA::ULong count = 0;
@@ -43,8 +42,7 @@ Coordinator::create_session_list (Test::Session_Control_ptr session_control,
payload_size,
thread_count,
message_count,
- this->peer_count_
- ACE_ENV_ARG_PARAMETER);
+ this->peer_count_);
}
}
@@ -55,22 +53,19 @@ Coordinator::shutdown_all_peers (void)
i != this->peers_ + this->peer_count_;
++i)
{
- ACE_TRY
+ try
{
(*i)->shutdown ();
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- "Coordinator::shutdown, ignored");
+ ex._tao_print_exception ("Coordinator::shutdown, ignored");
}
- ACE_ENDTRY;
}
}
void
-Coordinator::add_peer (Test::Peer_ptr peer
- ACE_ENV_ARG_DECL_NOT_USED)
+Coordinator::add_peer (Test::Peer_ptr peer)
ACE_THROW_SPEC ((CORBA::SystemException))
{
if (this->peer_count_ >= this->peer_max_)
diff --git a/TAO/tests/Big_Oneways/Coordinator.h b/TAO/tests/Big_Oneways/Coordinator.h
index ae490a3fea2..76bd88d5fa8 100644
--- a/TAO/tests/Big_Oneways/Coordinator.h
+++ b/TAO/tests/Big_Oneways/Coordinator.h
@@ -25,15 +25,13 @@ public:
CORBA::ULong payload_size,
CORBA::ULong thread_count,
CORBA::ULong message_count,
- Test::Session_List &session_list
- ACE_ENV_ARG_DECL);
+ Test::Session_List &session_list);
/// Shutdown all the peers
void shutdown_all_peers (void);
// = The skeleton methods
- virtual void add_peer (Test::Peer_ptr peer
- ACE_ENV_ARG_DECL)
+ virtual void add_peer (Test::Peer_ptr peer)
ACE_THROW_SPEC ((CORBA::SystemException));
protected:
diff --git a/TAO/tests/Big_Oneways/Peer.cpp b/TAO/tests/Big_Oneways/Peer.cpp
index 4827594d14f..d6d4077ac20 100644
--- a/TAO/tests/Big_Oneways/Peer.cpp
+++ b/TAO/tests/Big_Oneways/Peer.cpp
@@ -20,8 +20,7 @@ Peer::create_session (Test::Session_Control_ptr control,
CORBA::ULong payload_size,
CORBA::ULong thread_count,
CORBA::ULong message_count,
- CORBA::ULong peer_count
- ACE_ENV_ARG_DECL)
+ CORBA::ULong peer_count)
ACE_THROW_SPEC ((CORBA::SystemException))
{
Session *session_impl = 0;
@@ -46,5 +45,5 @@ Peer::shutdown (void)
ACE_DEBUG ((LM_DEBUG,
"(%P|%t) Peer::shutdown, shutting down ORB\n"));
- this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+ this->orb_->shutdown (0);
}
diff --git a/TAO/tests/Big_Oneways/Peer.h b/TAO/tests/Big_Oneways/Peer.h
index d3faaf28db4..8f2d18e8445 100644
--- a/TAO/tests/Big_Oneways/Peer.h
+++ b/TAO/tests/Big_Oneways/Peer.h
@@ -24,8 +24,7 @@ public:
CORBA::ULong payload_size,
CORBA::ULong thread_count,
CORBA::ULong message_count,
- CORBA::ULong peer_count
- ACE_ENV_ARG_DECL)
+ CORBA::ULong peer_count)
ACE_THROW_SPEC ((CORBA::SystemException));
virtual void shutdown (void)
ACE_THROW_SPEC ((CORBA::SystemException));
diff --git a/TAO/tests/Big_Oneways/Session.cpp b/TAO/tests/Big_Oneways/Session.cpp
index 5a46073900d..752850ac50d 100644
--- a/TAO/tests/Big_Oneways/Session.cpp
+++ b/TAO/tests/Big_Oneways/Session.cpp
@@ -33,8 +33,7 @@ Session::svc (void)
this->barrier_.wait ();
CORBA::ULong i = 0;
- ACE_DECLARE_NEW_CORBA_ENV;
- ACE_TRY
+ try
{
// Use the same payload over and over
Test::Payload payload (this->payload_size_);
@@ -64,8 +63,7 @@ Session::svc (void)
#endif /* 0 */
for (CORBA::ULong j = 0; j != session_count; ++j)
{
- this->other_sessions_[j]->receive_payload (payload
- ACE_ENV_ARG_PARAMETER);
+ this->other_sessions_[j]->receive_payload (payload);
}
}
@@ -77,18 +75,17 @@ Session::svc (void)
return 0;
}
}
- this->terminate (1 ACE_ENV_ARG_PARAMETER);
+ this->terminate (1);
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
ACE_ERROR ((LM_ERROR,
"(%P|%t) ERROR: Session::svc, "
"send %d messages out of %d\n",
i, message_count_));
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Session::svc - ");
+ ex._tao_print_exception ("Session::svc - ");
return -1;
}
- ACE_ENDTRY;
this->_remove_ref ();
@@ -104,32 +101,30 @@ Session::validate_connections (void)
{
for (CORBA::ULong j = 0; j != session_count; ++j)
{
- ACE_TRY
+ try
{
this->other_sessions_[j]->ping ();
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
}
- ACE_ENDTRY;
}
}
}
void
-Session::start (const Test::Session_List &other_sessions
- ACE_ENV_ARG_DECL)
+Session::start (const Test::Session_List &other_sessions)
ACE_THROW_SPEC ((CORBA::SystemException,
Test::Already_Running,
Test::No_Peers))
{
if (other_sessions.length () == 0)
- ACE_THROW (Test::No_Peers ());
+ throw Test::No_Peers ();
{
ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->mutex_);
if (this->running_)
- ACE_THROW (Test::Already_Running ());
+ throw Test::Already_Running ();
this->other_sessions_ = other_sessions;
@@ -137,7 +132,7 @@ Session::start (const Test::Session_List &other_sessions
{
// Increase the reference count because the new thread will have
// access to this object....
- ACE_TRY
+ try
{
this->_add_ref ();
@@ -152,12 +147,10 @@ Session::start (const Test::Session_List &other_sessions
this->active_thread_count_++;
}
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- "Session::start, ignored");
+ ex._tao_print_exception ("Session::start, ignored");
}
- ACE_ENDTRY;
}
if (this->active_thread_count_ != this->thread_count_)
@@ -173,7 +166,7 @@ Session::start (const Test::Session_List &other_sessions
/// None of the threads are running, this session is useless at
/// this point, report the problem and destroy the local objects
- this->terminate (0 ACE_ENV_ARG_PARAMETER);
+ this->terminate (0);
}
void
@@ -182,8 +175,7 @@ Session::ping (void) ACE_THROW_SPEC ((CORBA::SystemException))
}
void
-Session::receive_payload (const Test::Payload &the_payload
- ACE_ENV_ARG_DECL)
+Session::receive_payload (const Test::Payload &the_payload)
ACE_THROW_SPEC ((CORBA::SystemException))
{
if (the_payload.length () != this->payload_size_)
@@ -220,7 +212,7 @@ Session::receive_payload (const Test::Payload &the_payload
if (this->more_work ())
return;
}
- this->terminate (1 ACE_ENV_ARG_PARAMETER);
+ this->terminate (1);
}
@@ -233,8 +225,8 @@ Session::destroy (void)
PortableServer::POA_var poa =
this->_default_POA ();
PortableServer::ObjectId_var oid =
- poa->servant_to_id (this ACE_ENV_ARG_PARAMETER);
- poa->deactivate_object (oid.in () ACE_ENV_ARG_PARAMETER);
+ poa->servant_to_id (this);
+ poa->deactivate_object (oid.in ());
}
int
@@ -249,22 +241,17 @@ Session::more_work (void) const
}
void
-Session::terminate (CORBA::Boolean success
- ACE_ENV_ARG_DECL)
+Session::terminate (CORBA::Boolean success)
ACE_THROW_SPEC (())
{
// Make sure that global resources are released
- ACE_TRY_EX(GLOBAL)
+ try
{
- this->control_->session_finished (success
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK_EX(GLOBAL);
+ this->control_->session_finished (success);
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- "Session::terminate, ignored");
+ ex._tao_print_exception ("Session::terminate, ignored");
}
- ACE_ENDTRY;
}
diff --git a/TAO/tests/Big_Oneways/Session.h b/TAO/tests/Big_Oneways/Session.h
index 13577bbce93..8dc4dcaafab 100644
--- a/TAO/tests/Big_Oneways/Session.h
+++ b/TAO/tests/Big_Oneways/Session.h
@@ -35,8 +35,7 @@ public:
int svc (void);
// = The skeleton methods
- virtual void start (const Test::Session_List &other_sessions
- ACE_ENV_ARG_DECL)
+ virtual void start (const Test::Session_List &other_sessions)
ACE_THROW_SPEC ((CORBA::SystemException,
Test::Already_Running,
Test::No_Peers));
@@ -44,8 +43,7 @@ public:
virtual void ping (void)
ACE_THROW_SPEC ((CORBA::SystemException));
- virtual void receive_payload (const Test::Payload &the_payload
- ACE_ENV_ARG_DECL)
+ virtual void receive_payload (const Test::Payload &the_payload)
ACE_THROW_SPEC ((CORBA::SystemException));
virtual void destroy (void)
@@ -54,8 +52,7 @@ public:
private:
/// Helper function used to report any problems and destroy local
/// resources
- void terminate (CORBA::Boolean success
- ACE_ENV_ARG_DECL)
+ void terminate (CORBA::Boolean success)
ACE_THROW_SPEC (());
/// Return 1 if all the work in this session has been completed
diff --git a/TAO/tests/Big_Oneways/Session_Control.cpp b/TAO/tests/Big_Oneways/Session_Control.cpp
index f34179bc9bb..fdd01686c9d 100644
--- a/TAO/tests/Big_Oneways/Session_Control.cpp
+++ b/TAO/tests/Big_Oneways/Session_Control.cpp
@@ -41,8 +41,7 @@ Session_Control::~Session_Control (void)
}
void
-Session_Control::session_finished (CORBA::Boolean success
- ACE_ENV_ARG_DECL)
+Session_Control::session_finished (CORBA::Boolean success)
ACE_THROW_SPEC ((CORBA::SystemException))
{
ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->mutex_);
@@ -65,8 +64,8 @@ Session_Control::session_finished (CORBA::Boolean success
PortableServer::POA_var poa =
this->_default_POA ();
PortableServer::ObjectId_var oid =
- poa->servant_to_id (this ACE_ENV_ARG_PARAMETER);
- poa->deactivate_object (oid.in () ACE_ENV_ARG_PARAMETER);
+ poa->servant_to_id (this);
+ poa->deactivate_object (oid.in ());
}
}
diff --git a/TAO/tests/Big_Oneways/Session_Control.h b/TAO/tests/Big_Oneways/Session_Control.h
index 2f0232be6d8..3e12b1df5e1 100644
--- a/TAO/tests/Big_Oneways/Session_Control.h
+++ b/TAO/tests/Big_Oneways/Session_Control.h
@@ -26,8 +26,7 @@ public:
int all_sessions_finished (void) const;
// = The skeleton methods
- virtual void session_finished (CORBA::Boolean success
- ACE_ENV_ARG_DECL)
+ virtual void session_finished (CORBA::Boolean success)
ACE_THROW_SPEC ((CORBA::SystemException));
private:
diff --git a/TAO/tests/Big_Oneways/client.cpp b/TAO/tests/Big_Oneways/client.cpp
index 6c93cc0348e..ff908dc6fc9 100644
--- a/TAO/tests/Big_Oneways/client.cpp
+++ b/TAO/tests/Big_Oneways/client.cpp
@@ -37,16 +37,16 @@ parse_args (int argc, char *argv[])
int
main (int argc, char *argv[])
{
- ACE_TRY_NEW_ENV
+ try
{
CORBA::ORB_var orb =
- CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ CORBA::ORB_init (argc, argv, "");
CORBA::Object_var poa_object =
- orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
+ orb->resolve_initial_references("RootPOA");
PortableServer::POA_var root_poa =
- PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER);
+ PortableServer::POA::_narrow (poa_object.in ());
if (CORBA::is_nil (poa_object.in ()))
ACE_ERROR_RETURN ((LM_ERROR,
@@ -60,10 +60,10 @@ main (int argc, char *argv[])
return 1;
CORBA::Object_var tmp =
- orb->string_to_object(ior ACE_ENV_ARG_PARAMETER);
+ orb->string_to_object(ior);
Test::Coordinator_var coordinator =
- Test::Coordinator::_narrow(tmp.in () ACE_ENV_ARG_PARAMETER);
+ Test::Coordinator::_narrow(tmp.in ());
if (CORBA::is_nil (coordinator.in ()))
{
@@ -84,24 +84,22 @@ main (int argc, char *argv[])
poa_manager->activate ();
- coordinator->add_peer (peer.in () ACE_ENV_ARG_PARAMETER);
+ coordinator->add_peer (peer.in ());
orb->run ();
// Wait for all the threads.
ACE_Thread_Manager::instance ()->wait ();
- root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ root_poa->destroy (1, 1);
orb->destroy ();
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- "Exception caught:");
+ ex._tao_print_exception ("Exception caught:");
return 1;
}
- ACE_ENDTRY;
return 0;
}
diff --git a/TAO/tests/Big_Oneways/server.cpp b/TAO/tests/Big_Oneways/server.cpp
index 35d83b375e1..55a4cbdef12 100644
--- a/TAO/tests/Big_Oneways/server.cpp
+++ b/TAO/tests/Big_Oneways/server.cpp
@@ -62,16 +62,16 @@ parse_args (int argc, char *argv[])
int
main (int argc, char *argv[])
{
- ACE_TRY_NEW_ENV
+ try
{
CORBA::ORB_var orb =
- CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ CORBA::ORB_init (argc, argv, "");
CORBA::Object_var poa_object =
- orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
+ orb->resolve_initial_references("RootPOA");
PortableServer::POA_var root_poa =
- PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER);
+ PortableServer::POA::_narrow (poa_object.in ());
if (CORBA::is_nil (poa_object.in ()))
ACE_ERROR_RETURN ((LM_ERROR,
@@ -93,7 +93,7 @@ main (int argc, char *argv[])
coordinator_impl->_this ();
CORBA::String_var ior =
- orb->object_to_string (coordinator.in () ACE_ENV_ARG_PARAMETER);
+ orb->object_to_string (coordinator.in ());
// If the ior_output_file exists, output the ior to it
FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
@@ -113,7 +113,7 @@ main (int argc, char *argv[])
++i)
{
ACE_Time_Value tv (1, 0);
- orb->run (tv ACE_ENV_ARG_PARAMETER);
+ orb->run (tv);
}
ACE_DEBUG ((LM_DEBUG, "done.\n"));
@@ -139,8 +139,7 @@ main (int argc, char *argv[])
payload_size,
thread_count,
message_count,
- session_list
- ACE_ENV_ARG_PARAMETER);
+ session_list);
ACE_ASSERT (session_list.length () == peer_count);
@@ -162,8 +161,7 @@ main (int argc, char *argv[])
Test::Session::_duplicate (session_list[k]);
}
- session_list[j]->start (other_sessions
- ACE_ENV_ARG_PARAMETER);
+ session_list[j]->start (other_sessions);
}
@@ -174,7 +172,7 @@ main (int argc, char *argv[])
++k)
{
ACE_Time_Value tv (1, 0);
- orb->run (tv ACE_ENV_ARG_PARAMETER);
+ orb->run (tv);
}
if (!session_control_impl->all_sessions_finished ())
@@ -198,17 +196,15 @@ main (int argc, char *argv[])
ACE_DEBUG ((LM_DEBUG, "Shutdown poa and orb . . .\n"));
- root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ root_poa->destroy (1, 1);
orb->destroy ();
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- "Exception caught:");
+ ex._tao_print_exception ("Exception caught:");
return 1;
}
- ACE_ENDTRY;
return 0;
}