summaryrefslogtreecommitdiff
path: root/TAO/examples/CSD_Strategy/ThreadPool6/ServerApp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/examples/CSD_Strategy/ThreadPool6/ServerApp.cpp')
-rw-r--r--TAO/examples/CSD_Strategy/ThreadPool6/ServerApp.cpp60
1 files changed, 22 insertions, 38 deletions
diff --git a/TAO/examples/CSD_Strategy/ThreadPool6/ServerApp.cpp b/TAO/examples/CSD_Strategy/ThreadPool6/ServerApp.cpp
index 62de607a4fb..3fe87380250 100644
--- a/TAO/examples/CSD_Strategy/ThreadPool6/ServerApp.cpp
+++ b/TAO/examples/CSD_Strategy/ThreadPool6/ServerApp.cpp
@@ -23,16 +23,15 @@ 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.
// * Returns 1 if the usage statement was explicitly requested.
// * Returns 0 otherwise.
- int result = this->parse_args(argc, argv);
+ int result = this->parse_args(argc, argv);
if (result != 0)
{
return result;
@@ -40,9 +39,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()))
{
@@ -51,9 +49,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()))
{
@@ -62,25 +59,20 @@ 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_implicit_activation_policy (PortableServer::IMPLICIT_ACTIVATION
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
+ root_poa->create_implicit_activation_policy (PortableServer::IMPLICIT_ACTIVATION);
- 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()))
{
@@ -89,8 +81,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.
@@ -98,23 +89,21 @@ ServerApp::run(int argc, char* argv[] ACE_ENV_ARG_DECL)
new TAO::CSD::TP_Strategy();
// 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);
// Create the Foo_i object.
Foo_i foo_i (this->num_clients_);
// Create tie object with the Foo_i object.
- POA_Foo_tie<Foo_i> foo_tie_i (foo_i, child_poa.in ());
+ POA_Foo_tie<Foo_i> foo_tie_i (foo_i, child_poa.in ());
// Get Object Reference for the foo_tie_i object.
- Foo_var foo = foo_tie_i._this (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
+ Foo_var foo = foo_tie_i._this ();
if (CORBA::is_nil(foo.in()))
{
@@ -124,9 +113,8 @@ ServerApp::run(int argc, char* argv[] ACE_ENV_ARG_DECL)
}
// Stringify the object reference
- CORBA::String_var ior
- = orb->object_to_string(foo.in() ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
+ CORBA::String_var ior
+ = orb->object_to_string(foo.in());
// Write the stringified object reference to the ior file.
FILE* ior_file = ACE_OS::fopen(this->ior_filename_.c_str(), "w");
@@ -143,15 +131,13 @@ ServerApp::run(int argc, char* argv[] ACE_ENV_ARG_DECL)
ACE_OS::fclose(ior_file);
// 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. "
@@ -169,14 +155,12 @@ ServerApp::run(int argc, char* argv[] ACE_ENV_ARG_DECL)
ACE_OS::sleep (2);
// 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"));