summaryrefslogtreecommitdiff
path: root/TAO/examples/Quoter/Quoter_i.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/examples/Quoter/Quoter_i.cpp')
-rw-r--r--TAO/examples/Quoter/Quoter_i.cpp59
1 files changed, 22 insertions, 37 deletions
diff --git a/TAO/examples/Quoter/Quoter_i.cpp b/TAO/examples/Quoter/Quoter_i.cpp
index 17caadc1bc1..98c7dbcbc5c 100644
--- a/TAO/examples/Quoter/Quoter_i.cpp
+++ b/TAO/examples/Quoter/Quoter_i.cpp
@@ -46,7 +46,7 @@ Quoter_Factory_i::~Quoter_Factory_i (void)
// Initialize everything in the factory
-int Quoter_Factory_i::init (ACE_ENV_SINGLE_ARG_DECL)
+int Quoter_Factory_i::init (void)
{
ACE_NEW_RETURN (this->my_quoters_,
Quoter_i *[this->quoter_num_],
@@ -61,28 +61,23 @@ int Quoter_Factory_i::init (ACE_ENV_SINGLE_ARG_DECL)
-1);
const char *location_string = "POA::activate";
- ACE_TRY
+ try
{
- this->poa_ptr_->activate_object (this->my_quoters_[i] ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ this->poa_ptr_->activate_object (this->my_quoters_[i]);
location_string = "_this";
- Stock::Quoter_var quoter_var = this->my_quoters_[i]->_this(ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ Stock::Quoter_var quoter_var = this->my_quoters_[i]->_this();
location_string = "CORBA::ORB::object_to_string";
// Stringify the object reference and print it out.
CORBA::String_var quoter_ior =
- TAO_ORB_Core_instance()->orb()->object_to_string (quoter_var.in ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ TAO_ORB_Core_instance()->orb()->object_to_string (quoter_var.in ());
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, location_string);
+ ex._tao_print_exception (location_string);
return -1;
}
- ACE_ENDTRY;
}
// Everything is ok
@@ -93,8 +88,7 @@ int Quoter_Factory_i::init (ACE_ENV_SINGLE_ARG_DECL)
// Return the quoter by the id <name>.
Stock::Quoter_ptr
-Quoter_Factory_i::create_quoter (const char *
- ACE_ENV_ARG_DECL)
+Quoter_Factory_i::create_quoter (const char *)
ACE_THROW_SPEC ((CORBA::SystemException,
Stock::Invalid_Quoter))
{
@@ -103,7 +97,7 @@ Quoter_Factory_i::create_quoter (const char *
if (TAO_debug_level > 0)
ACE_DEBUG ((LM_DEBUG, "Quoter %d Created\n", this->next_quoter_));
- return my_quoters_[this->next_quoter_]->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ return my_quoters_[this->next_quoter_]->_this ();
}
@@ -131,8 +125,7 @@ Quoter_i::~Quoter_i (void)
// For now, just return 42. It was a good day on Wall Street.
CORBA::Long
-Quoter_i::get_quote (char const *
- ACE_ENV_ARG_DECL_NOT_USED)
+Quoter_i::get_quote (char const *)
ACE_THROW_SPEC ((CORBA::SystemException,
Stock::Invalid_Stock,
Stock::Invalid_Quoter))
@@ -146,7 +139,7 @@ Quoter_i::get_quote (char const *
CosLifeCycle::LifeCycleObject_ptr
Quoter_i::copy (CosLifeCycle::FactoryFinder_ptr there,
const CosLifeCycle::Criteria &/*the_criteria*/
- ACE_ENV_ARG_DECL)
+ )
ACE_THROW_SPEC ((CORBA::SystemException,
CosLifeCycle::NoFactory,
CosLifeCycle::NotCopyable,
@@ -156,7 +149,7 @@ Quoter_i::copy (CosLifeCycle::FactoryFinder_ptr there,
const char *exception_message = "Null message";
CosLifeCycle::LifeCycleObject_ptr lifeCycleObject_ptr =
CosLifeCycle::LifeCycleObject::_nil ();
- ACE_TRY
+ try
{
// The name of the Generic Factory
CosLifeCycle::Key factoryKey (2); // max = 2
@@ -178,8 +171,7 @@ CosLifeCycle::LifeCycleObject::_nil ();
// Find an appropriate factory over there.
exception_message = "While trying to find a factory.\n";
CosLifeCycle::Factories *factories_ptr =
- there->find_factories (factoryKey ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ there->find_factories (factoryKey);
// Now it is known that there is at least one factory.
Stock::Quoter_var quoter_var;
@@ -192,9 +184,7 @@ CosLifeCycle::LifeCycleObject::_nil ();
// Narrow it to a Quoter Factory.
exception_message = "While narrowing.\n";
CosLifeCycle::GenericFactory_var generic_Factory_var =
- CosLifeCycle::GenericFactory::_narrow (generic_FactoryObj_ptr
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ CosLifeCycle::GenericFactory::_narrow (generic_FactoryObj_ptr);
if (CORBA::is_nil (generic_Factory_var.in ()))
{
@@ -215,13 +205,10 @@ CosLifeCycle::LifeCycleObject::_nil ();
exception_message = "While creating an object";
CORBA::Object_var quoterObject_var =
generic_Factory_var->create_object (genericFactoryName,
- criteria
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ criteria);
exception_message = "While narrowing object";
- quoter_var = Stock::Quoter::_narrow (quoterObject_var.in() ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ quoter_var = Stock::Quoter::_narrow (quoterObject_var.in());
if (CORBA::is_nil (quoter_var.in ()))
{
@@ -252,17 +239,15 @@ CosLifeCycle::LifeCycleObject::_nil ();
lifeCycleObject_ptr =
CosLifeCycle::LifeCycleObject::_duplicate ((CosLifeCycle::LifeCycleObject_ptr) quoter_var.in());
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
ACE_ERROR ((LM_ERROR, "Quoter_i::copy - %s\n", exception_message));
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception");
+ ex._tao_print_exception ("Exception");
// Report a NoFactory exception back to the caller
- ACE_TRY_THROW (CosLifeCycle::NoFactory ());
+ throw CosLifeCycle::NoFactory ();
}
- ACE_ENDTRY;
- ACE_CHECK_RETURN (CosLifeCycle::LifeCycleObject::_nil());
return lifeCycleObject_ptr;
}
@@ -273,7 +258,7 @@ CosLifeCycle::LifeCycleObject::_nil ();
void
Quoter_i::move (CosLifeCycle::FactoryFinder_ptr /* there */,
const CosLifeCycle::Criteria & /* the_criteria */
- ACE_ENV_ARG_DECL)
+ )
ACE_THROW_SPEC ((CORBA::SystemException,
CosLifeCycle::NoFactory,
CosLifeCycle::NotMovable,
@@ -283,14 +268,14 @@ Quoter_i::move (CosLifeCycle::FactoryFinder_ptr /* there */,
ACE_ERROR ((LM_ERROR,
"Quoter_i::move: The Quoter object is not movable!"));
- ACE_THROW (CosLifeCycle::NotMovable());
+ throw CosLifeCycle::NotMovable();
}
// Removes the object. Once we shut down the ORB we can call it a day.
void
-Quoter_i::remove (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+Quoter_i::remove (void)
ACE_THROW_SPEC ((CORBA::SystemException,
CosLifeCycle::NotRemovable))
{