diff options
author | Ossama Othman <ossama-othman@users.noreply.github.com> | 2001-12-08 21:59:30 +0000 |
---|---|---|
committer | Ossama Othman <ossama-othman@users.noreply.github.com> | 2001-12-08 21:59:30 +0000 |
commit | 63165b00e2d667e39e15cf084128d94a563d484e (patch) | |
tree | 6939cf1ed0a80ce8a3224d33f3d23c0e1b9a517f /TAO/examples/POA | |
parent | 6579bccb3a3f22f882ef908ad5f7e1a65b00b133 (diff) | |
download | ATCD-63165b00e2d667e39e15cf084128d94a563d484e.tar.gz |
Merged corba-env-clean branch.
Diffstat (limited to 'TAO/examples/POA')
36 files changed, 642 insertions, 674 deletions
diff --git a/TAO/examples/POA/Adapter_Activator/server.cpp b/TAO/examples/POA/Adapter_Activator/server.cpp index 843161b5c86..4e4930562bb 100644 --- a/TAO/examples/POA/Adapter_Activator/server.cpp +++ b/TAO/examples/POA/Adapter_Activator/server.cpp @@ -60,8 +60,8 @@ public: CORBA::ORB_ptr orb); CORBA::Boolean unknown_adapter (PortableServer::POA_ptr parent, - const char *name, - CORBA_Environment &ACE_TRY_ENV) + const char *name + TAO_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); CORBA::PolicyList first_poa_policies_; @@ -82,16 +82,16 @@ Adapter_Activator::Adapter_Activator (PortableServer::POAManager_ptr poa_manager CORBA::Boolean Adapter_Activator::unknown_adapter (PortableServer::POA_ptr parent, - const char *name, - CORBA::Environment &ACE_TRY_ENV) + const char *name + TAO_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { if (ACE_OS::strcmp (name, "firstPOA") == 0) { PortableServer::POA_var child = parent->create_POA (name, this->poa_manager_.in (), - this->first_poa_policies_, - ACE_TRY_ENV); + this->first_poa_policies_ + TAO_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (0); // Creation of firstPOA is over. Destroy the Policy objects. @@ -99,25 +99,25 @@ Adapter_Activator::unknown_adapter (PortableServer::POA_ptr parent, i < this->first_poa_policies_.length (); ++i) { - this->first_poa_policies_[i]->destroy (ACE_TRY_ENV); + this->first_poa_policies_[i]->destroy (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK_RETURN (0); } - child->the_activator (this, - ACE_TRY_ENV); + child->the_activator (this + TAO_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (0); Reference_Counted_Foo *foo_impl = new Reference_Counted_Foo (this->orb_.in (), child.in (), 28); - child->set_servant (foo_impl, - ACE_TRY_ENV); + child->set_servant (foo_impl + TAO_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (0); // This means that the ownership of <foo_impl> now belongs to // the POA. - foo_impl->_remove_ref (ACE_TRY_ENV); + foo_impl->_remove_ref (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK_RETURN (0); // Finally everything is fine @@ -127,8 +127,8 @@ Adapter_Activator::unknown_adapter (PortableServer::POA_ptr parent, { PortableServer::POA_var child = parent->create_POA (name, this->poa_manager_.in (), - this->second_poa_policies_, - ACE_TRY_ENV); + this->second_poa_policies_ + TAO_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (0); // Creation of secondPOA is over. Destroy the Policy objects. @@ -136,7 +136,7 @@ Adapter_Activator::unknown_adapter (PortableServer::POA_ptr parent, i < this->second_poa_policies_.length (); ++i) { - this->second_poa_policies_[i]->destroy (ACE_TRY_ENV); + this->second_poa_policies_[i]->destroy (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK_RETURN (0); } @@ -148,13 +148,13 @@ Adapter_Activator::unknown_adapter (PortableServer::POA_ptr parent, PortableServer::string_to_ObjectId ("third Foo"); child->activate_object_with_id (oid.in (), - foo_impl, - ACE_TRY_ENV); + foo_impl + TAO_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (0); // This means that the ownership of <foo_impl> now belongs to // the POA. - foo_impl->_remove_ref (ACE_TRY_ENV); + foo_impl->_remove_ref (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK_RETURN (0); // Finally everything is fine @@ -264,15 +264,15 @@ write_iors_to_file (const char *first_ior, int main (int argc, char **argv) { - ACE_DECLARE_NEW_CORBA_ENV; + TAO_ENV_DECLARE_NEW_ENV; ACE_TRY { // Initialize the ORB first. CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, - 0, - ACE_TRY_ENV); + 0 + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; int result = parse_args (argc, argv); @@ -281,19 +281,19 @@ main (int argc, char **argv) // Obtain the RootPOA. CORBA::Object_var obj = - orb->resolve_initial_references ("RootPOA", - ACE_TRY_ENV); + orb->resolve_initial_references ("RootPOA" + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Get the POA_var object from Object_var. PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (obj.in (), - ACE_TRY_ENV); + PortableServer::POA::_narrow (obj.in () + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Get the POAManager of the RootPOA. PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_TRY_ENV); + root_poa->the_POAManager (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; Adapter_Activator *adapter_activator = @@ -303,8 +303,8 @@ main (int argc, char **argv) PortableServer::AdapterActivator_var adapter_activator_var = adapter_activator; - root_poa->the_activator (adapter_activator_var.in (), - ACE_TRY_ENV); + root_poa->the_activator (adapter_activator_var.in () + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; PortableServer::POA_var first_poa; @@ -317,33 +317,33 @@ main (int argc, char **argv) // Id Assignment Policy policies[0] = - root_poa->create_id_assignment_policy (PortableServer::SYSTEM_ID, - ACE_TRY_ENV); + root_poa->create_id_assignment_policy (PortableServer::SYSTEM_ID + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Lifespan policy policies[1] = - root_poa->create_lifespan_policy (PortableServer::PERSISTENT, - ACE_TRY_ENV); + root_poa->create_lifespan_policy (PortableServer::PERSISTENT + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Request Processing policy policies[2] = - root_poa->create_request_processing_policy (PortableServer::USE_DEFAULT_SERVANT, - ACE_TRY_ENV); + root_poa->create_request_processing_policy (PortableServer::USE_DEFAULT_SERVANT + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Id Uniqueness policies[3] = - root_poa->create_id_uniqueness_policy (PortableServer::MULTIPLE_ID, - ACE_TRY_ENV); + root_poa->create_id_uniqueness_policy (PortableServer::MULTIPLE_ID + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Create the firstPOA under the RootPOA. first_poa = root_poa->create_POA ("firstPOA", poa_manager.in (), - policies, - ACE_TRY_ENV); + policies + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; } @@ -354,21 +354,21 @@ main (int argc, char **argv) // Id Assignment Policy policies[0] = - root_poa->create_id_assignment_policy (PortableServer::USER_ID, - ACE_TRY_ENV); + root_poa->create_id_assignment_policy (PortableServer::USER_ID + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Lifespan policy policies[1] = - root_poa->create_lifespan_policy (PortableServer::PERSISTENT, - ACE_TRY_ENV); + root_poa->create_lifespan_policy (PortableServer::PERSISTENT + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Create the secondPOA under the firstPOA. second_poa = first_poa->create_POA ("secondPOA", poa_manager.in (), - policies, - ACE_TRY_ENV); + policies + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; } @@ -378,17 +378,17 @@ main (int argc, char **argv) 27); PortableServer::ObjectId_var first_oid = - root_poa->activate_object (&first_foo_impl, - ACE_TRY_ENV); + root_poa->activate_object (&first_foo_impl + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Get Object Reference for the first_foo_impl object. - Foo_var first_foo = first_foo_impl._this (ACE_TRY_ENV); + Foo_var first_foo = first_foo_impl._this (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; CORBA::Object_var second_foo = - first_poa->create_reference ("IDL:Foo:1.0", - ACE_TRY_ENV); + first_poa->create_reference ("IDL:Foo:1.0" + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; PortableServer::ObjectId_var third_oid = @@ -396,21 +396,21 @@ main (int argc, char **argv) CORBA::Object_var third_foo = second_poa->create_reference_with_id (third_oid.in (), - "IDL:Foo:1.0", - ACE_TRY_ENV); + "IDL:Foo:1.0" + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Stringyfy all the object references and print them out. CORBA::String_var first_ior = - orb->object_to_string (first_foo.in (), ACE_TRY_ENV); + orb->object_to_string (first_foo.in () TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; CORBA::String_var second_ior = - orb->object_to_string (second_foo.in (), ACE_TRY_ENV); + orb->object_to_string (second_foo.in () TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; CORBA::String_var third_ior = - orb->object_to_string (third_foo.in (), ACE_TRY_ENV); + orb->object_to_string (third_foo.in () TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; ACE_DEBUG ((LM_DEBUG, @@ -426,14 +426,14 @@ main (int argc, char **argv) return write_result; first_poa->destroy (1, - 1, - ACE_TRY_ENV); + 1 + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - poa_manager->activate (ACE_TRY_ENV); + poa_manager->activate (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - orb->run (ACE_TRY_ENV); + orb->run (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; } diff --git a/TAO/examples/POA/DSI/Database_i.cpp b/TAO/examples/POA/DSI/Database_i.cpp index e86fe3ffbfd..d2e003927e2 100644 --- a/TAO/examples/POA/DSI/Database_i.cpp +++ b/TAO/examples/POA/DSI/Database_i.cpp @@ -16,21 +16,21 @@ DatabaseImpl::Simpler_Database_Malloc::~Simpler_Database_Malloc (void) } DatabaseImpl::Entry::Entry (CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - CORBA::Environment &ACE_TRY_ENV) + PortableServer::POA_ptr poa + TAO_ENV_ARG_DECL) : orb_ (CORBA::ORB::_duplicate (orb)), poa_ (PortableServer::POA::_duplicate (poa)) { // Get the POA Current object reference CORBA::Object_var obj = - this->orb_->resolve_initial_references ("POACurrent", - ACE_TRY_ENV); + this->orb_->resolve_initial_references ("POACurrent" + TAO_ENV_ARG_PARAMETER); ACE_CHECK; // Narrow the object reference to a POA Current reference this->poa_current_ = - PortableServer::Current::_narrow (obj.in (), - ACE_TRY_ENV); + PortableServer::Current::_narrow (obj.in () + TAO_ENV_ARG_PARAMETER); ACE_CHECK; } @@ -39,13 +39,13 @@ DatabaseImpl::Entry::~Entry (void) } void -DatabaseImpl::Entry::invoke (CORBA::ServerRequest_ptr request, - CORBA::Environment &ACE_TRY_ENV) +DatabaseImpl::Entry::invoke (CORBA::ServerRequest_ptr request + TAO_ENV_ARG_DECL) { // The servant determines the key associated with the database // entry represented by self. PortableServer::ObjectId_var oid = - this->poa_current_->get_object_id (ACE_TRY_ENV); + this->poa_current_->get_object_id (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; // Now convert the id into a string @@ -59,7 +59,7 @@ DatabaseImpl::Entry::invoke (CORBA::ServerRequest_ptr request, if (ACE_OS::strcmp (operation, "_is_a") == 0) { - this->is_a (request, ACE_TRY_ENV); + this->is_a (request TAO_ENV_ARG_PARAMETER); ACE_CHECK; } else @@ -67,8 +67,8 @@ DatabaseImpl::Entry::invoke (CORBA::ServerRequest_ptr request, } void -DatabaseImpl::Entry::is_a (CORBA::ServerRequest_ptr request, - CORBA::Environment &ACE_TRY_ENV) +DatabaseImpl::Entry::is_a (CORBA::ServerRequest_ptr request + TAO_ENV_ARG_DECL) { CORBA::NVList_ptr list; this->orb_->create_list (0, list); @@ -77,16 +77,16 @@ DatabaseImpl::Entry::is_a (CORBA::ServerRequest_ptr request, list->add_value ("value", any_1, - CORBA::ARG_IN, - ACE_TRY_ENV); + CORBA::ARG_IN + TAO_ENV_ARG_PARAMETER); ACE_CHECK; - request->arguments (list, - ACE_TRY_ENV); + request->arguments (list + TAO_ENV_ARG_PARAMETER); ACE_CHECK; - CORBA_NamedValue_ptr nv = list->item (0, - ACE_TRY_ENV); + CORBA_NamedValue_ptr nv = list->item (0 + TAO_ENV_ARG_PARAMETER); ACE_CHECK; CORBA::Any_ptr ap = nv->value (); @@ -94,7 +94,7 @@ DatabaseImpl::Entry::is_a (CORBA::ServerRequest_ptr request, *ap >>= value; const char *object_id = - CORBA::_tc_Object->id (ACE_TRY_ENV); + CORBA::_tc_Object->id (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; CORBA::Boolean result; @@ -109,37 +109,37 @@ DatabaseImpl::Entry::is_a (CORBA::ServerRequest_ptr request, CORBA::Any::from_boolean from_boolean (result); result_any <<= from_boolean; - request->set_result (result_any, ACE_TRY_ENV); + request->set_result (result_any TAO_ENV_ARG_PARAMETER); ACE_CHECK; } CORBA::RepositoryId DatabaseImpl::Entry::_primary_interface (const PortableServer::ObjectId &/*oid*/, - PortableServer::POA_ptr, - CORBA::Environment &) + PortableServer::POA_ptr + TAO_ENV_ARG_DECL_NOT_USED) { return 0; } PortableServer::POA_ptr -DatabaseImpl::Entry::_default_POA (CORBA::Environment &) +DatabaseImpl::Entry::_default_POA (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) { return PortableServer::POA::_duplicate (this->poa_.in ()); } DatabaseImpl::Agent::Agent (CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - CORBA::Environment &ACE_TRY_ENV) + PortableServer::POA_ptr poa + TAO_ENV_ARG_DECL) : orb_ (CORBA::ORB::_duplicate (orb)), poa_ (PortableServer::POA::_duplicate (poa)), common_servant_ (orb, - poa, - ACE_TRY_ENV) + poa + TAO_ENV_ARG_PARAMETER) { ACE_CHECK; - this->poa_->set_servant (&this->common_servant_, - ACE_TRY_ENV); + this->poa_->set_servant (&this->common_servant_ + TAO_ENV_ARG_PARAMETER); ACE_CHECK; } @@ -150,8 +150,8 @@ DatabaseImpl::Agent::~Agent (void) Database::Entry_ptr DatabaseImpl::Agent::create_entry (const char *key, const char *entry_type, - const Database::NVPairSequence &initial_attributes, - CORBA::Environment &ACE_TRY_ENV) + const Database::NVPairSequence &initial_attributes + TAO_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, Database::Unknown_Type, Database::Duplicate_Key)) @@ -206,12 +206,12 @@ DatabaseImpl::Agent::create_entry (const char *key, CORBA::Object_var obj = this->poa_->create_reference_with_id (obj_id.in (), - repository_id.in (), - ACE_TRY_ENV); + repository_id.in () + TAO_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (Database::Entry::_nil ()); - Database::Entry_var entry = Database::Entry::_narrow (obj.in (), - ACE_TRY_ENV); + Database::Entry_var entry = Database::Entry::_narrow (obj.in () + TAO_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (Database::Entry::_nil ()); return entry._retn (); @@ -219,8 +219,8 @@ DatabaseImpl::Agent::create_entry (const char *key, Database::Entry_ptr DatabaseImpl::Agent::find_entry (const char *key, - const char *entry_type, - CORBA::Environment &ACE_TRY_ENV) + const char *entry_type + TAO_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, Database::Unknown_Type, Database::Not_Found)) @@ -252,12 +252,12 @@ DatabaseImpl::Agent::find_entry (const char *key, DatabaseImpl::entry_type_to_repository_id ("Entry"); CORBA::Object_var obj = this->poa_->create_reference_with_id (obj_id.in (), - repository_id.in (), - ACE_TRY_ENV); + repository_id.in () + TAO_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (Database::Entry::_nil ()); - entry = Database::Entry::_narrow (obj.in (), - ACE_TRY_ENV); + entry = Database::Entry::_narrow (obj.in () + TAO_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (Database::Entry::_nil ()); } else @@ -275,8 +275,8 @@ DatabaseImpl::Agent::find_entry (const char *key, void DatabaseImpl::Agent::destroy_entry (const char *key, - const char *entry_type, - CORBA::Environment &ACE_TRY_ENV) + const char *entry_type + TAO_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, Database::Unknown_Type, Database::Unknown_Key)) @@ -310,14 +310,14 @@ DatabaseImpl::Agent::destroy_entry (const char *key, } void -DatabaseImpl::Agent::shutdown (CORBA::Environment &) +DatabaseImpl::Agent::shutdown (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)) { this->orb_->shutdown (); } PortableServer::POA_ptr -DatabaseImpl::Agent::_default_POA (CORBA::Environment &) +DatabaseImpl::Agent::_default_POA (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) { return PortableServer::POA::_duplicate (this->poa_.in ()); } diff --git a/TAO/examples/POA/DSI/Database_i.h b/TAO/examples/POA/DSI/Database_i.h index b6f9ba7146a..db60ffbd981 100644 --- a/TAO/examples/POA/DSI/Database_i.h +++ b/TAO/examples/POA/DSI/Database_i.h @@ -32,28 +32,28 @@ public: { public: Entry (CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - CORBA::Environment &); + PortableServer::POA_ptr poa + TAO_ENV_ARG_DECL_NOT_USED); ~Entry (void); - virtual void invoke (CORBA::ServerRequest_ptr request, - CORBA::Environment &env); + virtual void invoke (CORBA::ServerRequest_ptr request + TAO_ENV_ARG_DECL); // The invoke() method receives requests issued to any CORBA // object incarnated by the DSI servant and performs the // processing necessary to execute the request. virtual CORBA::RepositoryId _primary_interface (const PortableServer::ObjectId &oid, - PortableServer::POA_ptr poa, - CORBA::Environment &env); + PortableServer::POA_ptr poa + TAO_ENV_ARG_DECL); // The _primary_interface() method receives an ObjectId value and // a POA_ptr as input parameters and returns a valid RepositoryId // representing the most-derived interface for that oid. - virtual PortableServer::POA_ptr _default_POA (CORBA::Environment &env); + virtual PortableServer::POA_ptr _default_POA (TAO_ENV_SINGLE_ARG_DECL); // Returns the default POA for this servant. - virtual void is_a (CORBA::ServerRequest_ptr request, - CORBA::Environment &env); + virtual void is_a (CORBA::ServerRequest_ptr request + TAO_ENV_ARG_DECL); // Handles the _is_a call protected: @@ -71,36 +71,36 @@ public: { public: Agent (CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - CORBA::Environment &); + PortableServer::POA_ptr poa + TAO_ENV_ARG_DECL_NOT_USED); ~Agent (void); virtual Database::Entry_ptr create_entry (const char *key, const char *entry_type, - const Database::NVPairSequence &initial_attributes, - CORBA::Environment &env) + const Database::NVPairSequence &initial_attributes + TAO_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, Database::Unknown_Type, Database::Duplicate_Key)); virtual Database::Entry_ptr find_entry (const char *key, - const char *entry_type, - CORBA::Environment &env) + const char *entry_type + TAO_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, Database::Unknown_Type, Database::Not_Found)); virtual void destroy_entry (const char *key, - const char *entry_type, - CORBA::Environment &env) + const char *entry_type + TAO_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, Database::Unknown_Type, Database::Unknown_Key)); - virtual void shutdown (CORBA::Environment &env) + virtual void shutdown (TAO_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); - virtual PortableServer::POA_ptr _default_POA (CORBA::Environment &env); + virtual PortableServer::POA_ptr _default_POA (TAO_ENV_SINGLE_ARG_DECL); // Returns the default POA for this servant. protected: diff --git a/TAO/examples/POA/DSI/client.cpp b/TAO/examples/POA/DSI/client.cpp index 66cd569662c..57f7ca35020 100644 --- a/TAO/examples/POA/DSI/client.cpp +++ b/TAO/examples/POA/DSI/client.cpp @@ -99,7 +99,7 @@ read_IOR_from_file (void) int main (int argc, char **argv) { - ACE_DECLARE_NEW_CORBA_ENV; + TAO_ENV_DECLARE_NEW_ENV; char str [255]; // Initialize the ORB @@ -110,7 +110,7 @@ main (int argc, char **argv) CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, - 0, ACE_TRY_ENV); + 0 TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Parse the command-line arguments to get the location of the @@ -132,8 +132,8 @@ main (int argc, char **argv) "CORBA::ORB::string_to_object"); // Get the object reference with the IOR - CORBA::Object_var object = orb->string_to_object (IOR, - ACE_TRY_ENV); + CORBA::Object_var object = orb->string_to_object (IOR + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; ACE_OS::strcpy (str, @@ -141,8 +141,8 @@ main (int argc, char **argv) // Narrow the object reference to a Database::Agent Database::Agent_var database_agent = - Database::Agent::_narrow (object.in (), - ACE_TRY_ENV); + Database::Agent::_narrow (object.in () + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; Database::NVPairSequence employee_attributes (2); @@ -168,15 +168,15 @@ main (int argc, char **argv) Database::Entry_var entry = database_agent->create_entry ("irfan", "Employee", - employee_attributes, - ACE_TRY_ENV); + employee_attributes + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; ACE_OS::strcpy (str, "Database::Employee::_narrow"); Database::Employee_var employee = - Database::Employee::_narrow (entry.in (), - ACE_TRY_ENV); + Database::Employee::_narrow (entry.in () + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; /* @@ -189,27 +189,27 @@ main (int argc, char **argv) #if 0 // Reset the id ACE_OS::strcpy (str, "Database::Employee::id"); - employee->id (666, ACE_TRY_ENV); + employee->id (666 TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; #endif /* 0 */ ACE_OS::strcpy (str, "Database::Entry::find"); // Find the employee entry = database_agent->find_entry ("irfan", - "Employee", - ACE_TRY_ENV); + "Employee" + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; ACE_OS::strcpy (str, "Database::Entry::destroy"); // Destroy the employee database_agent->destroy_entry ("irfan", - "Employee", - ACE_TRY_ENV); + "Employee" + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (shutdown_server) { - database_agent->shutdown (ACE_TRY_ENV); + database_agent->shutdown (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; } diff --git a/TAO/examples/POA/DSI/server.cpp b/TAO/examples/POA/DSI/server.cpp index 33678266e96..f7f099adf60 100644 --- a/TAO/examples/POA/DSI/server.cpp +++ b/TAO/examples/POA/DSI/server.cpp @@ -79,12 +79,12 @@ write_iors_to_file (const char *first_ior) int main (int argc, char **argv) { - ACE_DECLARE_NEW_CORBA_ENV; + TAO_ENV_DECLARE_NEW_ENV; ACE_TRY { // Initialize the ORB - CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, 0, ACE_TRY_ENV); + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, 0 TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; int result = parse_args (argc, argv); @@ -93,17 +93,17 @@ main (int argc, char **argv) // Obtain the RootPOA. CORBA::Object_var obj = - orb->resolve_initial_references ("RootPOA", - ACE_TRY_ENV); + orb->resolve_initial_references ("RootPOA" + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Narrow the object reference to a POA reference - PortableServer::POA_var root_poa = PortableServer::POA::_narrow (obj.in (), - ACE_TRY_ENV); + PortableServer::POA_var root_poa = PortableServer::POA::_narrow (obj.in () + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_TRY_ENV); + root_poa->the_POAManager (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; CORBA::PolicyList policies (5); @@ -111,35 +111,35 @@ main (int argc, char **argv) // ID Assignment Policy policies[0] = - root_poa->create_id_assignment_policy (PortableServer::USER_ID, ACE_TRY_ENV); + root_poa->create_id_assignment_policy (PortableServer::USER_ID TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Lifespan Policy policies[1] = - root_poa->create_lifespan_policy (PortableServer::PERSISTENT, - ACE_TRY_ENV); + root_poa->create_lifespan_policy (PortableServer::PERSISTENT + TAO_ENV_ARG_PARAMETER); // Request Processing Policy policies[2] = - root_poa->create_request_processing_policy (PortableServer::USE_DEFAULT_SERVANT, - ACE_TRY_ENV); + root_poa->create_request_processing_policy (PortableServer::USE_DEFAULT_SERVANT + TAO_ENV_ARG_PARAMETER); // Servant Retention Policy policies[3] = - root_poa->create_servant_retention_policy (PortableServer::RETAIN, ACE_TRY_ENV); + root_poa->create_servant_retention_policy (PortableServer::RETAIN TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Id Uniqueness Policy policies[4] = - root_poa->create_id_uniqueness_policy (PortableServer::MULTIPLE_ID, ACE_TRY_ENV); + root_poa->create_id_uniqueness_policy (PortableServer::MULTIPLE_ID TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; ACE_CString name = "firstPOA"; PortableServer::POA_var first_poa = root_poa->create_POA (name.c_str (), poa_manager.in (), - policies, - ACE_TRY_ENV); + policies + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; for (CORBA::ULong i = 0; @@ -147,31 +147,31 @@ main (int argc, char **argv) ++i) { CORBA::Policy_ptr policy = policies[i]; - policy->destroy (ACE_TRY_ENV); + policy->destroy (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; } // Create a Database Agent Implementation object in first_poa DatabaseImpl::Agent database_agent_impl (orb.in (), - first_poa.in (), - ACE_TRY_ENV); + first_poa.in () + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; PortableServer::ObjectId_var database_agent_oid = PortableServer::string_to_ObjectId ("DatabaseAgent"); first_poa->activate_object_with_id (database_agent_oid.in (), - &database_agent_impl, - ACE_TRY_ENV); + &database_agent_impl + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; CORBA::Object_var database_agent = - first_poa->id_to_reference (database_agent_oid.in (), ACE_TRY_ENV); + first_poa->id_to_reference (database_agent_oid.in () TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Get the IOR for the "DatabaseAgent" object CORBA::String_var database_agent_ior = - orb->object_to_string (database_agent.in (), ACE_TRY_ENV); + orb->object_to_string (database_agent.in () TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; ACE_DEBUG ((LM_DEBUG,"%s\n", @@ -182,11 +182,11 @@ main (int argc, char **argv) return write_result; // set the state of the poa_manager to active i.e ready to process requests - poa_manager->activate (ACE_TRY_ENV); + poa_manager->activate (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; // Run the ORB - orb->run (ACE_TRY_ENV); + orb->run (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; } ACE_CATCHANY diff --git a/TAO/examples/POA/Default_Servant/File_i.cpp b/TAO/examples/POA/Default_Servant/File_i.cpp index 29fd3c344cf..a80188bd406 100644 --- a/TAO/examples/POA/Default_Servant/File_i.cpp +++ b/TAO/examples/POA/Default_Servant/File_i.cpp @@ -24,9 +24,9 @@ FileImpl::System::System (PortableServer::POA_ptr poa) // Create the Default Descriptor Servant fd_servant_ (poa) { - ACE_DECLARE_NEW_CORBA_ENV; + TAO_ENV_DECLARE_NEW_ENV; // set the default servant of the POA - poa->set_servant (&this->fd_servant_, ACE_TRY_ENV); + poa->set_servant (&this->fd_servant_ TAO_ENV_ARG_PARAMETER); ACE_CHECK; } @@ -35,15 +35,15 @@ FileImpl::System::~System (void) } PortableServer::POA_ptr -FileImpl::System::_default_POA (CORBA::Environment &) +FileImpl::System::_default_POA (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) { return PortableServer::POA::_duplicate (this->poa_.in ()); } File::Descriptor_ptr FileImpl::System::open (const char *file_name, - CORBA::Long flags, - CORBA::Environment &ACE_TRY_ENV) + CORBA::Long flags + TAO_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, File::IOError)) { @@ -72,13 +72,13 @@ FileImpl::System::open (const char *file_name, // from ACE_HANDLE string CORBA::Object_var obj = this->poa_->create_reference_with_id (oid.in (), - "IDL:File/Descriptor:1.0", - ACE_TRY_ENV); + "IDL:File/Descriptor:1.0" + TAO_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (File::Descriptor::_nil ()); // Narrow the object reference to a File Descriptor File::Descriptor_var fd = - File::Descriptor::_narrow (obj.in (), ACE_TRY_ENV); + File::Descriptor::_narrow (obj.in () TAO_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (File::Descriptor::_nil ()); @@ -96,26 +96,26 @@ FileImpl::Descriptor::~Descriptor (void) } PortableServer::POA_ptr -FileImpl::Descriptor::_default_POA (CORBA::Environment &) +FileImpl::Descriptor::_default_POA (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) { return PortableServer::POA::_duplicate (this->poa_.in ()); } //Extracts the ACE_HANDLE from the passed object reference ACE_HANDLE -FileImpl::Descriptor::fd (CORBA::Environment &ACE_TRY_ENV) +FileImpl::Descriptor::fd (TAO_ENV_SINGLE_ARG_DECL) { // // One way of getting our id. // // Get a reference to myself - File::Descriptor_var me = this->_this (ACE_TRY_ENV); + File::Descriptor_var me = this->_this (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK_RETURN (ACE_INVALID_HANDLE); // Get the ObjectId from the reference PortableServer::ObjectId_var oid1 = - this->poa_->reference_to_id (me.in (), ACE_TRY_ENV); + this->poa_->reference_to_id (me.in () TAO_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (ACE_INVALID_HANDLE); // @@ -123,7 +123,7 @@ FileImpl::Descriptor::fd (CORBA::Environment &ACE_TRY_ENV) // PortableServer::ObjectId_var oid2 = - this->poa_->servant_to_id (this, ACE_TRY_ENV); + this->poa_->servant_to_id (this TAO_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (ACE_INVALID_HANDLE); // @@ -131,23 +131,23 @@ FileImpl::Descriptor::fd (CORBA::Environment &ACE_TRY_ENV) // int argc = 0; - CORBA::ORB_var orb = CORBA::ORB_init (argc, 0, 0, ACE_TRY_ENV); + CORBA::ORB_var orb = CORBA::ORB_init (argc, 0, 0 TAO_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (ACE_INVALID_HANDLE); // Get the POA Current object reference CORBA::Object_var obj = - orb->resolve_initial_references ("POACurrent", - ACE_TRY_ENV); + orb->resolve_initial_references ("POACurrent" + TAO_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (ACE_INVALID_HANDLE); // Narrow the object reference to a POA Current reference PortableServer::Current_var poa_current = - PortableServer::Current::_narrow (obj.in (), - ACE_TRY_ENV); + PortableServer::Current::_narrow (obj.in () + TAO_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (ACE_INVALID_HANDLE); PortableServer::ObjectId_var oid3 = - poa_current->get_object_id (ACE_TRY_ENV); + poa_current->get_object_id (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK_RETURN (ACE_INVALID_HANDLE); ACE_ASSERT (oid1.in () == oid2.in ()); @@ -162,12 +162,12 @@ FileImpl::Descriptor::fd (CORBA::Environment &ACE_TRY_ENV) } CORBA::Long -FileImpl::Descriptor::write (const File::Descriptor::DataBuffer &buffer, - CORBA::Environment &ACE_TRY_ENV) +FileImpl::Descriptor::write (const File::Descriptor::DataBuffer &buffer + TAO_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, File::IOError)) { - ACE_HANDLE file_descriptor = this->fd (ACE_TRY_ENV); + ACE_HANDLE file_descriptor = this->fd (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK_RETURN (0); const CORBA::Octet *data = &buffer[0]; @@ -182,12 +182,12 @@ FileImpl::Descriptor::write (const File::Descriptor::DataBuffer &buffer, } File::Descriptor::DataBuffer * -FileImpl::Descriptor::read (CORBA::Long num_bytes, - CORBA::Environment &ACE_TRY_ENV) +FileImpl::Descriptor::read (CORBA::Long num_bytes + TAO_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, File::IOError)) { - ACE_HANDLE file_descriptor = this->fd (ACE_TRY_ENV); + ACE_HANDLE file_descriptor = this->fd (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK_RETURN (0); CORBA::Octet *buffer = File::Descriptor::DataBuffer::allocbuf (num_bytes); @@ -205,12 +205,12 @@ FileImpl::Descriptor::read (CORBA::Long num_bytes, CORBA::ULong FileImpl::Descriptor::lseek (CORBA::ULong offset, - CORBA::Long whence, - CORBA::Environment &ACE_TRY_ENV) + CORBA::Long whence + TAO_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, File::IOError)) { - ACE_HANDLE file_descriptor = this->fd (ACE_TRY_ENV); + ACE_HANDLE file_descriptor = this->fd (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK_RETURN (0); CORBA::Long result = (CORBA::Long) ACE_OS::lseek (file_descriptor, @@ -223,11 +223,11 @@ FileImpl::Descriptor::lseek (CORBA::ULong offset, } void -FileImpl::Descriptor::destroy (CORBA::Environment &ACE_TRY_ENV) +FileImpl::Descriptor::destroy (TAO_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { // Get the ACE_HANDLE for this object reference - ACE_HANDLE file_descriptor = this->fd (ACE_TRY_ENV); + ACE_HANDLE file_descriptor = this->fd (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; // Close the file corresponding to this object reference. diff --git a/TAO/examples/POA/Default_Servant/File_i.h b/TAO/examples/POA/Default_Servant/File_i.h index cee4e41d63e..30c6c6f5e5b 100644 --- a/TAO/examples/POA/Default_Servant/File_i.h +++ b/TAO/examples/POA/Default_Servant/File_i.h @@ -34,35 +34,35 @@ public: ~Descriptor (void); // Destructor - PortableServer::POA_ptr _default_POA (CORBA::Environment &env); + PortableServer::POA_ptr _default_POA (TAO_ENV_SINGLE_ARG_DECL); // Returns the default POA of this object - virtual CORBA::Long write (const File::Descriptor::DataBuffer &buffer, - CORBA::Environment &env) + virtual CORBA::Long write (const File::Descriptor::DataBuffer &buffer + TAO_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, File::IOError)); // write buffer to File corresponding to this Descriptor - virtual File::Descriptor::DataBuffer *read (CORBA::Long num_bytes, - CORBA::Environment &env) + virtual File::Descriptor::DataBuffer *read (CORBA::Long num_bytes + TAO_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, // Reads num_bytes from the file and returns it File::IOError)); virtual CORBA::ULong lseek (CORBA::ULong offset, - CORBA::Long whence, - CORBA::Environment &env) + CORBA::Long whence + TAO_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, File::IOError)); // seek to the offset in file from whence - virtual void destroy (CORBA::Environment &env) + virtual void destroy (TAO_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); // closes the file corresponding to the requested ObjectID private: - ACE_HANDLE fd (CORBA::Environment &env); + ACE_HANDLE fd (TAO_ENV_SINGLE_ARG_DECL); // Extracts the ACE_HANDLE from the objectID PortableServer::POA_var poa_; @@ -80,12 +80,12 @@ public: ~System (void); //Destructor - PortableServer::POA_ptr _default_POA (CORBA::Environment &env); + PortableServer::POA_ptr _default_POA (TAO_ENV_SINGLE_ARG_DECL); //Returns the default POA of this object File::Descriptor_ptr open (const char *file_name, - CORBA::Long flags, - CORBA::Environment &env) + CORBA::Long flags + TAO_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, File::IOError)); // Opens a file ,creates a Descriptor reference with the diff --git a/TAO/examples/POA/Default_Servant/client.cpp b/TAO/examples/POA/Default_Servant/client.cpp index 3d0a86cc098..f3dcd132443 100644 --- a/TAO/examples/POA/Default_Servant/client.cpp +++ b/TAO/examples/POA/Default_Servant/client.cpp @@ -38,8 +38,8 @@ parse_args (int argc, char **argv) switch (c) { case 'd': - TAO_debug_level++; - break; + TAO_debug_level++; + break; case 'k': iorfile = get_opts.optarg; break; @@ -54,8 +54,8 @@ parse_args (int argc, char **argv) ACE_ERROR_RETURN ((LM_ERROR, "usage: %s" "[-k <iorfile>]" - "[-f <filename>]" - "[-m <message>]" + "[-f <filename>]" + "[-m <message>]" "\n", argv [0]), -1); @@ -72,12 +72,12 @@ parse_args (int argc, char **argv) int main (int argc, char **argv) { - ACE_DECLARE_NEW_CORBA_ENV; + TAO_ENV_DECLARE_NEW_ENV; ACE_TRY { // Initialize the ORB - CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, 0, ACE_TRY_ENV); + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, 0 TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Parse the command-line arguments to get the IOR @@ -105,19 +105,19 @@ main (int argc, char **argv) ior_buffer.alloc ()-> free (data); ACE_OS::close (input_file); - CORBA::Object_var object = orb->string_to_object (ior.c_str (), - ACE_TRY_ENV); + CORBA::Object_var object = orb->string_to_object (ior.c_str () + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Narrow the object reference to a File::System - File::System_var file_system = File::System::_narrow (object.in (), - ACE_TRY_ENV); + File::System_var file_system = File::System::_narrow (object.in () + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Creat the file filename i.e "test" File::Descriptor_var fd = file_system->open (filename, - O_CREAT | O_RDWR, - ACE_TRY_ENV); + O_CREAT | O_RDWR + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; int message_length = ACE_OS::strlen (message) + 1; @@ -126,16 +126,16 @@ main (int argc, char **argv) File::Descriptor::DataBuffer data_sent (message_length, message_length, buffer, 1); // write the message to the file - fd->write (data_sent, ACE_TRY_ENV); + fd->write (data_sent TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; //seek to the beginning of the file - fd->lseek (0, SEEK_SET, ACE_TRY_ENV); + fd->lseek (0, SEEK_SET TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Read back the written message - File::Descriptor::DataBuffer_var data_received = fd->read (message_length, - ACE_TRY_ENV); + File::Descriptor::DataBuffer_var data_received = fd->read (message_length + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; char *result = (char *) &data_received[0]; @@ -145,7 +145,7 @@ main (int argc, char **argv) result)); // close the file - fd->destroy (ACE_TRY_ENV); + fd->destroy (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; } ACE_CATCHANY diff --git a/TAO/examples/POA/Default_Servant/server.cpp b/TAO/examples/POA/Default_Servant/server.cpp index 1ff174593e0..87502cc2a18 100644 --- a/TAO/examples/POA/Default_Servant/server.cpp +++ b/TAO/examples/POA/Default_Servant/server.cpp @@ -58,12 +58,12 @@ parse_args (int argc, char **argv) int main (int argc, char **argv) { - ACE_DECLARE_NEW_CORBA_ENV; + TAO_ENV_DECLARE_NEW_ENV; ACE_TRY { // Initialize the ORB - CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, 0, ACE_TRY_ENV); + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, 0 TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; int result = parse_args (argc, argv); @@ -72,15 +72,15 @@ main (int argc, char **argv) // Obtain the RootPOA. CORBA::Object_var obj = - orb->resolve_initial_references ("RootPOA", - ACE_TRY_ENV); + orb->resolve_initial_references ("RootPOA" + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Narrow the object reference to a POA reference - PortableServer::POA_var root_poa = PortableServer::POA::_narrow (obj.in (), ACE_TRY_ENV); + PortableServer::POA_var root_poa = PortableServer::POA::_narrow (obj.in () TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - PortableServer::POAManager_var poa_manager = root_poa->the_POAManager (ACE_TRY_ENV); + PortableServer::POAManager_var poa_manager = root_poa->the_POAManager (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; CORBA::PolicyList policies (5); @@ -88,34 +88,34 @@ main (int argc, char **argv) // ID Assignment Policy policies[0] = - root_poa->create_id_assignment_policy (PortableServer::USER_ID, ACE_TRY_ENV); + root_poa->create_id_assignment_policy (PortableServer::USER_ID TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Lifespan Policy policies[1] = - root_poa->create_lifespan_policy (PortableServer::PERSISTENT, ACE_TRY_ENV); + root_poa->create_lifespan_policy (PortableServer::PERSISTENT TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Request Processing Policy policies[2] = - root_poa->create_request_processing_policy (PortableServer::USE_DEFAULT_SERVANT, ACE_TRY_ENV); + root_poa->create_request_processing_policy (PortableServer::USE_DEFAULT_SERVANT TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Servant Retention Policy policies[3] = - root_poa->create_servant_retention_policy (PortableServer::RETAIN, ACE_TRY_ENV); + root_poa->create_servant_retention_policy (PortableServer::RETAIN TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Id Uniqueness Policy policies[4] = - root_poa->create_id_uniqueness_policy (PortableServer::MULTIPLE_ID, ACE_TRY_ENV); + root_poa->create_id_uniqueness_policy (PortableServer::MULTIPLE_ID TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; ACE_CString name = "firstPOA"; PortableServer::POA_var first_poa = root_poa->create_POA (name.c_str (), poa_manager.in (), - policies, - ACE_TRY_ENV); + policies + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; for (CORBA::ULong i = 0; @@ -123,7 +123,7 @@ main (int argc, char **argv) ++i) { CORBA::Policy_ptr policy = policies[i]; - policy->destroy (ACE_TRY_ENV); + policy->destroy (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; } @@ -134,17 +134,17 @@ main (int argc, char **argv) PortableServer::string_to_ObjectId ("FileSystem"); first_poa->activate_object_with_id (file_system_oid.in (), - &file_system_impl, - ACE_TRY_ENV); + &file_system_impl + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; CORBA::Object_var file_system = - first_poa->id_to_reference (file_system_oid.in (), ACE_TRY_ENV); + first_poa->id_to_reference (file_system_oid.in () TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Get the IOR for the "FileSystem" object CORBA::String_var file_system_ior = - orb->object_to_string (file_system.in (), ACE_TRY_ENV); + orb->object_to_string (file_system.in () TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; ACE_DEBUG ((LM_DEBUG,"%s\n", @@ -160,11 +160,11 @@ main (int argc, char **argv) ACE_OS::fclose (output_file); // set the state of the poa_manager to active i.e ready to process requests - poa_manager->activate (ACE_TRY_ENV); + poa_manager->activate (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; // Run the ORB - orb->run (ACE_TRY_ENV); + orb->run (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; } diff --git a/TAO/examples/POA/Explicit_Activation/server.cpp b/TAO/examples/POA/Explicit_Activation/server.cpp index 45845344730..2b53fafc97d 100644 --- a/TAO/examples/POA/Explicit_Activation/server.cpp +++ b/TAO/examples/POA/Explicit_Activation/server.cpp @@ -124,15 +124,15 @@ write_iors_to_file (const char *first_ior, int main (int argc, char **argv) { - ACE_DECLARE_NEW_CORBA_ENV; + TAO_ENV_DECLARE_NEW_ENV; ACE_TRY { // Initialize the ORB first. CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, - 0, - ACE_TRY_ENV); + 0 + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; int result = parse_args (argc, argv); @@ -141,19 +141,19 @@ main (int argc, char **argv) // Obtain the RootPOA. CORBA::Object_var obj = - orb->resolve_initial_references ("RootPOA", - ACE_TRY_ENV); + orb->resolve_initial_references ("RootPOA" + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Get the POA_var object from Object_var. PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (obj.in (), - ACE_TRY_ENV); + PortableServer::POA::_narrow (obj.in () + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Get the POAManager of the RootPOA. PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_TRY_ENV); + root_poa->the_POAManager (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; // Policies for the firstPOA to be created. @@ -162,20 +162,20 @@ main (int argc, char **argv) // Id Assignment Policy policies[0] = - root_poa->create_id_assignment_policy (PortableServer::USER_ID, - ACE_TRY_ENV); + root_poa->create_id_assignment_policy (PortableServer::USER_ID + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Lifespan policy policies[1] = - root_poa->create_lifespan_policy (PortableServer::PERSISTENT, - ACE_TRY_ENV); + root_poa->create_lifespan_policy (PortableServer::PERSISTENT + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Threading policy policies[2] = - root_poa->create_thread_policy (PortableServer::ORB_CTRL_MODEL, - ACE_TRY_ENV); + root_poa->create_thread_policy (PortableServer::ORB_CTRL_MODEL + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Create the firstPOA under the RootPOA. @@ -183,17 +183,17 @@ main (int argc, char **argv) PortableServer::POA_var first_poa = root_poa->create_POA (name.c_str (), poa_manager.in (), - policies, - ACE_TRY_ENV); + policies + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - policies[2]->destroy (ACE_TRY_ENV); + policies[2]->destroy (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; // Threading policy policies[2] = - root_poa->create_thread_policy (PortableServer::SINGLE_THREAD_MODEL, - ACE_TRY_ENV); + root_poa->create_thread_policy (PortableServer::SINGLE_THREAD_MODEL + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Create the secondPOA under the firstPOA. @@ -201,8 +201,8 @@ main (int argc, char **argv) PortableServer::POA_var second_poa = first_poa->create_POA (name.c_str (), poa_manager.in (), - policies, - ACE_TRY_ENV); + policies + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Creation of POAs is over. Destroy the Policy objects. @@ -210,7 +210,7 @@ main (int argc, char **argv) i < policies.length (); ++i) { - policies[i]->destroy (ACE_TRY_ENV); + policies[i]->destroy (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; } @@ -229,12 +229,12 @@ main (int argc, char **argv) // ObjectId activate_object(in Servant p_servant) // raises (ServantAlreadyActive, WrongPolicy); PortableServer::ObjectId_var first_oid = - root_poa->activate_object (&first_foo_impl, - ACE_TRY_ENV); + root_poa->activate_object (&first_foo_impl + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Get Object Reference for the first_foo_impl object. - Foo_var first_foo = first_foo_impl._this (ACE_TRY_ENV); + Foo_var first_foo = first_foo_impl._this (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; // Get ObjectId for object secondFoo and use that ObjectId to @@ -246,12 +246,12 @@ main (int argc, char **argv) PortableServer::string_to_ObjectId ("secondFoo"); first_poa->activate_object_with_id (second_oid.in (), - &second_foo_impl, - ACE_TRY_ENV); + &second_foo_impl + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Get Object reference for second_foo_impl object. - Foo_var second_foo = second_foo_impl._this (ACE_TRY_ENV); + Foo_var second_foo = second_foo_impl._this (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; // Get ObjectId for the string thirdPOA Create the object reference @@ -272,21 +272,21 @@ main (int argc, char **argv) CORBA::Object_var third_foo = second_poa->create_reference_with_id (third_oid.in (), - "IDL:Foo:1.0", - ACE_TRY_ENV); + "IDL:Foo:1.0" + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Stringyfy all the object references and print them out. CORBA::String_var first_ior = - orb->object_to_string (first_foo.in (), ACE_TRY_ENV); + orb->object_to_string (first_foo.in () TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; CORBA::String_var second_ior = - orb->object_to_string (second_foo.in (), ACE_TRY_ENV); + orb->object_to_string (second_foo.in () TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; CORBA::String_var third_ior = - orb->object_to_string (third_foo.in (), ACE_TRY_ENV); + orb->object_to_string (third_foo.in () TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; ACE_DEBUG ((LM_DEBUG, @@ -304,14 +304,14 @@ main (int argc, char **argv) // Activate third servant using its ObjectID. MyFooServant third_foo_impl (orb.in (), second_poa.in (), 29); second_poa->activate_object_with_id (third_oid.in (), - &third_foo_impl, - ACE_TRY_ENV); + &third_foo_impl + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - poa_manager->activate (ACE_TRY_ENV); + poa_manager->activate (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - orb->run (ACE_TRY_ENV); + orb->run (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; ACE_TIMEPROBE_PRINT; diff --git a/TAO/examples/POA/FindPOA/FindPOA.cpp b/TAO/examples/POA/FindPOA/FindPOA.cpp index 871d89108c9..d13eed56c18 100644 --- a/TAO/examples/POA/FindPOA/FindPOA.cpp +++ b/TAO/examples/POA/FindPOA/FindPOA.cpp @@ -35,8 +35,8 @@ find_non_existant_POA (PortableServer::POA_ptr parent, // Try to find child poa. PortableServer::POA_var child_poa = parent->find_POA (child_poa_name, - activate, - ACE_TRY_ENV); + activate + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; } ACE_CATCH (PortableServer::POA::AdapterNonExistent, foo) @@ -54,32 +54,31 @@ find_non_existant_POA (PortableServer::POA_ptr parent, int main (int argc, char **argv) { - // CORBA::Environment env; - ACE_DECLARE_NEW_CORBA_ENV; + TAO_ENV_DECLARE_NEW_ENV; // Initialize the ORB ACE_TRY { - CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, 0, ACE_TRY_ENV); + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, 0 TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Obtain the RootPOA. CORBA::Object_var obj = - orb->resolve_initial_references ("RootPOA", - ACE_TRY_ENV); + orb->resolve_initial_references ("RootPOA" + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Narrow Object reference to RootPOA to a POA reference. PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (obj.in(), ACE_TRY_ENV); + PortableServer::POA::_narrow (obj.in() TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Get the POAManager of the RootPOA. PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_TRY_ENV); + root_poa->the_POAManager (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - poa_manager->activate (ACE_TRY_ENV); + poa_manager->activate (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; // Try to find a non-existant POA. Since the Adapter Activator @@ -94,23 +93,23 @@ main (int argc, char **argv) // Register the TAO_Adapter_Activator reference to be the RootPOA's // Adapter Activator. - root_poa->the_activator (activator.in (), - ACE_TRY_ENV); + root_poa->the_activator (activator.in () + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Try to find a childPOA of RootPOA named firstPOA ACE_CString name = "firstPOA"; PortableServer::POA_var first_poa = root_poa->find_POA (name.c_str (), - 1, - ACE_TRY_ENV); + 1 + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; name = "secondPOA"; PortableServer::POA_var second_poa = first_poa->find_POA (name.c_str (), - 1, - ACE_TRY_ENV); + 1 + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Try to find a non-existant POA. Even though the Adapter @@ -122,15 +121,15 @@ main (int argc, char **argv) // Get the names of all the POAs CORBA::String_var root_poa_name = - root_poa->the_name (ACE_TRY_ENV); + root_poa->the_name (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; CORBA::String_var first_poa_name = - first_poa->the_name (ACE_TRY_ENV); + first_poa->the_name (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; CORBA::String_var second_poa_name = - second_poa->the_name (ACE_TRY_ENV); + second_poa->the_name (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; ACE_DEBUG ((LM_DEBUG, diff --git a/TAO/examples/POA/Forwarding/MyFooServant.cpp b/TAO/examples/POA/Forwarding/MyFooServant.cpp index 8d7734fe759..ac7acfc29ef 100644 --- a/TAO/examples/POA/Forwarding/MyFooServant.cpp +++ b/TAO/examples/POA/Forwarding/MyFooServant.cpp @@ -18,42 +18,42 @@ MyFooServant::MyFooServant (CORBA::ORB_ptr orb, } CORBA::Long -MyFooServant::doit (CORBA::Environment &) +MyFooServant::doit (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)) { return this->value_++; } void -MyFooServant::forward (CORBA::Environment &ACE_TRY_ENV) +MyFooServant::forward (TAO_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, Foo::Cannot_Forward)) { - this->activator_.forward_requests (ACE_TRY_ENV); + this->activator_.forward_requests (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; PortableServer::ObjectId_var id = - this->poa_->servant_to_id (this, - ACE_TRY_ENV); + this->poa_->servant_to_id (this + TAO_ENV_ARG_PARAMETER); ACE_CHECK; - this->poa_->deactivate_object (id.in (), - ACE_TRY_ENV); + this->poa_->deactivate_object (id.in () + TAO_ENV_ARG_PARAMETER); ACE_CHECK; } void -MyFooServant::shutdown (CORBA::Environment &ACE_TRY_ENV) +MyFooServant::shutdown (TAO_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { - this->orb_->shutdown (0, - ACE_TRY_ENV); + this->orb_->shutdown (0 + TAO_ENV_ARG_PARAMETER); ACE_CHECK; } PortableServer::POA_ptr -MyFooServant::_default_POA (CORBA::Environment &) +MyFooServant::_default_POA (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) { return PortableServer::POA::_duplicate (this->poa_.in ()); } diff --git a/TAO/examples/POA/Forwarding/MyFooServant.h b/TAO/examples/POA/Forwarding/MyFooServant.h index 2cb7f66d27a..fd27cedbcb3 100644 --- a/TAO/examples/POA/Forwarding/MyFooServant.h +++ b/TAO/examples/POA/Forwarding/MyFooServant.h @@ -36,18 +36,18 @@ public: MyFooServantActivator &activator, CORBA::Long value); - virtual CORBA::Long doit (CORBA::Environment &env) + virtual CORBA::Long doit (TAO_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); // Setup forwarding - virtual void forward (CORBA::Environment &env) + virtual void forward (TAO_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, Foo::Cannot_Forward)); - virtual void shutdown (CORBA::Environment &env) + virtual void shutdown (TAO_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); - virtual PortableServer::POA_ptr _default_POA (CORBA::Environment &env); + virtual PortableServer::POA_ptr _default_POA (TAO_ENV_SINGLE_ARG_DECL); // Returns the default POA for this servant. protected: diff --git a/TAO/examples/POA/Forwarding/Servant_Activator.cpp b/TAO/examples/POA/Forwarding/Servant_Activator.cpp index a3f0a00c98d..0e6a08ded10 100644 --- a/TAO/examples/POA/Forwarding/Servant_Activator.cpp +++ b/TAO/examples/POA/Forwarding/Servant_Activator.cpp @@ -19,10 +19,8 @@ MyFooServantActivator::incarnate (const PortableServer::ObjectId &, ACE_THROW_SPEC ((CORBA::SystemException, PortableServer::ForwardRequest)) { - TAO_ENV_ARG_DEFN; - - this->orb_->shutdown (0, - ACE_TRY_ENV); + this->orb_->shutdown (0 + TAO_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (0); // Throw forward exception @@ -45,7 +43,7 @@ MyFooServantActivator::etherealize (const PortableServer::ObjectId &, } void -MyFooServantActivator::forward_requests (CORBA::Environment &ACE_TRY_ENV) +MyFooServantActivator::forward_requests (TAO_ENV_SINGLE_ARG_DECL) { if (CORBA::is_nil (this->forward_to_.in ())) ACE_THROW (Foo::Cannot_Forward ()); diff --git a/TAO/examples/POA/Forwarding/Servant_Activator.h b/TAO/examples/POA/Forwarding/Servant_Activator.h index 78269ba5d4c..affd047814f 100644 --- a/TAO/examples/POA/Forwarding/Servant_Activator.h +++ b/TAO/examples/POA/Forwarding/Servant_Activator.h @@ -47,7 +47,7 @@ public: TAO_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); - void forward_requests (CORBA::Environment &env); + void forward_requests (TAO_ENV_SINGLE_ARG_DECL); // Object should be forwarded from now on. private: diff --git a/TAO/examples/POA/Forwarding/client.cpp b/TAO/examples/POA/Forwarding/client.cpp index 0908970d5d7..a4c79f67f2f 100644 --- a/TAO/examples/POA/Forwarding/client.cpp +++ b/TAO/examples/POA/Forwarding/client.cpp @@ -66,15 +66,15 @@ parse_args (int argc, char **argv) } void -do_calls (Foo_ptr foo, - CORBA::Environment &ACE_TRY_ENV) +do_calls (Foo_ptr foo + TAO_ENV_ARG_DECL) { for (int j = 1; j <= servers; j++) { for (int i = 1; i <= iterations; i++) { // Invoke the doit() method of the foo reference. - CORBA::Long result = foo->doit (ACE_TRY_ENV); + CORBA::Long result = foo->doit (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; // Print the result of doit () method of the foo reference. @@ -88,7 +88,7 @@ do_calls (Foo_ptr foo, { ACE_DEBUG ((LM_DEBUG, "Asking server to forward next time\n")); - foo->forward (ACE_TRY_ENV); + foo->forward (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; } } @@ -98,12 +98,12 @@ do_calls (Foo_ptr foo, int main (int argc, char **argv) { - ACE_DECLARE_NEW_CORBA_ENV; + TAO_ENV_DECLARE_NEW_ENV; ACE_TRY { // Initialize the ORB - CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, 0, ACE_TRY_ENV); + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, 0 TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Initialize options based on command-line arguments. @@ -114,19 +114,19 @@ main (int argc, char **argv) // Get an object reference from the argument string. CORBA::Object_var object = - orb->string_to_object (IOR, ACE_TRY_ENV); + orb->string_to_object (IOR TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Try to narrow the object reference to a Foo reference. Foo_var foo = - Foo::_narrow (object.in (), ACE_TRY_ENV); + Foo::_narrow (object.in () TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - do_calls (foo.in (), - ACE_TRY_ENV); + do_calls (foo.in () + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - foo->shutdown (ACE_TRY_ENV); + foo->shutdown (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; } ACE_CATCHANY diff --git a/TAO/examples/POA/Forwarding/server.cpp b/TAO/examples/POA/Forwarding/server.cpp index edfc788fd12..54e3a0d6bbf 100644 --- a/TAO/examples/POA/Forwarding/server.cpp +++ b/TAO/examples/POA/Forwarding/server.cpp @@ -63,8 +63,8 @@ parse_args (int argc, char **argv) } PortableServer::POA_ptr -setup_poa (PortableServer::POA_ptr root_poa, - CORBA::Environment &ACE_TRY_ENV) +setup_poa (PortableServer::POA_ptr root_poa + TAO_ENV_ARG_DECL) { // Policies for the childPOA to be created. CORBA::PolicyList policies (2); @@ -72,18 +72,18 @@ setup_poa (PortableServer::POA_ptr root_poa, // Tell the POA to use a servant manager. policies[0] = - root_poa->create_request_processing_policy (PortableServer::USE_SERVANT_MANAGER, - ACE_TRY_ENV); + root_poa->create_request_processing_policy (PortableServer::USE_SERVANT_MANAGER + TAO_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (PortableServer::POA::_nil ()); // Allow implicit activation. policies[1] = - root_poa->create_implicit_activation_policy (PortableServer::IMPLICIT_ACTIVATION, - ACE_TRY_ENV); + root_poa->create_implicit_activation_policy (PortableServer::IMPLICIT_ACTIVATION + TAO_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (PortableServer::POA::_nil ()); PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_TRY_ENV); + root_poa->the_POAManager (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK_RETURN (PortableServer::POA::_nil ()); // Create POA as child of RootPOA with the above policies. This POA @@ -91,8 +91,8 @@ setup_poa (PortableServer::POA_ptr root_poa, PortableServer::POA_var child_poa = root_poa->create_POA ("childPOA", poa_manager.in (), - policies, - ACE_TRY_ENV); + policies + TAO_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (PortableServer::POA::_nil ()); // Creation of childPOAs is over. Destroy the Policy objects. @@ -100,7 +100,7 @@ setup_poa (PortableServer::POA_ptr root_poa, i < policies.length (); ++i) { - policies[i]->destroy (ACE_TRY_ENV); + policies[i]->destroy (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK_RETURN (PortableServer::POA::_nil ()); } @@ -109,15 +109,15 @@ setup_poa (PortableServer::POA_ptr root_poa, MyFooServantActivator * create_servant_manager (CORBA::ORB_ptr orb, - PortableServer::POA_ptr child_poa, - CORBA::Environment &ACE_TRY_ENV) + PortableServer::POA_ptr child_poa + TAO_ENV_ARG_DECL) { CORBA::Object_var forward_to; if (forward_to_ior) { forward_to = - orb->string_to_object (forward_to_ior, - ACE_TRY_ENV); + orb->string_to_object (forward_to_ior + TAO_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (0); } @@ -128,17 +128,17 @@ create_servant_manager (CORBA::ORB_ptr orb, 0); // Set MyFooServantActivator to be the servant activator. - child_poa->set_servant_manager (activator, - ACE_TRY_ENV); + child_poa->set_servant_manager (activator + TAO_ENV_ARG_PARAMETER); // For the code above, we're using the CORBA 3.0 servant manager // semantics supported by TAO. For CORBA 2.x ORBs you'd need to // use the following code in place of the previous line: // - // PortableServer::ServantManager_var servant_activator = + // PortableServer::ServantManager_var servant_activator = // activator->_this (); // // child_poa->set_servant_manager (servant_activator.in (), - // ACE_TRY_ENV); + // TAO_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK_RETURN (0); MyFooServant *servant = 0; @@ -152,12 +152,12 @@ create_servant_manager (CORBA::ORB_ptr orb, PortableServer::ServantBase_var servant_var (servant); Foo_var foo = - servant->_this (ACE_TRY_ENV); + servant->_this (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK_RETURN (0); CORBA::String_var ior = - orb->object_to_string (foo.in (), - ACE_TRY_ENV); + orb->object_to_string (foo.in () + TAO_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (0); FILE *output_file = ACE_OS::fopen (ior_output_file, "w"); @@ -183,51 +183,51 @@ main (int argc, if (result == -1) return -1; - ACE_DECLARE_NEW_CORBA_ENV; + TAO_ENV_DECLARE_NEW_ENV; ACE_TRY { // Initialize the ORB first. CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, - 0, - ACE_TRY_ENV); + 0 + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Obtain the RootPOA. CORBA::Object_var obj = - orb->resolve_initial_references ("RootPOA", - ACE_TRY_ENV); + orb->resolve_initial_references ("RootPOA" + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (obj.in (), - ACE_TRY_ENV); + PortableServer::POA::_narrow (obj.in () + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Get the POAManager of the RootPOA. PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_TRY_ENV); + root_poa->the_POAManager (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; PortableServer::POA_var child_poa = - setup_poa (root_poa.in (), - ACE_TRY_ENV); + setup_poa (root_poa.in () + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; PortableServer::ServantManager_var manager = create_servant_manager (orb.in (), - child_poa.in (), - ACE_TRY_ENV); + child_poa.in () + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - poa_manager->activate (ACE_TRY_ENV); + poa_manager->activate (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - orb->run (ACE_TRY_ENV); + orb->run (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - orb->destroy (ACE_TRY_ENV); + orb->destroy (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; } ACE_CATCHANY diff --git a/TAO/examples/POA/Generic_Servant/MyFooServant.cpp b/TAO/examples/POA/Generic_Servant/MyFooServant.cpp index aa975e40338..241d420cd47 100644 --- a/TAO/examples/POA/Generic_Servant/MyFooServant.cpp +++ b/TAO/examples/POA/Generic_Servant/MyFooServant.cpp @@ -20,7 +20,7 @@ ACE_RCSID(Generic_Servant, MyFooServant, "$Id$") // Constructor MyFooServant::MyFooServant (CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, + PortableServer::POA_ptr poa, CORBA::Long value) : orb_ (CORBA::ORB::_duplicate (orb)), poa_ (PortableServer::POA::_duplicate (poa)), @@ -35,27 +35,27 @@ MyFooServant::~MyFooServant (void) // Return the Default POA of this Servant PortableServer::POA_ptr -MyFooServant::_default_POA (CORBA::Environment &/*env*/) +MyFooServant::_default_POA (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) { return PortableServer::POA::_duplicate (this->poa_.in ()); } CORBA::Long -MyFooServant::doit (CORBA::Environment &/*env*/) +MyFooServant::doit (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)) { return this->value_; } void -MyFooServant::simply_doit (CORBA::Environment &/*env*/) +MyFooServant::simply_doit (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)) { } void -MyFooServant::timed_operation (CORBA::ULong timeout, - CORBA::Environment &) +MyFooServant::timed_operation (CORBA::ULong timeout + TAO_ENV_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)) { ACE_DEBUG ((LM_DEBUG, @@ -69,10 +69,10 @@ MyFooServant::timed_operation (CORBA::ULong timeout, } void -MyFooServant::shutdown (CORBA::Environment &ACE_TRY_ENV) +MyFooServant::shutdown (TAO_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { - this->orb_->shutdown (0, ACE_TRY_ENV); + this->orb_->shutdown (0 TAO_ENV_ARG_PARAMETER); ACE_CHECK; } diff --git a/TAO/examples/POA/Generic_Servant/MyFooServant.h b/TAO/examples/POA/Generic_Servant/MyFooServant.h index 7f92aa0c7e8..e3b14fceeda 100644 --- a/TAO/examples/POA/Generic_Servant/MyFooServant.h +++ b/TAO/examples/POA/Generic_Servant/MyFooServant.h @@ -29,23 +29,23 @@ public: virtual ~MyFooServant (void); // Destructor - virtual PortableServer::POA_ptr _default_POA (CORBA::Environment &env); + virtual PortableServer::POA_ptr _default_POA (TAO_ENV_SINGLE_ARG_DECL); // Returns the Default POA of this Servant object - virtual CORBA::Long doit (CORBA::Environment &env) + virtual CORBA::Long doit (TAO_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); // Simple doit method - virtual void simply_doit (CORBA::Environment &env) + virtual void simply_doit (TAO_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); // Even simpler doit method - virtual void timed_operation (CORBA::ULong timeout, - CORBA::Environment &env) + virtual void timed_operation (CORBA::ULong timeout + TAO_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); // Timed operation. - virtual void shutdown (CORBA::Environment &env) + virtual void shutdown (TAO_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); // Shutdown the ORB diff --git a/TAO/examples/POA/Generic_Servant/client.cpp b/TAO/examples/POA/Generic_Servant/client.cpp index b96bf45b1e8..95254622d2a 100644 --- a/TAO/examples/POA/Generic_Servant/client.cpp +++ b/TAO/examples/POA/Generic_Servant/client.cpp @@ -155,15 +155,15 @@ read_IOR_from_file (void) int main (int argc, char **argv) { - ACE_DECLARE_NEW_CORBA_ENV; + TAO_ENV_DECLARE_NEW_ENV; ACE_TRY { // Initialize the ORB CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, - 0, - ACE_TRY_ENV); + 0 + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Initialize options based on command-line arguments. @@ -179,18 +179,18 @@ main (int argc, char **argv) } // Get an object reference from the argument string. - CORBA::Object_var object = orb->string_to_object (IOR, - ACE_TRY_ENV); + CORBA::Object_var object = orb->string_to_object (IOR + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Try to narrow the object reference to a Foo reference. - Foo_var foo = Foo::_narrow (object.in (), - ACE_TRY_ENV); + Foo_var foo = Foo::_narrow (object.in () + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; CORBA::String_var ior = - orb->object_to_string (foo.in (), - ACE_TRY_ENV); + orb->object_to_string (foo.in () + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; @@ -212,20 +212,20 @@ main (int argc, char **argv) if (oneway) { // Invoke the simply_doit() method of the foo reference. - foo->simply_doit (ACE_TRY_ENV); + foo->simply_doit (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; } else if (timed_operations) { // Invoke the timed_operation() method of the foo reference. - foo->timed_operation (timeout, - ACE_TRY_ENV); + foo->timed_operation (timeout + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; } else { // Invoke the doit() method of the foo reference. - result = foo->doit (ACE_TRY_ENV); + result = foo->doit (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; } } @@ -239,7 +239,7 @@ main (int argc, char **argv) if (shutdown_server) { - foo->shutdown (ACE_TRY_ENV); + foo->shutdown (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; } diff --git a/TAO/examples/POA/Loader/Servant_Activator.cpp b/TAO/examples/POA/Loader/Servant_Activator.cpp index 978a46ea2f4..d0797662314 100644 --- a/TAO/examples/POA/Loader/Servant_Activator.cpp +++ b/TAO/examples/POA/Loader/Servant_Activator.cpp @@ -70,8 +70,6 @@ ServantActivator_i::incarnate (const PortableServer::ObjectId &oid, ACE_THROW_SPEC ((CORBA::SystemException, PortableServer::ForwardRequest)) { - TAO_ENV_ARG_DEFN; - // Obtain the servant else exception. PortableServer::Servant servant = (*servant_supplier_) (oid, diff --git a/TAO/examples/POA/Loader/Servant_Locator.cpp b/TAO/examples/POA/Loader/Servant_Locator.cpp index f8ce694703b..ce60de2ad7e 100644 --- a/TAO/examples/POA/Loader/Servant_Locator.cpp +++ b/TAO/examples/POA/Loader/Servant_Locator.cpp @@ -75,8 +75,6 @@ ServantLocator_i::preinvoke (const PortableServer::ObjectId &oid, ACE_THROW_SPEC ((CORBA::SystemException, PortableServer::ForwardRequest)) { - TAO_ENV_ARG_DEFN; - PortableServer::Servant servant = (*servant_supplier_) (oid, poa, diff --git a/TAO/examples/POA/Loader/Server_Manager.cpp b/TAO/examples/POA/Loader/Server_Manager.cpp index 8003fd5c7c5..af6ac15c768 100644 --- a/TAO/examples/POA/Loader/Server_Manager.cpp +++ b/TAO/examples/POA/Loader/Server_Manager.cpp @@ -108,15 +108,14 @@ Server_i::write_iors_to_file (const char *first_ior, int Server_i::init (int argc, char **argv) { - //CORBA::Environment TAO_TRY_ENV; - ACE_DECLARE_NEW_CORBA_ENV; + TAO_ENV_DECLARE_NEW_ENV; ACE_TRY { // Initialize the ORB. orb_ = CORBA::ORB_init (argc, argv, - 0, - ACE_TRY_ENV); + 0 + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; int result = parse_args (argc, argv); @@ -125,17 +124,17 @@ Server_i::init (int argc, char **argv) // Obtain the RootPOA. CORBA::Object_var obj = - orb_->resolve_initial_references ("RootPOA", - ACE_TRY_ENV); + orb_->resolve_initial_references ("RootPOA" + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Narrow the Object reference to a POA reference - root_poa_ = PortableServer::POA::_narrow (obj.in (), - ACE_TRY_ENV); + root_poa_ = PortableServer::POA::_narrow (obj.in () + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Get the POAManager of RootPOA - poa_manager_ = root_poa_->the_POAManager (ACE_TRY_ENV); + poa_manager_ = root_poa_->the_POAManager (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; } @@ -157,10 +156,9 @@ PortableServer::POA_ptr Server_i::create_poa (const char *name, int servant_retention_policy) { - // CORBA::Environment TAO_TRY_ENV; PortableServer::POA_ptr my_poa = 0; - ACE_DECLARE_NEW_CORBA_ENV; + TAO_ENV_DECLARE_NEW_ENV; ACE_TRY { @@ -169,36 +167,36 @@ Server_i::create_poa (const char *name, // ID Assignment Policy. policies_[0] = root_poa_->create_id_assignment_policy - (PortableServer::USER_ID, - ACE_TRY_ENV); + (PortableServer::USER_ID + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Lifespan Policy. policies_[1] = root_poa_->create_lifespan_policy - (PortableServer::PERSISTENT, - ACE_TRY_ENV); + (PortableServer::PERSISTENT + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Request Processing Policy. policies_[2] = root_poa_->create_request_processing_policy - (PortableServer::USE_SERVANT_MANAGER, - ACE_TRY_ENV); + (PortableServer::USE_SERVANT_MANAGER + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Servant Retention Policy. if (servant_retention_policy == 1) policies_[3] = root_poa_->create_servant_retention_policy - (PortableServer::RETAIN, - ACE_TRY_ENV); + (PortableServer::RETAIN + TAO_ENV_ARG_PARAMETER); if (servant_retention_policy == 0) policies_[3] = root_poa_->create_servant_retention_policy - (PortableServer::NON_RETAIN, - ACE_TRY_ENV); + (PortableServer::NON_RETAIN + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Create myPOA as the child of RootPOA with the above @@ -207,8 +205,8 @@ Server_i::create_poa (const char *name, // being RETAIN or NONRETAIN respectively. my_poa = root_poa_->create_POA (name, poa_manager_.in (), - policies_, - ACE_TRY_ENV); + policies_ + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Destroy the policy objects as they have been passed to @@ -218,7 +216,7 @@ Server_i::create_poa (const char *name, ++i) { CORBA::Policy_ptr policy = policies_[i]; - policy->destroy (ACE_TRY_ENV); + policy->destroy (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; } } @@ -238,9 +236,7 @@ Server_i::create_poa (const char *name, int Server_i::create_activator (PortableServer::POA_var first_poa) { - // CORBA::Environment TAO_TRY_ENV; - - ACE_DECLARE_NEW_CORBA_ENV; + TAO_ENV_DECLARE_NEW_ENV; ACE_TRY { @@ -257,16 +253,16 @@ Server_i::create_activator (PortableServer::POA_var first_poa) // Set ServantActivator_i object as the servant_manager of // firstPOA. this->servant_activator_ = temp_servant_activator; - first_poa->set_servant_manager (this->servant_activator_.in (), - ACE_TRY_ENV); + first_poa->set_servant_manager (this->servant_activator_.in () + TAO_ENV_ARG_PARAMETER); // For the code above, we're using the CORBA 3.0 servant manager // semantics supported by TAO. For CORBA 2.x ORBs you'd need to // use the following code in place of the previous lines: // // this->servant_activator_ = temp_servant_activator->_this (); - // - // first_poa->set_servant_manager (this->servant_activator_.in (), - // ACE_TRY_ENV); + // + // first_poa->set_servant_manager (this->servant_activator_.in () + // TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Create a reference with user created ID in firstPOA which @@ -275,8 +271,8 @@ Server_i::create_activator (PortableServer::POA_var first_poa) PortableServer::string_to_ObjectId ("firstFoo"); first_foo_ = first_poa->create_reference_with_id (first_foo_oid.in (), - "IDL:Foo:1.0", - ACE_TRY_ENV); + "IDL:Foo:1.0" + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; } ACE_CATCHANY @@ -294,8 +290,7 @@ Server_i::create_activator (PortableServer::POA_var first_poa) int Server_i::create_locator (PortableServer::POA_var second_poa) { - // CORBA::Environment TAO_TRY_ENV; - ACE_DECLARE_NEW_CORBA_ENV; + TAO_ENV_DECLARE_NEW_ENV; ACE_TRY { @@ -311,18 +306,18 @@ Server_i::create_locator (PortableServer::POA_var second_poa) // Set ServantLocator_i object as the servant Manager of // secondPOA. this->servant_locator_ = temp_servant_locator; - second_poa->set_servant_manager (this->servant_locator_.in (), - ACE_TRY_ENV); + second_poa->set_servant_manager (this->servant_locator_.in () + TAO_ENV_ARG_PARAMETER); // For the code above, we're using the CORBA 3.0 servant manager // semantics supported by TAO. For CORBA 2.x ORBs you'd need to // use the following code in place of the previous lines: // // this->servant_locator_ = temp_servant_locator->_this (); - // + // // Set ServantLocator_i object as the servant Manager of // secondPOA. - // second_poa->set_servant_manager (this->servant_locator_.in (), - // ACE_TRY_ENV); + // second_poa->set_servant_manager (this->servant_locator_.in () + // TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Try to create a reference with user created ID in second_poa @@ -332,8 +327,8 @@ Server_i::create_locator (PortableServer::POA_var second_poa) second_foo_ = second_poa->create_reference_with_id (second_foo_oid.in (), - "IDL:Foo:1.0", - ACE_TRY_ENV); + "IDL:Foo:1.0" + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; } ACE_CATCHANY @@ -351,9 +346,7 @@ Server_i::create_locator (PortableServer::POA_var second_poa) int Server_i::run (void) { - // CORBA::Environment TAO_TRY_ENV; - - ACE_DECLARE_NEW_CORBA_ENV; + TAO_ENV_DECLARE_NEW_ENV; ACE_TRY { @@ -361,13 +354,13 @@ Server_i::run (void) // and secondPOA. CORBA::String_var first_foo_ior = - orb_->object_to_string (first_foo_.in (), - ACE_TRY_ENV); + orb_->object_to_string (first_foo_.in () + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; CORBA::String_var second_foo_ior = - orb_->object_to_string (second_foo_.in (), - ACE_TRY_ENV); + orb_->object_to_string (second_foo_.in () + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Print the ior's of first_foo and second_foo. @@ -384,12 +377,12 @@ Server_i::run (void) // Set the poa_manager state to active, ready to process // requests. - poa_manager_->activate (ACE_TRY_ENV); + poa_manager_->activate (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; // Run the ORB. - orb_->run (ACE_TRY_ENV); + orb_->run (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; } ACE_CATCHANY diff --git a/TAO/examples/POA/NewPOA/NewPOA.cpp b/TAO/examples/POA/NewPOA/NewPOA.cpp index b4a9419a61c..16528209a04 100644 --- a/TAO/examples/POA/NewPOA/NewPOA.cpp +++ b/TAO/examples/POA/NewPOA/NewPOA.cpp @@ -27,15 +27,15 @@ ACE_RCSID(NewPOA, NewPOA, "$Id$") void -print_poa (PortableServer::POA_ptr poa, - CORBA::Environment &ACE_TRY_ENV) +print_poa (PortableServer::POA_ptr poa + TAO_ENV_ARG_DECL) { CORBA::String_var poa_name = - poa->the_name (ACE_TRY_ENV); + poa->the_name (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; CORBA::OctetSeq_var poa_id = - poa->id (ACE_TRY_ENV); + poa->id (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; ACE_DEBUG ((LM_DEBUG, @@ -58,15 +58,15 @@ print_poa (PortableServer::POA_ptr poa, "\n")); PortableServer::POAList_var children = - poa->the_children (ACE_TRY_ENV); + poa->the_children (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; for (CORBA::ULong index = 0; index != children->length (); ++index) { - print_poa (children[index].in (), - ACE_TRY_ENV); + print_poa (children[index].in () + TAO_ENV_ARG_PARAMETER); ACE_CHECK; } } @@ -74,27 +74,26 @@ print_poa (PortableServer::POA_ptr poa, int main (int argc, char **argv) { - // CORBA::Environment env; - ACE_DECLARE_NEW_CORBA_ENV; + TAO_ENV_DECLARE_NEW_ENV; ACE_TRY { // The first step Initialize the ORB CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, - 0, - ACE_TRY_ENV); + 0 + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Obtain the RootPOA. CORBA::Object_var obj = - orb->resolve_initial_references ("RootPOA", - ACE_TRY_ENV); + orb->resolve_initial_references ("RootPOA" + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // _narrow() the Object to get the POA object, i.e., the root_poa. PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (obj.in (), ACE_TRY_ENV); + PortableServer::POA::_narrow (obj.in () TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Policies for the new POAs @@ -103,12 +102,12 @@ main (int argc, char **argv) // Threading policy policies[0] = - root_poa->create_thread_policy (PortableServer::ORB_CTRL_MODEL, ACE_TRY_ENV); + root_poa->create_thread_policy (PortableServer::ORB_CTRL_MODEL TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Lifespan policy policies[1] = - root_poa->create_lifespan_policy (PortableServer::TRANSIENT, ACE_TRY_ENV); + root_poa->create_lifespan_policy (PortableServer::TRANSIENT TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Creation of the firstPOA @@ -116,8 +115,8 @@ main (int argc, char **argv) PortableServer::POA_var first_poa = root_poa->create_POA (name.c_str (), PortableServer::POAManager::_nil (), - policies, - ACE_TRY_ENV); + policies + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Creation of the new POA, i.e. firstPOA/secondPOA @@ -125,8 +124,8 @@ main (int argc, char **argv) PortableServer::POA_var second_poa = first_poa->create_POA (name.c_str (), PortableServer::POAManager::_nil (), - policies, - ACE_TRY_ENV); + policies + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Creating thirdPOA. @@ -135,8 +134,8 @@ main (int argc, char **argv) PortableServer::POA_var third_poa = root_poa->create_POA (name.c_str (), PortableServer::POAManager::_nil (), - policies, - ACE_TRY_ENV); + policies + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Creation of the new POAs over, so destroy the Policy_ptr's. @@ -145,26 +144,26 @@ main (int argc, char **argv) ++i) { CORBA::Policy_ptr policy = policies[i]; - policy->destroy (ACE_TRY_ENV); + policy->destroy (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; } // Get the names of all the POAs and print them out. CORBA::String_var root_poa_name = - root_poa->the_name (ACE_TRY_ENV); + root_poa->the_name (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; CORBA::String_var first_poa_name = - first_poa->the_name (ACE_TRY_ENV); + first_poa->the_name (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; CORBA::String_var second_poa_name = - second_poa->the_name (ACE_TRY_ENV); + second_poa->the_name (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; CORBA::String_var third_poa_name = - third_poa->the_name (ACE_TRY_ENV); + third_poa->the_name (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; ACE_DEBUG ((LM_DEBUG, @@ -174,8 +173,8 @@ main (int argc, char **argv) second_poa_name.in (), third_poa_name.in ())); - print_poa (root_poa.in (), - ACE_TRY_ENV); + print_poa (root_poa.in () + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; } diff --git a/TAO/examples/POA/On_Demand_Activation/Servant_Activator.cpp b/TAO/examples/POA/On_Demand_Activation/Servant_Activator.cpp index 1266c4eaff9..f7d810d91b3 100644 --- a/TAO/examples/POA/On_Demand_Activation/Servant_Activator.cpp +++ b/TAO/examples/POA/On_Demand_Activation/Servant_Activator.cpp @@ -34,7 +34,6 @@ MyFooServantActivator::incarnate (const PortableServer::ObjectId &oid, ACE_THROW_SPEC ((CORBA::SystemException, PortableServer::ForwardRequest)) { - TAO_ENV_ARG_DEFN; // Convert ObjectId to String. CORBA::String_var s = PortableServer::ObjectId_to_string (oid); @@ -47,9 +46,6 @@ MyFooServantActivator::incarnate (const PortableServer::ObjectId &oid, else { ACE_THROW_RETURN (CORBA::OBJECT_NOT_EXIST (), 0); - //CORBA::Exception *exception = new CORBA::OBJECT_NOT_EXIST (); - //env.exception (exception); - //return 0; } } diff --git a/TAO/examples/POA/On_Demand_Activation/Servant_Locator.cpp b/TAO/examples/POA/On_Demand_Activation/Servant_Locator.cpp index 2511134c251..12edc90e4f3 100644 --- a/TAO/examples/POA/On_Demand_Activation/Servant_Locator.cpp +++ b/TAO/examples/POA/On_Demand_Activation/Servant_Locator.cpp @@ -38,8 +38,6 @@ MyFooServantLocator::preinvoke (const PortableServer::ObjectId &oid, ACE_THROW_SPEC ((CORBA::SystemException, PortableServer::ForwardRequest)) { - TAO_ENV_ARG_DEFN; - // Convert ObjectID to String. CORBA::String_var s = PortableServer::ObjectId_to_string (oid); @@ -60,11 +58,6 @@ MyFooServantLocator::preinvoke (const PortableServer::ObjectId &oid, else { ACE_THROW_RETURN (CORBA::OBJECT_NOT_EXIST (), 0); - // - //CORBA::Exception *exception = - // new CORBA::OBJECT_NOT_EXIST (); - //env.exception (exception); - //return 0; } } diff --git a/TAO/examples/POA/On_Demand_Activation/server.cpp b/TAO/examples/POA/On_Demand_Activation/server.cpp index 685c584ef00..bc506124e27 100644 --- a/TAO/examples/POA/On_Demand_Activation/server.cpp +++ b/TAO/examples/POA/On_Demand_Activation/server.cpp @@ -100,12 +100,12 @@ write_iors_to_file (const char *first_ior, int main (int argc, char **argv) { - ACE_DECLARE_NEW_CORBA_ENV; + TAO_ENV_DECLARE_NEW_ENV; ACE_TRY { // Initialize the ORB. - CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, 0, ACE_TRY_ENV); + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, 0 TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; int result = parse_args (argc, argv); @@ -114,19 +114,19 @@ main (int argc, char **argv) // Obtain the RootPOA. CORBA::Object_var obj = - orb->resolve_initial_references ("RootPOA", - ACE_TRY_ENV); + orb->resolve_initial_references ("RootPOA" + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Narrow the Object reference to a POA reference PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (obj.in (), ACE_TRY_ENV); + PortableServer::POA::_narrow (obj.in () TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Get the POAManager of RootPOA PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_TRY_ENV); + root_poa->the_POAManager (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; @@ -135,24 +135,24 @@ main (int argc, char **argv) // ID Assignment Policy policies[0] = - root_poa->create_id_assignment_policy (PortableServer::USER_ID, ACE_TRY_ENV); + root_poa->create_id_assignment_policy (PortableServer::USER_ID TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Lifespan Policy policies[1] = - root_poa->create_lifespan_policy (PortableServer::PERSISTENT, ACE_TRY_ENV); + root_poa->create_lifespan_policy (PortableServer::PERSISTENT TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Request Processing Policy policies[2] = - root_poa->create_request_processing_policy (PortableServer::USE_SERVANT_MANAGER, ACE_TRY_ENV); + root_poa->create_request_processing_policy (PortableServer::USE_SERVANT_MANAGER TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; PortableServer::POA_var first_poa; { // Servant Retention Policy policies[3] = - root_poa->create_servant_retention_policy (PortableServer::RETAIN, ACE_TRY_ENV); + root_poa->create_servant_retention_policy (PortableServer::RETAIN TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; ACE_CString name = "firstPOA"; @@ -161,8 +161,8 @@ main (int argc, char **argv) // firstPOA will use SERVANT_ACTIVATOR because of RETAIN policy. first_poa = root_poa->create_POA (name.c_str (), poa_manager.in (), - policies, - ACE_TRY_ENV); + policies + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; } @@ -171,7 +171,7 @@ main (int argc, char **argv) { // Servant Retention Policy policies[3] = - root_poa->create_servant_retention_policy (PortableServer::NON_RETAIN, ACE_TRY_ENV); + root_poa->create_servant_retention_policy (PortableServer::NON_RETAIN TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; ACE_CString name = "secondPOA"; @@ -181,8 +181,8 @@ main (int argc, char **argv) // policy. second_poa = root_poa->create_POA (name.c_str (), poa_manager.in (), - policies, - ACE_TRY_ENV); + policies + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; } @@ -194,7 +194,7 @@ main (int argc, char **argv) ++i) { CORBA::Policy_ptr policy = policies[i]; - policy->destroy (ACE_TRY_ENV); + policy->destroy (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; } @@ -206,17 +206,17 @@ main (int argc, char **argv) // Set MyFooServantActivator object as the servant_manager of // firstPOA. - first_poa->set_servant_manager (activator, - ACE_TRY_ENV); + first_poa->set_servant_manager (activator + TAO_ENV_ARG_PARAMETER); // For the code above, we're using the CORBA 3.0 servant manager // semantics supported by TAO. For CORBA 2.x ORBs you'd need to // use the following code in place of the previous line: // - // PortableServer::ServantManager_var servant_activator = + // PortableServer::ServantManager_var servant_activator = // activator->_this (); - // + // // first_poa->set_servant_manager (servant_activator.in (), - // ACE_TRY_ENV); + // TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; // Create a reference with user created ID in firstPOA which uses @@ -226,7 +226,7 @@ main (int argc, char **argv) PortableServer::string_to_ObjectId ("firstFoo"); CORBA::Object_var first_foo = - first_poa->create_reference_with_id (first_foo_oid.in (), "IDL:Foo:1.0", ACE_TRY_ENV); + first_poa->create_reference_with_id (first_foo_oid.in (), "IDL:Foo:1.0" TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Allocate the servant activator. @@ -237,8 +237,8 @@ main (int argc, char **argv) // Set MyFooServantLocator object as the servant Manager of // secondPOA. - second_poa->set_servant_manager (locator, - ACE_TRY_ENV); + second_poa->set_servant_manager (locator + TAO_ENV_ARG_PARAMETER); // For the code above, we're using the CORBA 3.0 servant manager // semantics supported by TAO. For CORBA 2.x ORBs you'd need to // use the following code in place of the previous line: @@ -247,7 +247,7 @@ main (int argc, char **argv) // locator->_this (); // // second_poa->set_servant_manager (servant_locator.in (), - // ACE_TRY_ENV); + // TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; // Try to create a reference with user created ID in second_poa @@ -258,19 +258,19 @@ main (int argc, char **argv) CORBA::Object_var second_foo = second_poa->create_reference_with_id (second_foo_oid.in (), - "IDL:Foo:1.0", ACE_TRY_ENV); + "IDL:Foo:1.0" TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Invoke object_to_string on the references created in firstPOA and // secondPOA. CORBA::String_var first_foo_ior = - orb->object_to_string (first_foo.in (), ACE_TRY_ENV); + orb->object_to_string (first_foo.in () TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; CORBA::String_var second_foo_ior = - orb->object_to_string (second_foo.in (), ACE_TRY_ENV); + orb->object_to_string (second_foo.in () TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Print the ior's of first_foo and second_foo. @@ -285,11 +285,11 @@ main (int argc, char **argv) return write_result; // Set the poa_manager state to active, ready to process requests. - poa_manager->activate (ACE_TRY_ENV); + poa_manager->activate (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; // Run the ORB. - orb->run (ACE_TRY_ENV); + orb->run (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; } ACE_CATCHANY diff --git a/TAO/examples/POA/On_Demand_Loading/Servant_Activator.cpp b/TAO/examples/POA/On_Demand_Loading/Servant_Activator.cpp index 3f6f762fd9d..53ac5c7f696 100644 --- a/TAO/examples/POA/On_Demand_Loading/Servant_Activator.cpp +++ b/TAO/examples/POA/On_Demand_Loading/Servant_Activator.cpp @@ -37,7 +37,6 @@ ServantActivator_i::incarnate (const PortableServer::ObjectId &oid, ACE_THROW_SPEC ((CORBA::SystemException, PortableServer::ForwardRequest)) { - TAO_ENV_ARG_DEFN; // Convert ObjectId to String. CORBA::String_var s = PortableServer::ObjectId_to_string (oid); diff --git a/TAO/examples/POA/On_Demand_Loading/Servant_Locator.cpp b/TAO/examples/POA/On_Demand_Loading/Servant_Locator.cpp index 0ec58cd5043..2155e074ab5 100644 --- a/TAO/examples/POA/On_Demand_Loading/Servant_Locator.cpp +++ b/TAO/examples/POA/On_Demand_Loading/Servant_Locator.cpp @@ -39,8 +39,6 @@ ServantLocator_i::preinvoke (const PortableServer::ObjectId &oid, ACE_THROW_SPEC ((CORBA::SystemException, PortableServer::ForwardRequest)) { - TAO_ENV_ARG_DEFN; - // Convert ObjectID to String. CORBA::String_var s = diff --git a/TAO/examples/POA/On_Demand_Loading/Server_Manager.cpp b/TAO/examples/POA/On_Demand_Loading/Server_Manager.cpp index 00294c8a752..41538165583 100644 --- a/TAO/examples/POA/On_Demand_Loading/Server_Manager.cpp +++ b/TAO/examples/POA/On_Demand_Loading/Server_Manager.cpp @@ -112,15 +112,15 @@ Server_i::write_iors_to_file (const char *first_ior, int Server_i::init (int argc, char **argv) { - ACE_DECLARE_NEW_CORBA_ENV; + TAO_ENV_DECLARE_NEW_ENV; ACE_TRY { // Initialize the ORB. orb_ = CORBA::ORB_init (argc, argv, - 0, - ACE_TRY_ENV); + 0 + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; int result = parse_args (argc, argv); @@ -129,17 +129,17 @@ Server_i::init (int argc, char **argv) // Obtain the RootPOA. CORBA::Object_var obj = - orb_->resolve_initial_references ("RootPOA", - ACE_TRY_ENV); + orb_->resolve_initial_references ("RootPOA" + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Narrow the Object reference to a POA reference - root_poa_ = PortableServer::POA::_narrow (obj.in (), - ACE_TRY_ENV); + root_poa_ = PortableServer::POA::_narrow (obj.in () + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Get the POAManager of RootPOA - poa_manager_ = root_poa_->the_POAManager (ACE_TRY_ENV); + poa_manager_ = root_poa_->the_POAManager (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; } @@ -163,7 +163,7 @@ Server_i::create_poa (const char *name, { PortableServer::POA_ptr my_poa = 0; - ACE_DECLARE_NEW_CORBA_ENV; + TAO_ENV_DECLARE_NEW_ENV; ACE_TRY { policies_.length (4); @@ -171,37 +171,37 @@ Server_i::create_poa (const char *name, // ID Assignment Policy. policies_[0] = root_poa_->create_id_assignment_policy - (PortableServer::USER_ID, - ACE_TRY_ENV); + (PortableServer::USER_ID + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Lifespan Policy. policies_[1] = root_poa_->create_lifespan_policy - (PortableServer::PERSISTENT, - ACE_TRY_ENV); + (PortableServer::PERSISTENT + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Request Processing Policy. policies_[2] = root_poa_->create_request_processing_policy - (PortableServer::USE_SERVANT_MANAGER, - ACE_TRY_ENV); + (PortableServer::USE_SERVANT_MANAGER + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Servant Retention Policy. if (servant_retention_policy == 1) policies_[3] = root_poa_->create_servant_retention_policy - (PortableServer::RETAIN, - ACE_TRY_ENV); + (PortableServer::RETAIN + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (servant_retention_policy == 0) policies_[3] = root_poa_->create_servant_retention_policy - (PortableServer::NON_RETAIN, - ACE_TRY_ENV); + (PortableServer::NON_RETAIN + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Create myPOA as the child of RootPOA with the above @@ -210,8 +210,8 @@ Server_i::create_poa (const char *name, // being RETAIN or NONRETAIN respectively. my_poa = root_poa_->create_POA (name, poa_manager_.in (), - policies_, - ACE_TRY_ENV); + policies_ + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Destroy the policy objects as they have been passed to @@ -221,7 +221,7 @@ Server_i::create_poa (const char *name, ++i) { CORBA::Policy_ptr policy = policies_[i]; - policy->destroy (ACE_TRY_ENV); + policy->destroy (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; } } @@ -241,7 +241,7 @@ Server_i::create_poa (const char *name, int Server_i::create_activator (PortableServer::POA_var first_poa) { - ACE_DECLARE_NEW_CORBA_ENV; + TAO_ENV_DECLARE_NEW_ENV; ACE_TRY { // An Servant Activator object is created which will activate @@ -252,17 +252,17 @@ Server_i::create_activator (PortableServer::POA_var first_poa) // Set ServantActivator_i object as the servant_manager of // firstPOA. - first_poa->set_servant_manager (servant_activator_impl_, - ACE_TRY_ENV); + first_poa->set_servant_manager (servant_activator_impl_ + TAO_ENV_ARG_PARAMETER); // For the code above, we're using the CORBA 3.0 servant manager // semantics supported by TAO. For CORBA 2.x ORBs you'd need to // use the following code in place of the previous line: // - // PortableServer::ServantManager_var servant_activator = + // PortableServer::ServantManager_var servant_activator = // servant_activator_impl_->_this (); // // first_poa->set_servant_manager (servant_activator.in (), - // ACE_TRY_ENV); + // TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; // Create a reference with user created ID in firstPOA which @@ -275,8 +275,8 @@ Server_i::create_activator (PortableServer::POA_var first_poa) "create_MyFoo"); first_foo_ = first_poa->create_reference_with_id (first_foo_oid.in (), - "IDL:Foo:1.0", - ACE_TRY_ENV); + "IDL:Foo:1.0" + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; } ACE_CATCHANY @@ -294,7 +294,7 @@ Server_i::create_activator (PortableServer::POA_var first_poa) int Server_i::create_locator (PortableServer::POA_var second_poa) { - ACE_DECLARE_NEW_CORBA_ENV; + TAO_ENV_DECLARE_NEW_ENV; ACE_TRY { // An Servant Locator object is created which will activate @@ -305,16 +305,16 @@ Server_i::create_locator (PortableServer::POA_var second_poa) // Set ServantLocator_i object as the servant Manager of // secondPOA. - second_poa->set_servant_manager (servant_locator_impl_, - ACE_TRY_ENV); + second_poa->set_servant_manager (servant_locator_impl_ + TAO_ENV_ARG_PARAMETER); // For the code above, we're using the CORBA 3.0 servant manager // semantics supported by TAO. For CORBA 2.x ORBs you'd need to // use the following code in place of the previous line: // PortableServer::ServantManager_var servant_loactor = // servant_loator_impl_->_this (); - // + // // second_poa->set_servant_manager (servant_locator_impl_, - // ACE_TRY_ENV); + // TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; // Try to create a reference with user created ID in second_poa @@ -327,8 +327,8 @@ Server_i::create_locator (PortableServer::POA_var second_poa) "create_MyFoo"); second_foo_ = second_poa->create_reference_with_id (second_foo_oid.in (), - "IDL:Foo:1.0", - ACE_TRY_ENV); + "IDL:Foo:1.0" + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; } ACE_CATCHANY @@ -346,20 +346,20 @@ Server_i::create_locator (PortableServer::POA_var second_poa) int Server_i::run (void) { - ACE_DECLARE_NEW_CORBA_ENV; + TAO_ENV_DECLARE_NEW_ENV; ACE_TRY { // Invoke object_to_string on the references created in firstPOA // and secondPOA. CORBA::String_var first_foo_ior = - orb_->object_to_string (first_foo_.in (), - ACE_TRY_ENV); + orb_->object_to_string (first_foo_.in () + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; CORBA::String_var second_foo_ior = - orb_->object_to_string (second_foo_.in (), - ACE_TRY_ENV); + orb_->object_to_string (second_foo_.in () + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Print the ior's of first_foo and second_foo. @@ -376,15 +376,15 @@ Server_i::run (void) // Set the poa_manager state to active, ready to process // requests. - poa_manager_->activate (ACE_TRY_ENV); + poa_manager_->activate (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; // Run the ORB. - orb_->run (ACE_TRY_ENV); + orb_->run (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - orb_->destroy (ACE_TRY_ENV); + orb_->destroy (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; } ACE_CATCHANY diff --git a/TAO/examples/POA/Reference_Counted_Servant/server.cpp b/TAO/examples/POA/Reference_Counted_Servant/server.cpp index 7549c897e63..3b07f14c642 100644 --- a/TAO/examples/POA/Reference_Counted_Servant/server.cpp +++ b/TAO/examples/POA/Reference_Counted_Servant/server.cpp @@ -108,15 +108,15 @@ write_iors_to_file (const char *ior) int main (int argc, char **argv) { - ACE_DECLARE_NEW_CORBA_ENV; + TAO_ENV_DECLARE_NEW_ENV; ACE_TRY { // Initialize the ORB first. CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, - 0, - ACE_TRY_ENV); + 0 + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; int result = parse_args (argc, argv); @@ -125,19 +125,19 @@ main (int argc, char **argv) // Obtain the RootPOA. CORBA::Object_var obj = - orb->resolve_initial_references ("RootPOA", - ACE_TRY_ENV); + orb->resolve_initial_references ("RootPOA" + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Get the POA_var object from Object_var. PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (obj.in (), - ACE_TRY_ENV); + PortableServer::POA::_narrow (obj.in () + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Get the POAManager of the RootPOA. PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_TRY_ENV); + root_poa->the_POAManager (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; // Create a servant. @@ -149,16 +149,16 @@ main (int argc, char **argv) -1); // Get Object Reference for the foo_impl object. - Foo_var foo = foo_impl->_this (ACE_TRY_ENV); + Foo_var foo = foo_impl->_this (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; // This means that the ownership of <foo_impl> now belongs to // the POA. - foo_impl->_remove_ref (ACE_TRY_ENV); + foo_impl->_remove_ref (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; // Stringyfy all the object references and print them out. - CORBA::String_var ior = orb->object_to_string (foo.in (), ACE_TRY_ENV); + CORBA::String_var ior = orb->object_to_string (foo.in () TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; ACE_DEBUG ((LM_DEBUG, @@ -169,10 +169,10 @@ main (int argc, char **argv) if (write_result != 0) return write_result; - poa_manager->activate (ACE_TRY_ENV); + poa_manager->activate (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - orb->run (ACE_TRY_ENV); + orb->run (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; } ACE_CATCHANY diff --git a/TAO/examples/POA/RootPOA/RootPOA.cpp b/TAO/examples/POA/RootPOA/RootPOA.cpp index b6ab90b0029..007bbf9aa05 100644 --- a/TAO/examples/POA/RootPOA/RootPOA.cpp +++ b/TAO/examples/POA/RootPOA/RootPOA.cpp @@ -26,30 +26,30 @@ ACE_RCSID(RootPOA, RootPOA, "$Id$") int main (int argc, char **argv) { - ACE_DECLARE_NEW_CORBA_ENV; + TAO_ENV_DECLARE_NEW_ENV; ACE_TRY { // Initilize the ORB - CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, 0, ACE_TRY_ENV); + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, 0 TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Resolve the initial references for the name RootPOA thus getting // an object of type CORBA::Object. CORBA::Object_var obj = - orb->resolve_initial_references ("RootPOA", - ACE_TRY_ENV); + orb->resolve_initial_references ("RootPOA" + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // apply _narrow on the object of type CORBA::Object, to make it // a POA class Object. PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (obj.in (), ACE_TRY_ENV); + PortableServer::POA::_narrow (obj.in () TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Get the name of the root POA. CORBA::String_var poa_name = - root_poa->the_name (ACE_TRY_ENV); + root_poa->the_name (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; ACE_DEBUG ((LM_DEBUG, diff --git a/TAO/examples/POA/TIE/Foo_i.cpp b/TAO/examples/POA/TIE/Foo_i.cpp index 5f8b8e67cb1..65d50eaa5e9 100644 --- a/TAO/examples/POA/TIE/Foo_i.cpp +++ b/TAO/examples/POA/TIE/Foo_i.cpp @@ -26,7 +26,7 @@ ACE_RCSID(TIE, Foo_i, "$Id$") // Return this->value CORBA::Long -Tie_i::doit (CORBA::Environment &/*env*/) +Tie_i::doit (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)) { return this->value_; @@ -42,7 +42,7 @@ A_i::A_i (CORBA::Long value, // Return this->value CORBA::Long -A_i::doit (CORBA::Environment &/*env*/) +A_i::doit (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)) { return this->value_; @@ -50,7 +50,7 @@ A_i::doit (CORBA::Environment &/*env*/) // Return the Default POA of this Servant PortableServer::POA_ptr -A_i::_default_POA (CORBA::Environment &/*env*/) +A_i::_default_POA (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) { return PortableServer::POA::_duplicate (this->poa_.in ()); } @@ -65,7 +65,7 @@ Outer_i::B_i::B_i (CORBA::Long value, // Return this->value CORBA::Long -Outer_i::B_i::doit (CORBA::Environment &/*env*/) +Outer_i::B_i::doit (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)) { return this->value_; @@ -73,7 +73,7 @@ Outer_i::B_i::doit (CORBA::Environment &/*env*/) // Return the Default POA of this Servant PortableServer::POA_ptr -Outer_i::B_i::_default_POA (CORBA::Environment &/*env*/) +Outer_i::B_i::_default_POA (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) { return PortableServer::POA::_duplicate (this->poa_.in ()); } @@ -88,7 +88,7 @@ Outer_i::Inner_i::C_i::C_i (CORBA::Long value, // Return this->value CORBA::Long -Outer_i::Inner_i::C_i::doit (CORBA::Environment &/*env*/) +Outer_i::Inner_i::C_i::doit (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)) { return this->value_; @@ -96,7 +96,7 @@ Outer_i::Inner_i::C_i::doit (CORBA::Environment &/*env*/) // Return the Default POA of this Servant PortableServer::POA_ptr -Outer_i::Inner_i::C_i::_default_POA (CORBA::Environment &/*env*/) +Outer_i::Inner_i::C_i::_default_POA (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) { return PortableServer::POA::_duplicate (this->poa_.in ()); } diff --git a/TAO/examples/POA/TIE/Foo_i.h b/TAO/examples/POA/TIE/Foo_i.h index fdf7fce2ab6..1b3e190bd97 100644 --- a/TAO/examples/POA/TIE/Foo_i.h +++ b/TAO/examples/POA/TIE/Foo_i.h @@ -25,7 +25,7 @@ public: Tie_i (CORBA::Long value); // Simple doit method - virtual CORBA::Long doit (CORBA::Environment &env) + virtual CORBA::Long doit (TAO_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); protected: @@ -41,11 +41,11 @@ public: PortableServer::POA_ptr poa); // Simple doit method - virtual CORBA::Long doit (CORBA::Environment &env) + virtual CORBA::Long doit (TAO_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); // Returns the Default POA of this Servant object - virtual PortableServer::POA_ptr _default_POA (CORBA::Environment &env); + virtual PortableServer::POA_ptr _default_POA (TAO_ENV_SINGLE_ARG_DECL); protected: @@ -67,11 +67,11 @@ public: PortableServer::POA_ptr poa); // Simple doit method - virtual CORBA::Long doit (CORBA::Environment &env) + virtual CORBA::Long doit (TAO_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); // Returns the Default POA of this Servant object - virtual PortableServer::POA_ptr _default_POA (CORBA::Environment &env); + virtual PortableServer::POA_ptr _default_POA (TAO_ENV_SINGLE_ARG_DECL); protected: @@ -93,11 +93,11 @@ public: PortableServer::POA_ptr poa); // Simple doit method - virtual CORBA::Long doit (CORBA::Environment &env) + virtual CORBA::Long doit (TAO_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); // Returns the Default POA of this Servant object - virtual PortableServer::POA_ptr _default_POA (CORBA::Environment &env); + virtual PortableServer::POA_ptr _default_POA (TAO_ENV_SINGLE_ARG_DECL); protected: diff --git a/TAO/examples/POA/TIE/client.cpp b/TAO/examples/POA/TIE/client.cpp index 3306844d5d4..81e3d454956 100644 --- a/TAO/examples/POA/TIE/client.cpp +++ b/TAO/examples/POA/TIE/client.cpp @@ -90,47 +90,47 @@ print_stats (ACE_Profile_Timer::ACE_Elapsed_Time &elapsed_time, double tmp = 1000 / elapsed_time.real_time; ACE_DEBUG ((LM_DEBUG, - "\treal_time\t = %0.06f ms, \n" - "\tuser_time\t = %0.06f ms, \n" - "\tsystem_time\t = %0.06f ms, \n" - "\t%0.00f calls/second\n", - elapsed_time.real_time < 0.0 ? 0.0 : elapsed_time.real_time, - elapsed_time.user_time < 0.0 ? 0.0 : elapsed_time.user_time, - elapsed_time.system_time < 0.0 ? 0.0 : elapsed_time.system_time, - tmp < 0.0 ? 0.0 : tmp)); + "\treal_time\t = %0.06f ms, \n" + "\tuser_time\t = %0.06f ms, \n" + "\tsystem_time\t = %0.06f ms, \n" + "\t%0.00f calls/second\n", + elapsed_time.real_time < 0.0 ? 0.0 : elapsed_time.real_time, + elapsed_time.user_time < 0.0 ? 0.0 : elapsed_time.user_time, + elapsed_time.system_time < 0.0 ? 0.0 : elapsed_time.system_time, + tmp < 0.0 ? 0.0 : tmp)); } else ACE_ERROR ((LM_ERROR, - "\tNo time stats printed. Zero iterations or error ocurred.\n")); + "\tNo time stats printed. Zero iterations or error ocurred.\n")); } -template <class T, class T_var> +template <class T, class T_var> class Test { public: - static void run (CORBA::ORB_ptr orb, - char *IOR, - CORBA::Environment &ACE_TRY_ENV) + static void run (CORBA::ORB_ptr orb, + char *IOR + TAO_ENV_ARG_DECL) { if (IOR != 0) { // Get an object reference from the argument string. - CORBA::Object_var object = orb->string_to_object (IOR, ACE_TRY_ENV); + CORBA::Object_var object = orb->string_to_object (IOR TAO_ENV_ARG_PARAMETER); ACE_CHECK; - /*if (env.exception () != 0) + /*if (TAO_ENV_SINGLE_ARG_PARAMETER.exception () != 0) { - env.print_exception ("CORBA::ORB::string_to_object"); + TAO_ENV_ARG_PARAMETER.print_exception ("CORBA::ORB::string_to_object"); return; } */ // Try to narrow the object reference to a reference. - T_var foo = T::_narrow (object.in (), ACE_TRY_ENV); + T_var foo = T::_narrow (object.in () TAO_ENV_ARG_PARAMETER); ACE_CHECK; - - /*if (env.exception () != 0) + + /*if (TAO_ENV_SINGLE_ARG_PARAMETER.exception () != 0) { - env.print_exception ("_narrow"); + TAO_ENV_ARG_PARAMETER.print_exception ("_narrow"); return; } */ @@ -145,10 +145,10 @@ public: for (i = 0; i < iterations ; i++) { // Invoke the doit() method on the reference. - result = foo->doit (ACE_TRY_ENV); + result = foo->doit (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; } - + // stop the timer. timer.stop (); timer.elapsed_time (elapsed_time); @@ -156,16 +156,16 @@ public: // compute average time. print_stats (elapsed_time, i); - /*if (env.exception () != 0) + /*if (TAO_ENV_SINGLE_ARG_PARAMETER.exception () != 0) { - env.print_exception ("doit"); + TAO_ENV_ARG_PARAMETER.print_exception ("doit"); return; } */ // Print the result of doit () method on the reference. ACE_DEBUG ((LM_DEBUG, "%d\n", - result)); + result)); } } }; @@ -173,51 +173,48 @@ public: int main (int argc, char **argv) { - //CORBA::Environment env; - - - ACE_DECLARE_NEW_CORBA_ENV; + TAO_ENV_DECLARE_NEW_ENV; ACE_TRY { // Initialize the ORB - CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, 0, ACE_TRY_ENV); + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, 0 TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - + // Initialize options based on command-line arguments. int parse_args_result = parse_args (argc, argv); if (parse_args_result != 0) return parse_args_result; - + int i = 1; - Test<A, A_var>::run (orb.in (), - IOR[i++], - ACE_TRY_ENV); + Test<A, A_var>::run (orb.in (), + IOR[i++] + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - Test<Outer::B, Outer::B_var>::run (orb.in (), - IOR[i++], - ACE_TRY_ENV); + Test<Outer::B, Outer::B_var>::run (orb.in (), + IOR[i++] + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - Test<Outer::Inner::C, Outer::Inner::C_var>::run (orb.in (), - IOR[i++], - ACE_TRY_ENV); + Test<Outer::Inner::C, Outer::Inner::C_var>::run (orb.in (), + IOR[i++] + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; Test<A, A_var>::run (orb.in (), - IOR[i++], - ACE_TRY_ENV); + IOR[i++] + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - Test<Outer::B, Outer::B_var>::run (orb.in (), - IOR[i++], - ACE_TRY_ENV); + Test<Outer::B, Outer::B_var>::run (orb.in (), + IOR[i++] + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - Test<Outer::Inner::C, Outer::Inner::C_var>::run (orb.in (), - IOR[i++], - ACE_TRY_ENV); + Test<Outer::Inner::C, Outer::Inner::C_var>::run (orb.in (), + IOR[i++] + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; } ACE_CATCHANY diff --git a/TAO/examples/POA/TIE/server.cpp b/TAO/examples/POA/TIE/server.cpp index 72b13a2dfb4..c34a7549e4e 100644 --- a/TAO/examples/POA/TIE/server.cpp +++ b/TAO/examples/POA/TIE/server.cpp @@ -22,7 +22,7 @@ ACE_RCSID(TIE, server, "$Id$") int main (int argc, char **argv) { - ACE_DECLARE_NEW_CORBA_ENV; + TAO_ENV_DECLARE_NEW_ENV; char str[256]; @@ -31,26 +31,26 @@ main (int argc, char **argv) ACE_OS::strcpy (str, "CORBA::ORB_init"); // Initialize the ORB first. - CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, 0, ACE_TRY_ENV); + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, 0 TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Obtain the RootPOA. CORBA::Object_var obj = - orb->resolve_initial_references ("RootPOA", - ACE_TRY_ENV); + orb->resolve_initial_references ("RootPOA" + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; ACE_OS::strcpy (str, "PortableServer::POA::_narrow"); // Get the POA_var object from Object_var. PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (obj.in (), ACE_TRY_ENV); + PortableServer::POA::_narrow (obj.in () TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; ACE_OS::strcpy (str, "PortableServer::POA::the_POAManager"); // Get the POAManager of the RootPOA. PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_TRY_ENV); + root_poa->the_POAManager (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; @@ -61,13 +61,13 @@ main (int argc, char **argv) ACE_OS::strcpy (str,"PortableServer::POA::create_lifespan_policy"); // Lifespan policy policies[0] = - root_poa->create_lifespan_policy (PortableServer::PERSISTENT, ACE_TRY_ENV); + root_poa->create_lifespan_policy (PortableServer::PERSISTENT TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; ACE_OS::strcpy (str, "PortableServer::POA::create_implicit_activation_policy"); // Implicit activation policy policies[1] = - root_poa->create_implicit_activation_policy (PortableServer::IMPLICIT_ACTIVATION, ACE_TRY_ENV); + root_poa->create_implicit_activation_policy (PortableServer::IMPLICIT_ACTIVATION TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; ACE_OS::strcpy (str, "PortableServer::POA::create_POA"); @@ -76,8 +76,8 @@ main (int argc, char **argv) PortableServer::POA_var first_poa = root_poa->create_POA (name.c_str (), poa_manager.in (), - policies, - ACE_TRY_ENV); + policies + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; @@ -89,7 +89,7 @@ main (int argc, char **argv) ++i) { CORBA::Policy_ptr policy = policies[i]; - policy->destroy (ACE_TRY_ENV); + policy->destroy (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; } @@ -119,34 +119,34 @@ main (int argc, char **argv) ACE_OS::strcpy (str, "POA_A::_this"); // Get Object Reference for the a_impl object. - A_var a = a_impl._this (ACE_TRY_ENV); + A_var a = a_impl._this (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; ACE_OS::strcpy (str, "POA_Outer::B::_this"); // Get Object Reference for the b_impl object. - Outer::B_var b = b_impl._this (ACE_TRY_ENV); + Outer::B_var b = b_impl._this (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; ACE_OS::strcpy (str, "POA_Outer::Inner::C::_this"); // Get Object Reference for the c_impl object. - Outer::Inner::C_var c = c_impl._this (ACE_TRY_ENV); + Outer::Inner::C_var c = c_impl._this (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; #if defined (ACE_HAS_USING_KEYWORD) ACE_OS::strcpy (str, "POA_A::_this"); // Get Object Reference for the a_tie_impl object. - A_var a_tie = a_tie_impl._this (ACE_TRY_ENV); + A_var a_tie = a_tie_impl._this (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; ACE_OS::strcpy (str, "POA_Outer::B::_this"); // Get Object Reference for the a_tie_impl object. - Outer::B_var b_tie = b_tie_impl._this (ACE_TRY_ENV); + Outer::B_var b_tie = b_tie_impl._this (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; ACE_OS::strcpy (str, "POA_Outer::C::_this"); // Get Object Reference for the c_tie_impl object. - Outer::Inner::C_var c_tie = c_tie_impl._this (ACE_TRY_ENV); + Outer::Inner::C_var c_tie = c_tie_impl._this (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; #endif /* ACE_HAS_USING_KEYWORD */ @@ -154,23 +154,23 @@ main (int argc, char **argv) ACE_OS::strcpy (str, "CORBA::ORB::object_to_string"); // Stringyfy all the object references and print them out. CORBA::String_var first_ior = - orb->object_to_string (a.in (), ACE_TRY_ENV); + orb->object_to_string (a.in () TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Stringyfy all the object references and print them out. CORBA::String_var second_ior = - orb->object_to_string (b.in (), ACE_TRY_ENV); + orb->object_to_string (b.in () TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Stringyfy all the object references and print them out. CORBA::String_var third_ior = - orb->object_to_string (c.in (), ACE_TRY_ENV); + orb->object_to_string (c.in () TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; #if defined (ACE_HAS_USING_KEYWORD) // Stringyfy all the object references and print them out. CORBA::String_var forth_ior = - orb->object_to_string (a_tie.in (), ACE_TRY_ENV); + orb->object_to_string (a_tie.in () TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; FILE *output_file_1 = ACE_OS::fopen ("ior_1", "w"); @@ -203,13 +203,13 @@ main (int argc, char **argv) // Stringyfy all the object references and print them out. CORBA::String_var fifth_ior = - orb->object_to_string (b_tie.in (), ACE_TRY_ENV); + orb->object_to_string (b_tie.in () TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Stringyfy all the object references and print them out. CORBA::String_var sixth_ior = - orb->object_to_string (c_tie.in (), ACE_TRY_ENV); + orb->object_to_string (c_tie.in () TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; FILE *output_file_5 = ACE_OS::fopen ("ior_5", "w"); @@ -229,10 +229,10 @@ main (int argc, char **argv) #endif /* ACE_HAS_USING_KEYWORD */ - poa_manager->activate (ACE_TRY_ENV); + poa_manager->activate (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - orb->run (ACE_TRY_ENV); + orb->run (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; } ACE_CATCHANY |