summaryrefslogtreecommitdiff
path: root/TAO/examples/CSD_Strategy/ThreadPool2/ServerApp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/examples/CSD_Strategy/ThreadPool2/ServerApp.cpp')
-rw-r--r--TAO/examples/CSD_Strategy/ThreadPool2/ServerApp.cpp51
1 files changed, 18 insertions, 33 deletions
diff --git a/TAO/examples/CSD_Strategy/ThreadPool2/ServerApp.cpp b/TAO/examples/CSD_Strategy/ThreadPool2/ServerApp.cpp
index 30670fa4ee3..0ea97ea6429 100644
--- a/TAO/examples/CSD_Strategy/ThreadPool2/ServerApp.cpp
+++ b/TAO/examples/CSD_Strategy/ThreadPool2/ServerApp.cpp
@@ -25,10 +25,9 @@ ServerApp::~ServerApp()
int
-ServerApp::run(int argc, char* argv[] ACE_ENV_ARG_DECL)
+ServerApp::run(int argc, char* argv[])
{
- CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, "" ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, "");
// Parse the command-line args for this application.
// * Raises -1 if problems are encountered.
@@ -42,9 +41,8 @@ ServerApp::run(int argc, char* argv[] ACE_ENV_ARG_DECL)
TheOrbShutdownTask::instance()->orb (orb.in ());
- CORBA::Object_var obj
- = orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
+ CORBA::Object_var obj
+ = orb->resolve_initial_references("RootPOA");
if (CORBA::is_nil(obj.in()))
{
@@ -53,9 +51,8 @@ ServerApp::run(int argc, char* argv[] ACE_ENV_ARG_DECL)
ACE_THROW_RETURN (TestException(), -1);
}
- PortableServer::POA_var root_poa
- = PortableServer::POA::_narrow(obj.in() ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
+ PortableServer::POA_var root_poa
+ = PortableServer::POA::_narrow(obj.in());
if (CORBA::is_nil(root_poa.in()))
{
@@ -64,24 +61,19 @@ ServerApp::run(int argc, char* argv[] ACE_ENV_ARG_DECL)
ACE_THROW_RETURN (TestException(), -1);
}
- PortableServer::POAManager_var poa_manager
- = root_poa->the_POAManager(ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
+ PortableServer::POAManager_var poa_manager
+ = root_poa->the_POAManager();
// Create the child POA.
CORBA::PolicyList policies(1);
policies.length(1);
- policies[0] = root_poa->create_id_assignment_policy(PortableServer::USER_ID
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
+ policies[0] = root_poa->create_id_assignment_policy(PortableServer::USER_ID);
- PortableServer::POA_var child_poa
+ PortableServer::POA_var child_poa
= root_poa->create_POA("ChildPoa",
poa_manager.in(),
- policies
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
+ policies);
if (CORBA::is_nil(child_poa.in()))
{
@@ -90,8 +82,7 @@ ServerApp::run(int argc, char* argv[] ACE_ENV_ARG_DECL)
ACE_THROW_RETURN (TestException(), -1);
}
- policies[0]->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
+ policies[0]->destroy ();
// Create the thread pool servant dispatching strategy object, and
// hold it in a (local) smart pointer variable.
@@ -101,32 +92,28 @@ ServerApp::run(int argc, char* argv[] ACE_ENV_ARG_DECL)
csd_tp_strategy->set_num_threads(this->num_servants_);
// Tell the strategy to apply itself to the child poa.
- if (csd_tp_strategy->apply_to(child_poa.in() ACE_ENV_ARG_PARAMETER) == false)
+ if (csd_tp_strategy->apply_to(child_poa.in()) == false)
{
ACE_ERROR((LM_ERROR, "(%P|%t) ERROR [ServerApp::run()]: "
"Failed to apply custom dispatching strategy to child poa.\n"));
ACE_THROW_RETURN (TestException(), -1);
}
- ACE_CHECK_RETURN (-1);
FooServantList servants(this->ior_filename_.c_str(),
this->num_servants_,
this->num_clients_,
orb.in());
- servants.create_and_activate(child_poa.in() ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
+ servants.create_and_activate(child_poa.in());
// Activate the POA Manager
- poa_manager->activate(ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
+ poa_manager->activate();
ACE_DEBUG((LM_DEBUG,
"(%P|%t) ServerApp is ready. Running the ORB event loop.\n"));
// Run the ORB event loop.
- orb->run(ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
+ orb->run();
ACE_DEBUG((LM_DEBUG,
"(%P|%t) ServerApp ORB has stopped running. "
@@ -144,14 +131,12 @@ ServerApp::run(int argc, char* argv[] ACE_ENV_ARG_DECL)
"(%P|%t) ServerApp is destroying the Root POA.\n"));
// Tear-down the root poa and orb.
- root_poa->destroy(1, 1 ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
+ root_poa->destroy(1, 1);
ACE_DEBUG((LM_DEBUG,
"(%P|%t) ServerApp is destroying the ORB.\n"));
- orb->destroy(ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
+ orb->destroy();
ACE_DEBUG((LM_DEBUG,
"(%P|%t) ServerApp has completed running successfully.\n"));