diff options
author | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-01-17 07:09:47 +0000 |
---|---|---|
committer | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-01-17 07:09:47 +0000 |
commit | f5c918617eb1988fbfbc4da7ef6e832b81103464 (patch) | |
tree | 40960a0f36129102ce0d08245c0b6f1b14ed1053 | |
parent | 307f4d1ddbb3727a75ee591eed07cb54eeabb53e (diff) | |
download | ATCD-f5c918617eb1988fbfbc4da7ef6e832b81103464.tar.gz |
*** empty log message ***
22 files changed, 1430 insertions, 248 deletions
diff --git a/TAO/ChangeLog-98c b/TAO/ChangeLog-98c index d67202701c7..6278325efae 100644 --- a/TAO/ChangeLog-98c +++ b/TAO/ChangeLog-98c @@ -1,3 +1,36 @@ +Sat Jan 17 00:45:59 1998 Irfan Pyarali <irfan@cs.wustl.edu> + + * tests/POA: Added new tests: Explicit_Activation_POA_Ids and + NewPOA. + + * tao/servant_base.h (TAO_ServantBase): Added a _downcast method + that gets the servant with the correct vtable. Also added a new + class TAO_Local_ServantBase that overwrites _create_stub. + TAO_Local_ServantBase::_create_stub uses a fake key and does not + registration with the default POA. + + * tao/poaS.*: Added _downcast to the generated code. Also added + attribute accessor methods. Also updated constructors to + explicitly initialize the virtual base class (CORBA::Object). + + * tao/poaC.h: Added TAO_Local_ServantBase to the PortableServer + namespace as PortableServer::LocalServantBase. + + * tao/poaC.cpp (_narrow): Changed the implementation of _narrow to + produce a collocated class when appropriate. + + * tao/poa.cpp (TAO_POA::create_*_policy): Made sure these methods + return collocated classes and not implementation classes. + + * tao/poa.h (class TAO_POA_Policies): Added set methods to + TAO_POA_Policies. + + * tao/orbobj.cpp (resolve_poa): Made sure that the RootPOA is + created with the PortableServer::IMPLICIT_ACTIVATION policy. + + * tao/object: Added servant pointer and a collocated flag to + object class. + Fri Jan 16 03:27:30 1998 Irfan Pyarali <irfan@cs.wustl.edu> * tao: diff --git a/TAO/tao/iiopobj.h b/TAO/tao/iiopobj.h index fbea07d83f8..bd1a004f880 100644 --- a/TAO/tao/iiopobj.h +++ b/TAO/tao/iiopobj.h @@ -236,7 +236,7 @@ private: IIOP::Profile *fwd_profile_; // This is a pointer to a profile used if the object is not - // colocated in the current process. + // collocated in the current process. ~IIOP_Object (void); // Destructor is to be called only through Release() diff --git a/TAO/tao/orbobj.cpp b/TAO/tao/orbobj.cpp index 236d901d46e..8d27d67c002 100644 --- a/TAO/tao/orbobj.cpp +++ b/TAO/tao/orbobj.cpp @@ -306,12 +306,13 @@ CORBA_ORB::resolve_poa (void) if (poa == 0) { TAO_POA_Manager *manager = new TAO_POA_Manager; - TAO_POA_Policies default_policies; + TAO_POA_Policies root_poa_policies; + root_poa_policies.implicit_activation (PortableServer::IMPLICIT_ACTIVATION); // Construct a new POA poa = new TAO_Strategy_POA ("RootPOA", *manager, - default_policies, + root_poa_policies, 0, env); diff --git a/TAO/tao/poa.cpp b/TAO/tao/poa.cpp index b0f78ba731d..33e2499258f 100644 --- a/TAO/tao/poa.cpp +++ b/TAO/tao/poa.cpp @@ -12,13 +12,13 @@ // auto_ptr class #include "ace/Auto_Ptr.h" -template <class STUB, class COLOCATED_SKELETON, class IMPLEMENTATION> +template <class STUB, class COLLOCATED_SKELETON, class IMPLEMENTATION> IMPLEMENTATION * stub_to_impl (STUB stub) { - COLOCATED_SKELETON *colocated = ACE_dynamic_cast (COLOCATED_SKELETON *, stub); + COLLOCATED_SKELETON *collocated = ACE_dynamic_cast (COLLOCATED_SKELETON *, stub); - return ACE_dynamic_cast (IMPLEMENTATION *, colocated->_get_servant ()); + return ACE_dynamic_cast (IMPLEMENTATION *, collocated->_get_servant ()); } TAO_Thread_Policy::TAO_Thread_Policy (PortableServer::ThreadPolicyValue value) @@ -342,6 +342,10 @@ TAO_POA_Policies::parse_policy (const PortableServer::Policy_ptr policy, this->thread_ = thread->value (env); return; } + else + { + env.clear (); + } PortableServer::LifespanPolicy_var lifespan = PortableServer::LifespanPolicy::_narrow (policy, env); @@ -350,6 +354,10 @@ TAO_POA_Policies::parse_policy (const PortableServer::Policy_ptr policy, this->lifespan_ = lifespan->value (env); return; } + else + { + env.clear (); + } PortableServer::IdUniquenessPolicy_var id_uniqueness = PortableServer::IdUniquenessPolicy::_narrow (policy, env); @@ -358,6 +366,10 @@ TAO_POA_Policies::parse_policy (const PortableServer::Policy_ptr policy, this->id_uniqueness_ = id_uniqueness->value (env); return; } + else + { + env.clear (); + } PortableServer::IdAssignmentPolicy_var id_assignment = PortableServer::IdAssignmentPolicy::_narrow (policy, env); @@ -366,6 +378,10 @@ TAO_POA_Policies::parse_policy (const PortableServer::Policy_ptr policy, this->id_assignment_ = id_assignment->value (env); return; } + else + { + env.clear (); + } PortableServer::ImplicitActivationPolicy_var implicit_activation = PortableServer::ImplicitActivationPolicy::_narrow (policy, env); @@ -374,6 +390,10 @@ TAO_POA_Policies::parse_policy (const PortableServer::Policy_ptr policy, this->implicit_activation_ = implicit_activation->value (env); return; } + else + { + env.clear (); + } PortableServer::ServantRetentionPolicy_var servant_retention = PortableServer::ServantRetentionPolicy::_narrow (policy, env); @@ -382,6 +402,10 @@ TAO_POA_Policies::parse_policy (const PortableServer::Policy_ptr policy, this->servant_retention_ = servant_retention->value (env); return; } + else + { + env.clear (); + } PortableServer::RequestProcessingPolicy_var request_processing = PortableServer::RequestProcessingPolicy::_narrow (policy, env); @@ -390,6 +414,10 @@ TAO_POA_Policies::parse_policy (const PortableServer::Policy_ptr policy, this->request_processing_ = request_processing->value (env); return; } + else + { + env.clear (); + } CORBA::Exception *exception = new PortableServer::POA::InvalidPolicy; env.exception (exception); @@ -397,47 +425,89 @@ TAO_POA_Policies::parse_policy (const PortableServer::Policy_ptr policy, } PortableServer::ThreadPolicyValue -TAO_POA_Policies::thread (void) +TAO_POA_Policies::thread (void) const { return this->thread_; } +void +TAO_POA_Policies::thread (PortableServer::ThreadPolicyValue value) +{ + this->thread_ = value; +} + PortableServer::LifespanPolicyValue -TAO_POA_Policies::lifespan (void) +TAO_POA_Policies::lifespan (void) const { return this->lifespan_; } +void +TAO_POA_Policies::lifespan (PortableServer::LifespanPolicyValue value) +{ + this->lifespan_ = value; +} + PortableServer::IdUniquenessPolicyValue -TAO_POA_Policies::id_uniqueness (void) +TAO_POA_Policies::id_uniqueness (void) const { return this->id_uniqueness_; } +void +TAO_POA_Policies::id_uniqueness (PortableServer::IdUniquenessPolicyValue value) +{ + this->id_uniqueness_ = value; +} + PortableServer::IdAssignmentPolicyValue -TAO_POA_Policies::id_assignment (void) +TAO_POA_Policies::id_assignment (void) const { return this->id_assignment_; } +void +TAO_POA_Policies::id_assignment (PortableServer::IdAssignmentPolicyValue value) +{ + this->id_assignment_ = value; +} + PortableServer::ImplicitActivationPolicyValue -TAO_POA_Policies::implicit_activation (void) +TAO_POA_Policies::implicit_activation (void) const { return this->implicit_activation_; } +void +TAO_POA_Policies::implicit_activation (PortableServer::ImplicitActivationPolicyValue value) +{ + this->implicit_activation_ = value; +} + PortableServer::ServantRetentionPolicyValue -TAO_POA_Policies::servant_retention (void) +TAO_POA_Policies::servant_retention (void) const { return this->servant_retention_; } +void +TAO_POA_Policies::servant_retention (PortableServer::ServantRetentionPolicyValue value) +{ + this->servant_retention_ = value; +} + PortableServer::RequestProcessingPolicyValue -TAO_POA_Policies::request_processing (void) +TAO_POA_Policies::request_processing (void) const { return this->request_processing_; } +void +TAO_POA_Policies::request_processing (PortableServer::RequestProcessingPolicyValue value) +{ + this->request_processing_ = value; +} + TAO_POA::TAO_POA (const TAO_POA::String &adapter_name, TAO_POA_Manager &poa_manager, const TAO_POA_Policies &policies, @@ -2040,56 +2110,119 @@ PortableServer::ThreadPolicy_ptr TAO_POA::create_thread_policy (PortableServer::ThreadPolicyValue value, CORBA::Environment &env) { - ACE_UNUSED_ARG (env); - return new TAO_Thread_Policy (value); + auto_ptr<TAO_Thread_Policy> new_policy (new TAO_Thread_Policy (value)); + PortableServer::ThreadPolicy_var result = new_policy->_this (env); + if (env.exception () != 0) + return PortableServer::ThreadPolicy::_nil (); + else + { + // Make sure that the auto_ptr does not delete the + // implementation + new_policy.release (); + return result._retn (); + } } PortableServer::LifespanPolicy_ptr TAO_POA::create_lifespan_policy (PortableServer::LifespanPolicyValue value, CORBA::Environment &env) { - ACE_UNUSED_ARG (env); - return new TAO_Lifespan_Policy (value); + auto_ptr<TAO_Lifespan_Policy> new_policy (new TAO_Lifespan_Policy (value)); + PortableServer::LifespanPolicy_var result = new_policy->_this (env); + if (env.exception () != 0) + return PortableServer::LifespanPolicy::_nil (); + else + { + // Make sure that the auto_ptr does not delete the + // implementation + new_policy.release (); + return result._retn (); + } } PortableServer::IdUniquenessPolicy_ptr TAO_POA::create_id_uniqueness_policy (PortableServer::IdUniquenessPolicyValue value, CORBA::Environment &env) { - ACE_UNUSED_ARG (env); - return new TAO_Id_Uniqueness_Policy (value); + auto_ptr<TAO_Id_Uniqueness_Policy> new_policy (new TAO_Id_Uniqueness_Policy (value)); + PortableServer::IdUniquenessPolicy_var result = new_policy->_this (env); + if (env.exception () != 0) + return PortableServer::IdUniquenessPolicy::_nil (); + else + { + // Make sure that the auto_ptr does not delete the + // implementation + new_policy.release (); + return result._retn (); + } } PortableServer::IdAssignmentPolicy_ptr TAO_POA::create_id_assignment_policy (PortableServer::IdAssignmentPolicyValue value, CORBA::Environment &env) { - ACE_UNUSED_ARG (env); - return new TAO_Id_Assignment_Policy (value); + auto_ptr<TAO_Id_Assignment_Policy> new_policy (new TAO_Id_Assignment_Policy (value)); + PortableServer::IdAssignmentPolicy_var result = new_policy->_this (env); + if (env.exception () != 0) + return PortableServer::IdAssignmentPolicy::_nil (); + else + { + // Make sure that the auto_ptr does not delete the + // implementation + new_policy.release (); + return result._retn (); + } } PortableServer::ImplicitActivationPolicy_ptr TAO_POA::create_implicit_activation_policy (PortableServer::ImplicitActivationPolicyValue value, CORBA::Environment &env) { - ACE_UNUSED_ARG (env); - return new TAO_Implicit_Activation_Policy (value); + auto_ptr<TAO_Implicit_Activation_Policy> new_policy (new TAO_Implicit_Activation_Policy (value)); + PortableServer::ImplicitActivationPolicy_var result = new_policy->_this (env); + if (env.exception () != 0) + return PortableServer::ImplicitActivationPolicy::_nil (); + else + { + // Make sure that the auto_ptr does not delete the + // implementation + new_policy.release (); + return result._retn (); + } } PortableServer::ServantRetentionPolicy_ptr TAO_POA::create_servant_retention_policy (PortableServer::ServantRetentionPolicyValue value, CORBA::Environment &env) { - ACE_UNUSED_ARG (env); - return new TAO_Servant_Retention_Policy (value); + auto_ptr<TAO_Servant_Retention_Policy> new_policy (new TAO_Servant_Retention_Policy (value)); + PortableServer::ServantRetentionPolicy_var result = new_policy->_this (env); + if (env.exception () != 0) + return PortableServer::ServantRetentionPolicy::_nil (); + else + { + // Make sure that the auto_ptr does not delete the + // implementation + new_policy.release (); + return result._retn (); + } } PortableServer::RequestProcessingPolicy_ptr TAO_POA::create_request_processing_policy (PortableServer::RequestProcessingPolicyValue value, CORBA::Environment &env) { - ACE_UNUSED_ARG (env); - return new TAO_Request_Processing_Policy (value); + auto_ptr<TAO_Request_Processing_Policy> new_policy (new TAO_Request_Processing_Policy (value)); + PortableServer::RequestProcessingPolicy_var result = new_policy->_this (env); + if (env.exception () != 0) + return PortableServer::RequestProcessingPolicy::_nil (); + else + { + // Make sure that the auto_ptr does not delete the + // implementation + new_policy.release (); + return result._retn (); + } } CORBA::Boolean diff --git a/TAO/tao/poa.h b/TAO/tao/poa.h index 79aad80008f..130669fb8b9 100644 --- a/TAO/tao/poa.h +++ b/TAO/tao/poa.h @@ -180,19 +180,26 @@ public: TAO_POA_Policies (void); - PortableServer::ThreadPolicyValue thread (void); + PortableServer::ThreadPolicyValue thread (void) const; + void thread (PortableServer::ThreadPolicyValue value); - PortableServer::LifespanPolicyValue lifespan (void); + PortableServer::LifespanPolicyValue lifespan (void) const; + void lifespan (PortableServer::LifespanPolicyValue value); - PortableServer::IdUniquenessPolicyValue id_uniqueness (void); + PortableServer::IdUniquenessPolicyValue id_uniqueness (void) const; + void id_uniqueness (PortableServer::IdUniquenessPolicyValue value); - PortableServer::IdAssignmentPolicyValue id_assignment (void); + PortableServer::IdAssignmentPolicyValue id_assignment (void) const; + void id_assignment (PortableServer::IdAssignmentPolicyValue value); - PortableServer::ImplicitActivationPolicyValue implicit_activation (void); + PortableServer::ImplicitActivationPolicyValue implicit_activation (void) const; + void implicit_activation (PortableServer::ImplicitActivationPolicyValue value); - PortableServer::ServantRetentionPolicyValue servant_retention (void); + PortableServer::ServantRetentionPolicyValue servant_retention (void) const; + void servant_retention (PortableServer::ServantRetentionPolicyValue value); - PortableServer::RequestProcessingPolicyValue request_processing (void); + PortableServer::RequestProcessingPolicyValue request_processing (void) const; + void request_processing (PortableServer::RequestProcessingPolicyValue value); void parse_policies (const PortableServer::PolicyList& policies, CORBA::Environment &env); diff --git a/TAO/tao/poaC.cpp b/TAO/tao/poaC.cpp index d3e27b8ddb1..60365554983 100644 --- a/TAO/tao/poaC.cpp +++ b/TAO/tao/poaC.cpp @@ -44,18 +44,31 @@ PortableServer::CurrentBase_ptr PortableServer::CurrentBase::_duplicate (Portabl PortableServer::CurrentBase_ptr PortableServer::CurrentBase::_narrow (CORBA::Object_ptr obj, CORBA::Environment &env) { - if (CORBA::is_nil (obj)) return PortableServer::CurrentBase::_nil (); - if (obj->_is_a ("IDL:PortableServer/CurrentBase:1.0", env)) - { - STUB_Object *istub; - PortableServer::CurrentBase_ptr new_obj; // to be returned - if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR) - return PortableServer::CurrentBase::_nil (); - - new_obj = new PortableServer::CurrentBase (istub); // construct obj ref using the stub object - return new_obj; - } // end of if - return PortableServer::CurrentBase::_nil (); // _narrow failed + if (CORBA::is_nil (obj)) + return PortableServer::CurrentBase::_nil (); + + if (!obj->_is_a ("IDL:PortableServer/CurrentBase:1.0", env)) + return PortableServer::CurrentBase::_nil (); + + STUB_Object *istub; + if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR) + return PortableServer::CurrentBase::_nil (); + + if (!obj->_is_collocated () || obj->_servant () == 0) + { + PortableServer::CurrentBase_ptr new_obj; // to be returned + new_obj = new PortableServer::CurrentBase (istub); // construct obj ref using the stub object + return new_obj; + } + + POA_PortableServer::CurrentBase *servant = + (POA_PortableServer::CurrentBase *) obj->_servant ()->_downcast ("IDL:PortableServer/CurrentBase:1.0"); + + if (servant == 0) + return PortableServer::CurrentBase::_nil (); + + return new POA_PortableServer::_tao_collocated_CurrentBase (servant, istub); + } // end of _narrow PortableServer::CurrentBase_ptr PortableServer::CurrentBase::_nil (void) @@ -110,18 +123,31 @@ PortableServer::Policy_ptr PortableServer::Policy::_duplicate (PortableServer::P PortableServer::Policy_ptr PortableServer::Policy::_narrow (CORBA::Object_ptr obj, CORBA::Environment &env) { - if (CORBA::is_nil (obj)) return PortableServer::Policy::_nil (); - if (obj->_is_a ("IDL:PortableServer/Policy:1.0", env)) - { - STUB_Object *istub; - PortableServer::Policy_ptr new_obj; // to be returned - if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR) - return PortableServer::Policy::_nil (); - - new_obj = new PortableServer::Policy (istub); // construct obj ref using the stub object - return new_obj; - } // end of if - return PortableServer::Policy::_nil (); // _narrow failed + if (CORBA::is_nil (obj)) + return PortableServer::Policy::_nil (); + + if (!obj->_is_a ("IDL:PortableServer/Policy:1.0", env)) + return PortableServer::Policy::_nil (); + + STUB_Object *istub; + if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR) + return PortableServer::Policy::_nil (); + + if (!obj->_is_collocated () || obj->_servant () == 0) + { + PortableServer::Policy_ptr new_obj; // to be returned + new_obj = new PortableServer::Policy (istub); // construct obj ref using the stub object + return new_obj; + } + + POA_PortableServer::Policy *servant = + (POA_PortableServer::Policy *) obj->_servant ()->_downcast ("IDL:PortableServer/Policy:1.0"); + + if (servant == 0) + return PortableServer::Policy::_nil (); + + return new POA_PortableServer::_tao_collocated_Policy (servant, istub); + } // end of _narrow PortableServer::Policy_ptr PortableServer::Policy::_nil (void) @@ -603,18 +629,31 @@ PortableServer::ThreadPolicy_ptr PortableServer::ThreadPolicy::_duplicate (Porta PortableServer::ThreadPolicy_ptr PortableServer::ThreadPolicy::_narrow (CORBA::Object_ptr obj, CORBA::Environment &env) { - if (CORBA::is_nil (obj)) return PortableServer::ThreadPolicy::_nil (); - if (obj->_is_a ("IDL:PortableServer/ThreadPolicy:1.0", env)) - { - STUB_Object *istub; - PortableServer::ThreadPolicy_ptr new_obj; // to be returned - if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR) - return PortableServer::ThreadPolicy::_nil (); - - new_obj = new PortableServer::ThreadPolicy (istub); // construct obj ref using the stub object - return new_obj; - } // end of if - return PortableServer::ThreadPolicy::_nil (); // _narrow failed + if (CORBA::is_nil (obj)) + return PortableServer::ThreadPolicy::_nil (); + + if (!obj->_is_a ("IDL:PortableServer/ThreadPolicy:1.0", env)) + return PortableServer::ThreadPolicy::_nil (); + + STUB_Object *istub; + if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR) + return PortableServer::ThreadPolicy::_nil (); + + if (!obj->_is_collocated () || obj->_servant () == 0) + { + PortableServer::ThreadPolicy_ptr new_obj; // to be returned + new_obj = new PortableServer::ThreadPolicy (istub); // construct obj ref using the stub object + return new_obj; + } + + POA_PortableServer::ThreadPolicy *servant = + (POA_PortableServer::ThreadPolicy *) obj->_servant ()->_downcast ("IDL:PortableServer/ThreadPolicy:1.0"); + + if (servant == 0) + return PortableServer::ThreadPolicy::_nil (); + + return new POA_PortableServer::_tao_collocated_ThreadPolicy (servant, istub); + } // end of _narrow PortableServer::ThreadPolicy_ptr PortableServer::ThreadPolicy::_nil (void) @@ -706,18 +745,31 @@ PortableServer::LifespanPolicy_ptr PortableServer::LifespanPolicy::_duplicate (P PortableServer::LifespanPolicy_ptr PortableServer::LifespanPolicy::_narrow (CORBA::Object_ptr obj, CORBA::Environment &env) { - if (CORBA::is_nil (obj)) return PortableServer::LifespanPolicy::_nil (); - if (obj->_is_a ("IDL:PortableServer/LifespanPolicy:1.0", env)) - { - STUB_Object *istub; - PortableServer::LifespanPolicy_ptr new_obj; // to be returned - if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR) - return PortableServer::LifespanPolicy::_nil (); - - new_obj = new PortableServer::LifespanPolicy (istub); // construct obj ref using the stub object - return new_obj; - } // end of if - return PortableServer::LifespanPolicy::_nil (); // _narrow failed + if (CORBA::is_nil (obj)) + return PortableServer::LifespanPolicy::_nil (); + + if (!obj->_is_a ("IDL:PortableServer/LifespanPolicy:1.0", env)) + return PortableServer::LifespanPolicy::_nil (); + + STUB_Object *istub; + if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR) + return PortableServer::LifespanPolicy::_nil (); + + if (!obj->_is_collocated () || obj->_servant () == 0) + { + PortableServer::LifespanPolicy_ptr new_obj; // to be returned + new_obj = new PortableServer::LifespanPolicy (istub); // construct obj ref using the stub object + return new_obj; + } + + POA_PortableServer::LifespanPolicy *servant = + (POA_PortableServer::LifespanPolicy *) obj->_servant ()->_downcast ("IDL:PortableServer/LifespanPolicy:1.0"); + + if (servant == 0) + return PortableServer::LifespanPolicy::_nil (); + + return new POA_PortableServer::_tao_collocated_LifespanPolicy (servant, istub); + } // end of _narrow PortableServer::LifespanPolicy_ptr PortableServer::LifespanPolicy::_nil (void) @@ -809,18 +861,31 @@ PortableServer::IdUniquenessPolicy_ptr PortableServer::IdUniquenessPolicy::_dupl PortableServer::IdUniquenessPolicy_ptr PortableServer::IdUniquenessPolicy::_narrow (CORBA::Object_ptr obj, CORBA::Environment &env) { - if (CORBA::is_nil (obj)) return PortableServer::IdUniquenessPolicy::_nil (); - if (obj->_is_a ("IDL:PortableServer/IdUniquenessPolicy:1.0", env)) - { - STUB_Object *istub; - PortableServer::IdUniquenessPolicy_ptr new_obj; // to be returned - if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR) - return PortableServer::IdUniquenessPolicy::_nil (); - - new_obj = new PortableServer::IdUniquenessPolicy (istub); // construct obj ref using the stub object - return new_obj; - } // end of if - return PortableServer::IdUniquenessPolicy::_nil (); // _narrow failed + if (CORBA::is_nil (obj)) + return PortableServer::IdUniquenessPolicy::_nil (); + + if (!obj->_is_a ("IDL:PortableServer/IdUniquenessPolicy:1.0", env)) + return PortableServer::IdUniquenessPolicy::_nil (); + + STUB_Object *istub; + if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR) + return PortableServer::IdUniquenessPolicy::_nil (); + + if (!obj->_is_collocated () || obj->_servant () == 0) + { + PortableServer::IdUniquenessPolicy_ptr new_obj; // to be returned + new_obj = new PortableServer::IdUniquenessPolicy (istub); // construct obj ref using the stub object + return new_obj; + } + + POA_PortableServer::IdUniquenessPolicy *servant = + (POA_PortableServer::IdUniquenessPolicy *) obj->_servant ()->_downcast ("IDL:PortableServer/IdUniquenessPolicy:1.0"); + + if (servant == 0) + return PortableServer::IdUniquenessPolicy::_nil (); + + return new POA_PortableServer::_tao_collocated_IdUniquenessPolicy (servant, istub); + } // end of _narrow PortableServer::IdUniquenessPolicy_ptr PortableServer::IdUniquenessPolicy::_nil (void) @@ -912,18 +977,31 @@ PortableServer::IdAssignmentPolicy_ptr PortableServer::IdAssignmentPolicy::_dupl PortableServer::IdAssignmentPolicy_ptr PortableServer::IdAssignmentPolicy::_narrow (CORBA::Object_ptr obj, CORBA::Environment &env) { - if (CORBA::is_nil (obj)) return PortableServer::IdAssignmentPolicy::_nil (); - if (obj->_is_a ("IDL:PortableServer/IdAssignmentPolicy:1.0", env)) - { - STUB_Object *istub; - PortableServer::IdAssignmentPolicy_ptr new_obj; // to be returned - if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR) - return PortableServer::IdAssignmentPolicy::_nil (); - - new_obj = new PortableServer::IdAssignmentPolicy (istub); // construct obj ref using the stub object - return new_obj; - } // end of if - return PortableServer::IdAssignmentPolicy::_nil (); // _narrow failed + if (CORBA::is_nil (obj)) + return PortableServer::IdAssignmentPolicy::_nil (); + + if (!obj->_is_a ("IDL:PortableServer/IdAssignmentPolicy:1.0", env)) + return PortableServer::IdAssignmentPolicy::_nil (); + + STUB_Object *istub; + if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR) + return PortableServer::IdAssignmentPolicy::_nil (); + + if (!obj->_is_collocated () || obj->_servant () == 0) + { + PortableServer::IdAssignmentPolicy_ptr new_obj; // to be returned + new_obj = new PortableServer::IdAssignmentPolicy (istub); // construct obj ref using the stub object + return new_obj; + } + + POA_PortableServer::IdAssignmentPolicy *servant = + (POA_PortableServer::IdAssignmentPolicy *) obj->_servant ()->_downcast ("IDL:PortableServer/IdAssignmentPolicy:1.0"); + + if (servant == 0) + return PortableServer::IdAssignmentPolicy::_nil (); + + return new POA_PortableServer::_tao_collocated_IdAssignmentPolicy (servant, istub); + } // end of _narrow PortableServer::IdAssignmentPolicy_ptr PortableServer::IdAssignmentPolicy::_nil (void) @@ -1015,18 +1093,31 @@ PortableServer::ImplicitActivationPolicy_ptr PortableServer::ImplicitActivationP PortableServer::ImplicitActivationPolicy_ptr PortableServer::ImplicitActivationPolicy::_narrow (CORBA::Object_ptr obj, CORBA::Environment &env) { - if (CORBA::is_nil (obj)) return PortableServer::ImplicitActivationPolicy::_nil (); - if (obj->_is_a ("IDL:PortableServer/ImplicitActivationPolicy:1.0", env)) - { - STUB_Object *istub; - PortableServer::ImplicitActivationPolicy_ptr new_obj; // to be returned - if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR) - return PortableServer::ImplicitActivationPolicy::_nil (); - - new_obj = new PortableServer::ImplicitActivationPolicy (istub); // construct obj ref using the stub object - return new_obj; - } // end of if - return PortableServer::ImplicitActivationPolicy::_nil (); // _narrow failed + if (CORBA::is_nil (obj)) + return PortableServer::ImplicitActivationPolicy::_nil (); + + if (!obj->_is_a ("IDL:PortableServer/ImplicitActivationPolicy:1.0", env)) + return PortableServer::ImplicitActivationPolicy::_nil (); + + STUB_Object *istub; + if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR) + return PortableServer::ImplicitActivationPolicy::_nil (); + + if (!obj->_is_collocated () || obj->_servant () == 0) + { + PortableServer::ImplicitActivationPolicy_ptr new_obj; // to be returned + new_obj = new PortableServer::ImplicitActivationPolicy (istub); // construct obj ref using the stub object + return new_obj; + } + + POA_PortableServer::ImplicitActivationPolicy *servant = + (POA_PortableServer::ImplicitActivationPolicy *) obj->_servant ()->_downcast ("IDL:PortableServer/ImplicitActivationPolicy:1.0"); + + if (servant == 0) + return PortableServer::ImplicitActivationPolicy::_nil (); + + return new POA_PortableServer::_tao_collocated_ImplicitActivationPolicy (servant, istub); + } // end of _narrow PortableServer::ImplicitActivationPolicy_ptr PortableServer::ImplicitActivationPolicy::_nil (void) @@ -1118,18 +1209,31 @@ PortableServer::ServantRetentionPolicy_ptr PortableServer::ServantRetentionPolic PortableServer::ServantRetentionPolicy_ptr PortableServer::ServantRetentionPolicy::_narrow (CORBA::Object_ptr obj, CORBA::Environment &env) { - if (CORBA::is_nil (obj)) return PortableServer::ServantRetentionPolicy::_nil (); - if (obj->_is_a ("IDL:PortableServer/ServantRetentionPolicy:1.0", env)) - { - STUB_Object *istub; - PortableServer::ServantRetentionPolicy_ptr new_obj; // to be returned - if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR) - return PortableServer::ServantRetentionPolicy::_nil (); - - new_obj = new PortableServer::ServantRetentionPolicy (istub); // construct obj ref using the stub object - return new_obj; - } // end of if - return PortableServer::ServantRetentionPolicy::_nil (); // _narrow failed + if (CORBA::is_nil (obj)) + return PortableServer::ServantRetentionPolicy::_nil (); + + if (!obj->_is_a ("IDL:PortableServer/ServantRetentionPolicy:1.0", env)) + return PortableServer::ServantRetentionPolicy::_nil (); + + STUB_Object *istub; + if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR) + return PortableServer::ServantRetentionPolicy::_nil (); + + if (!obj->_is_collocated () || obj->_servant () == 0) + { + PortableServer::ServantRetentionPolicy_ptr new_obj; // to be returned + new_obj = new PortableServer::ServantRetentionPolicy (istub); // construct obj ref using the stub object + return new_obj; + } + + POA_PortableServer::ServantRetentionPolicy *servant = + (POA_PortableServer::ServantRetentionPolicy *) obj->_servant ()->_downcast ("IDL:PortableServer/ServantRetentionPolicy:1.0"); + + if (servant == 0) + return PortableServer::ServantRetentionPolicy::_nil (); + + return new POA_PortableServer::_tao_collocated_ServantRetentionPolicy (servant, istub); + } // end of _narrow PortableServer::ServantRetentionPolicy_ptr PortableServer::ServantRetentionPolicy::_nil (void) @@ -1222,18 +1326,31 @@ PortableServer::RequestProcessingPolicy_ptr PortableServer::RequestProcessingPol PortableServer::RequestProcessingPolicy_ptr PortableServer::RequestProcessingPolicy::_narrow (CORBA::Object_ptr obj, CORBA::Environment &env) { - if (CORBA::is_nil (obj)) return PortableServer::RequestProcessingPolicy::_nil (); - if (obj->_is_a ("IDL:PortableServer/RequestProcessingPolicy:1.0", env)) - { - STUB_Object *istub; - PortableServer::RequestProcessingPolicy_ptr new_obj; // to be returned - if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR) - return PortableServer::RequestProcessingPolicy::_nil (); - - new_obj = new PortableServer::RequestProcessingPolicy (istub); // construct obj ref using the stub object - return new_obj; - } // end of if - return PortableServer::RequestProcessingPolicy::_nil (); // _narrow failed + if (CORBA::is_nil (obj)) + return PortableServer::RequestProcessingPolicy::_nil (); + + if (!obj->_is_a ("IDL:PortableServer/RequestProcessingPolicy:1.0", env)) + return PortableServer::RequestProcessingPolicy::_nil (); + + STUB_Object *istub; + if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR) + return PortableServer::RequestProcessingPolicy::_nil (); + + if (!obj->_is_collocated () || obj->_servant () == 0) + { + PortableServer::RequestProcessingPolicy_ptr new_obj; // to be returned + new_obj = new PortableServer::RequestProcessingPolicy (istub); // construct obj ref using the stub object + return new_obj; + } + + POA_PortableServer::RequestProcessingPolicy *servant = + (POA_PortableServer::RequestProcessingPolicy *) obj->_servant ()->_downcast ("IDL:PortableServer/RequestProcessingPolicy:1.0"); + + if (servant == 0) + return PortableServer::RequestProcessingPolicy::_nil (); + + return new POA_PortableServer::_tao_collocated_RequestProcessingPolicy (servant, istub); + } // end of _narrow PortableServer::RequestProcessingPolicy_ptr PortableServer::RequestProcessingPolicy::_nil (void) @@ -1312,19 +1429,31 @@ PortableServer::POAManager_ptr PortableServer::POAManager::_duplicate (PortableS PortableServer::POAManager_ptr PortableServer::POAManager::_narrow (CORBA::Object_ptr obj, CORBA::Environment &env) { - if (CORBA::is_nil (obj)) return PortableServer::POAManager::_nil (); - if (obj->_is_a ("IDL:PortableServer/POAManager:1.0", env)) - { - STUB_Object *istub; - PortableServer::POAManager_ptr new_obj; // to be returned - if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR) - return PortableServer::POAManager::_nil (); - - new_obj = new PortableServer::POAManager (istub); // construct obj ref using the stub object - return new_obj; - } // end of if - return PortableServer::POAManager::_nil (); // _narrow failed -} // end of _narrow + if (CORBA::is_nil (obj)) + return PortableServer::POAManager::_nil (); + + if (!obj->_is_a ("IDL:PortableServer/POAManager:1.0", env)) + return PortableServer::POAManager::_nil (); + + STUB_Object *istub; + if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR) + return PortableServer::POAManager::_nil (); + + if (!obj->_is_collocated () || obj->_servant () == 0) + { + PortableServer::POAManager_ptr new_obj; // to be returned + new_obj = new PortableServer::POAManager (istub); // construct obj ref using the stub object + return new_obj; + } + + POA_PortableServer::POAManager *servant = + (POA_PortableServer::POAManager *) obj->_servant ()->_downcast ("IDL:PortableServer/POAManager:1.0"); + + if (servant == 0) + return PortableServer::POAManager::_nil (); + + return new POA_PortableServer::_tao_collocated_POAManager (servant, istub); +} PortableServer::POAManager_ptr PortableServer::POAManager::_nil (void) { @@ -1508,19 +1637,31 @@ PortableServer::AdapterActivator_ptr PortableServer::AdapterActivator::_duplicat PortableServer::AdapterActivator_ptr PortableServer::AdapterActivator::_narrow (CORBA::Object_ptr obj, CORBA::Environment &env) { - if (CORBA::is_nil (obj)) return PortableServer::AdapterActivator::_nil (); - if (obj->_is_a ("IDL:PortableServer/AdapterActivator:1.0", env)) - { - STUB_Object *istub; - PortableServer::AdapterActivator_ptr new_obj; // to be returned - if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR) - return PortableServer::AdapterActivator::_nil (); - - new_obj = new PortableServer::AdapterActivator (istub); // construct obj ref using the stub object - return new_obj; - } // end of if - return PortableServer::AdapterActivator::_nil (); // _narrow failed -} // end of _narrow + if (CORBA::is_nil (obj)) + return PortableServer::AdapterActivator::_nil (); + + if (!obj->_is_a ("IDL:PortableServer/AdapterActivator:1.0", env)) + return PortableServer::AdapterActivator::_nil (); + + STUB_Object *istub; + if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR) + return PortableServer::AdapterActivator::_nil (); + + if (!obj->_is_collocated () || obj->_servant () == 0) + { + PortableServer::AdapterActivator_ptr new_obj; // to be returned + new_obj = new PortableServer::AdapterActivator (istub); // construct obj ref using the stub object + return new_obj; + } + + POA_PortableServer::AdapterActivator *servant = + (POA_PortableServer::AdapterActivator *) obj->_servant ()->_downcast ("IDL:PortableServer/AdapterActivator:1.0"); + + if (servant == 0) + return PortableServer::AdapterActivator::_nil (); + + return new POA_PortableServer::_tao_collocated_AdapterActivator (servant, istub); +} PortableServer::AdapterActivator_ptr PortableServer::AdapterActivator::_nil (void) { @@ -1601,18 +1742,31 @@ PortableServer::ServantManager_ptr PortableServer::ServantManager::_duplicate (P PortableServer::ServantManager_ptr PortableServer::ServantManager::_narrow (CORBA::Object_ptr obj, CORBA::Environment &env) { - if (CORBA::is_nil (obj)) return PortableServer::ServantManager::_nil (); - if (obj->_is_a ("IDL:PortableServer/ServantManager:1.0", env)) - { - STUB_Object *istub; - PortableServer::ServantManager_ptr new_obj; // to be returned - if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR) - return PortableServer::ServantManager::_nil (); - - new_obj = new PortableServer::ServantManager (istub); // construct obj ref using the stub object - return new_obj; - } // end of if - return PortableServer::ServantManager::_nil (); // _narrow failed + if (CORBA::is_nil (obj)) + return PortableServer::ServantManager::_nil (); + + if (!obj->_is_a ("IDL:PortableServer/ServantManager:1.0", env)) + return PortableServer::ServantManager::_nil (); + + STUB_Object *istub; + if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR) + return PortableServer::ServantManager::_nil (); + + if (!obj->_is_collocated () || obj->_servant () == 0) + { + PortableServer::ServantManager_ptr new_obj; // to be returned + new_obj = new PortableServer::ServantManager (istub); // construct obj ref using the stub object + return new_obj; + } + + POA_PortableServer::ServantManager *servant = + (POA_PortableServer::ServantManager *) obj->_servant ()->_downcast ("IDL:PortableServer/ServantManager:1.0"); + + if (servant == 0) + return PortableServer::ServantManager::_nil (); + + return new POA_PortableServer::_tao_collocated_ServantManager (servant, istub); + } // end of _narrow PortableServer::ServantManager_ptr PortableServer::ServantManager::_nil (void) @@ -1667,18 +1821,31 @@ PortableServer::ServantActivator_ptr PortableServer::ServantActivator::_duplicat PortableServer::ServantActivator_ptr PortableServer::ServantActivator::_narrow (CORBA::Object_ptr obj, CORBA::Environment &env) { - if (CORBA::is_nil (obj)) return PortableServer::ServantActivator::_nil (); - if (obj->_is_a ("IDL:PortableServer/ServantActivator:1.0", env)) - { - STUB_Object *istub; - PortableServer::ServantActivator_ptr new_obj; // to be returned - if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR) - return PortableServer::ServantActivator::_nil (); - - new_obj = new PortableServer::ServantActivator (istub); // construct obj ref using the stub object - return new_obj; - } // end of if - return PortableServer::ServantActivator::_nil (); // _narrow failed + if (CORBA::is_nil (obj)) + return PortableServer::ServantActivator::_nil (); + + if (!obj->_is_a ("IDL:PortableServer/ServantActivator:1.0", env)) + return PortableServer::ServantActivator::_nil (); + + STUB_Object *istub; + if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR) + return PortableServer::ServantActivator::_nil (); + + if (!obj->_is_collocated () || obj->_servant () == 0) + { + PortableServer::ServantActivator_ptr new_obj; // to be returned + new_obj = new PortableServer::ServantActivator (istub); // construct obj ref using the stub object + return new_obj; + } + + POA_PortableServer::ServantActivator *servant = + (POA_PortableServer::ServantActivator *) obj->_servant ()->_downcast ("IDL:PortableServer/ServantActivator:1.0"); + + if (servant == 0) + return PortableServer::ServantActivator::_nil (); + + return new POA_PortableServer::_tao_collocated_ServantActivator (servant, istub); + } // end of _narrow PortableServer::ServantActivator_ptr PortableServer::ServantActivator::_nil (void) @@ -1748,18 +1915,31 @@ PortableServer::ServantLocator_ptr PortableServer::ServantLocator::_duplicate (P PortableServer::ServantLocator_ptr PortableServer::ServantLocator::_narrow (CORBA::Object_ptr obj, CORBA::Environment &env) { - if (CORBA::is_nil (obj)) return PortableServer::ServantLocator::_nil (); - if (obj->_is_a ("IDL:PortableServer/ServantLocator:1.0", env)) - { - STUB_Object *istub; - PortableServer::ServantLocator_ptr new_obj; // to be returned - if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR) - return PortableServer::ServantLocator::_nil (); - - new_obj = new PortableServer::ServantLocator (istub); // construct obj ref using the stub object - return new_obj; - } // end of if - return PortableServer::ServantLocator::_nil (); // _narrow failed + if (CORBA::is_nil (obj)) + return PortableServer::ServantLocator::_nil (); + + if (!obj->_is_a ("IDL:PortableServer/ServantLocator:1.0", env)) + return PortableServer::ServantLocator::_nil (); + + STUB_Object *istub; + if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR) + return PortableServer::ServantLocator::_nil (); + + if (!obj->_is_collocated () || obj->_servant () == 0) + { + PortableServer::ServantLocator_ptr new_obj; // to be returned + new_obj = new PortableServer::ServantLocator (istub); // construct obj ref using the stub object + return new_obj; + } + + POA_PortableServer::ServantLocator *servant = + (POA_PortableServer::ServantLocator *) obj->_servant ()->_downcast ("IDL:PortableServer/ServantLocator:1.0"); + + if (servant == 0) + return PortableServer::ServantLocator::_nil (); + + return new POA_PortableServer::_tao_collocated_ServantLocator (servant, istub); + } // end of _narrow PortableServer::ServantLocator_ptr PortableServer::ServantLocator::_nil (void) @@ -1829,18 +2009,31 @@ PortableServer::POA_ptr PortableServer::POA::_duplicate (PortableServer::POA_ptr PortableServer::POA_ptr PortableServer::POA::_narrow (CORBA::Object_ptr obj, CORBA::Environment &env) { - if (CORBA::is_nil (obj)) return PortableServer::POA::_nil (); - if (obj->_is_a ("IDL:PortableServer/POA:1.0", env)) + if (CORBA::is_nil (obj)) + return PortableServer::POA::_nil (); + + if (!obj->_is_a ("IDL:PortableServer/POA:1.0", env)) + return PortableServer::POA::_nil (); + + STUB_Object *istub; + if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR) + return PortableServer::POA::_nil (); + + if (!obj->_is_collocated () || obj->_servant () == 0) { - STUB_Object *istub; PortableServer::POA_ptr new_obj; // to be returned - if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR) - return PortableServer::POA::_nil (); - new_obj = new PortableServer::POA (istub); // construct obj ref using the stub object return new_obj; } // end of if - return PortableServer::POA::_nil (); // _narrow failed + + POA_PortableServer::POA *servant = + (POA_PortableServer::POA *) obj->_servant ()->_downcast ("IDL:PortableServer/POA:1.0"); + + if (servant == 0) + return PortableServer::POA::_nil (); + + return new POA_PortableServer::_tao_collocated_POA (servant, istub); + } // end of _narrow PortableServer::POA_ptr PortableServer::POA::_nil (void) @@ -2881,18 +3074,31 @@ PortableServer::Current_ptr PortableServer::Current::_duplicate (PortableServer: PortableServer::Current_ptr PortableServer::Current::_narrow (CORBA::Object_ptr obj, CORBA::Environment &env) { - if (CORBA::is_nil (obj)) return PortableServer::Current::_nil (); - if (obj->_is_a ("IDL:PortableServer/Current:1.0", env)) - { - STUB_Object *istub; - PortableServer::Current_ptr new_obj; // to be returned - if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR) - return PortableServer::Current::_nil (); - - new_obj = new PortableServer::Current (istub); // construct obj ref using the stub object - return new_obj; - } // end of if - return PortableServer::Current::_nil (); // _narrow failed + if (CORBA::is_nil (obj)) + return PortableServer::Current::_nil (); + + if (!obj->_is_a ("IDL:PortableServer/Current:1.0", env)) + return PortableServer::Current::_nil (); + + STUB_Object *istub; + if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR) + return PortableServer::Current::_nil (); + + if (!obj->_is_collocated () || obj->_servant () == 0) + { + PortableServer::Current_ptr new_obj; // to be returned + new_obj = new PortableServer::Current (istub); // construct obj ref using the stub object + return new_obj; + } + + POA_PortableServer::Current *servant = + (POA_PortableServer::Current *) obj->_servant ()->_downcast ("IDL:PortableServer/Current:1.0"); + + if (servant == 0) + return PortableServer::Current::_nil (); + + return new POA_PortableServer::_tao_collocated_Current (servant, istub); + } // end of _narrow PortableServer::Current_ptr PortableServer::Current::_nil (void) diff --git a/TAO/tao/poaC.h b/TAO/tao/poaC.h index a21b2ac961d..a90172d9b38 100644 --- a/TAO/tao/poaC.h +++ b/TAO/tao/poaC.h @@ -9,6 +9,7 @@ #define _TAO_IDL_POAC_H_ class TAO_ServantBase; +class TAO_Local_ServantBase; class TAO_Export PortableServer{ public: @@ -16,6 +17,8 @@ public: typedef TAO_ServantBase ServantBase; typedef ServantBase *Servant; + typedef TAO_Local_ServantBase LocalServantBase; + typedef CORBA::String Identifier; typedef CORBA::String_var Identifier_var; typedef CORBA::String_out Identifier_out; diff --git a/TAO/tao/poaS.cpp b/TAO/tao/poaS.cpp index 3e5ee847ef4..6f11e709061 100644 --- a/TAO/tao/poaS.cpp +++ b/TAO/tao/poaS.cpp @@ -66,11 +66,18 @@ const char* POA_PortableServer::CurrentBase::_interface_repository_id (void) con return "IDL:PortableServer/CurrentBase:1.0"; } +void * +POA_PortableServer::CurrentBase::_downcast (const char *repository_id) +{ + return this; +} + POA_PortableServer::_tao_collocated_CurrentBase::_tao_collocated_CurrentBase ( POA_PortableServer::CurrentBase_ptr servant, STUB_Object *stub ) - : CurrentBase (stub), + : CORBA_Object (stub, servant, CORBA::B_TRUE), + CurrentBase (stub), servant_ (servant) { } @@ -178,11 +185,18 @@ const char* POA_PortableServer::Policy::_interface_repository_id (void) const return "IDL:PortableServer/Policy:1.0"; } +void * +POA_PortableServer::Policy::_downcast (const char *repository_id) +{ + return this; +} + POA_PortableServer::_tao_collocated_Policy::_tao_collocated_Policy ( POA_PortableServer::Policy_ptr servant, STUB_Object *stub ) - : Policy (stub), + : CORBA_Object (stub, servant, CORBA::B_TRUE), + Policy (stub), servant_ (servant) { } @@ -288,11 +302,18 @@ const char* POA_PortableServer::ThreadPolicy::_interface_repository_id (void) co return "IDL:PortableServer/ThreadPolicy:1.0"; } +void * +POA_PortableServer::ThreadPolicy::_downcast (const char *repository_id) +{ + return this; +} + POA_PortableServer::_tao_collocated_ThreadPolicy::_tao_collocated_ThreadPolicy ( POA_PortableServer::ThreadPolicy_ptr servant, STUB_Object *stub ) - : ThreadPolicy (stub), + : CORBA_Object (stub, servant, CORBA::B_TRUE), + ThreadPolicy (stub), _tao_collocated_Policy (servant, 0), servant_ (servant) { @@ -303,6 +324,11 @@ POA_PortableServer::ThreadPolicy_ptr POA_PortableServer::_tao_collocated_ThreadP return this->servant_; } +PortableServer::ThreadPolicyValue +POA_PortableServer::_tao_collocated_ThreadPolicy::value (CORBA::Environment &env) +{ + return this->servant_->value (env); +} PortableServer::ThreadPolicy* POA_PortableServer::ThreadPolicy::_this (CORBA_Environment &_env) @@ -381,11 +407,18 @@ const char* POA_PortableServer::LifespanPolicy::_interface_repository_id (void) return "IDL:PortableServer/LifespanPolicy:1.0"; } +void * +POA_PortableServer::LifespanPolicy::_downcast (const char *repository_id) +{ + return this; +} + POA_PortableServer::_tao_collocated_LifespanPolicy::_tao_collocated_LifespanPolicy ( POA_PortableServer::LifespanPolicy_ptr servant, STUB_Object *stub ) - : LifespanPolicy (stub), + : CORBA_Object (stub, servant, CORBA::B_TRUE), + LifespanPolicy (stub), _tao_collocated_Policy (servant, 0), servant_ (servant) { @@ -396,6 +429,11 @@ POA_PortableServer::LifespanPolicy_ptr POA_PortableServer::_tao_collocated_Lifes return this->servant_; } +PortableServer::LifespanPolicyValue +POA_PortableServer::_tao_collocated_LifespanPolicy::value (CORBA::Environment &env) +{ + return this->servant_->value (env); +} PortableServer::LifespanPolicy* POA_PortableServer::LifespanPolicy::_this (CORBA_Environment &_env) @@ -474,11 +512,18 @@ const char* POA_PortableServer::IdUniquenessPolicy::_interface_repository_id (vo return "IDL:PortableServer/IdUniquenessPolicy:1.0"; } +void * +POA_PortableServer::IdUniquenessPolicy::_downcast (const char *repository_id) +{ + return this; +} + POA_PortableServer::_tao_collocated_IdUniquenessPolicy::_tao_collocated_IdUniquenessPolicy ( POA_PortableServer::IdUniquenessPolicy_ptr servant, STUB_Object *stub ) - : IdUniquenessPolicy (stub), + : CORBA_Object (stub, servant, CORBA::B_TRUE), + IdUniquenessPolicy (stub), _tao_collocated_Policy (servant, 0), servant_ (servant) { @@ -489,6 +534,11 @@ POA_PortableServer::IdUniquenessPolicy_ptr POA_PortableServer::_tao_collocated_I return this->servant_; } +PortableServer::IdUniquenessPolicyValue +POA_PortableServer::_tao_collocated_IdUniquenessPolicy::value (CORBA::Environment &env) +{ + return this->servant_->value (env); +} PortableServer::IdUniquenessPolicy* POA_PortableServer::IdUniquenessPolicy::_this (CORBA_Environment &_env) @@ -567,11 +617,18 @@ const char* POA_PortableServer::IdAssignmentPolicy::_interface_repository_id (vo return "IDL:PortableServer/IdAssignmentPolicy:1.0"; } +void * +POA_PortableServer::IdAssignmentPolicy::_downcast (const char *repository_id) +{ + return this; +} + POA_PortableServer::_tao_collocated_IdAssignmentPolicy::_tao_collocated_IdAssignmentPolicy ( POA_PortableServer::IdAssignmentPolicy_ptr servant, STUB_Object *stub ) - : IdAssignmentPolicy (stub), + : CORBA_Object (stub, servant, CORBA::B_TRUE), + IdAssignmentPolicy (stub), _tao_collocated_Policy (servant, 0), servant_ (servant) { @@ -582,6 +639,11 @@ POA_PortableServer::IdAssignmentPolicy_ptr POA_PortableServer::_tao_collocated_I return this->servant_; } +PortableServer::IdAssignmentPolicyValue +POA_PortableServer::_tao_collocated_IdAssignmentPolicy::value (CORBA::Environment &env) +{ + return this->servant_->value (env); +} PortableServer::IdAssignmentPolicy* POA_PortableServer::IdAssignmentPolicy::_this (CORBA_Environment &_env) @@ -660,11 +722,18 @@ const char* POA_PortableServer::ImplicitActivationPolicy::_interface_repository_ return "IDL:PortableServer/ImplicitActivationPolicy:1.0"; } +void * +POA_PortableServer::ImplicitActivationPolicy::_downcast (const char *repository_id) +{ + return this; +} + POA_PortableServer::_tao_collocated_ImplicitActivationPolicy::_tao_collocated_ImplicitActivationPolicy ( POA_PortableServer::ImplicitActivationPolicy_ptr servant, STUB_Object *stub ) - : ImplicitActivationPolicy (stub), + : CORBA_Object (stub, servant, CORBA::B_TRUE), + ImplicitActivationPolicy (stub), _tao_collocated_Policy (servant, 0), servant_ (servant) { @@ -675,6 +744,11 @@ POA_PortableServer::ImplicitActivationPolicy_ptr POA_PortableServer::_tao_colloc return this->servant_; } +PortableServer::ImplicitActivationPolicyValue +POA_PortableServer::_tao_collocated_ImplicitActivationPolicy::value (CORBA::Environment &env) +{ + return this->servant_->value (env); +} PortableServer::ImplicitActivationPolicy* POA_PortableServer::ImplicitActivationPolicy::_this (CORBA_Environment &_env) @@ -753,11 +827,18 @@ const char* POA_PortableServer::ServantRetentionPolicy::_interface_repository_id return "IDL:PortableServer/ServantRetentionPolicy:1.0"; } +void * +POA_PortableServer::ServantRetentionPolicy::_downcast (const char *repository_id) +{ + return this; +} + POA_PortableServer::_tao_collocated_ServantRetentionPolicy::_tao_collocated_ServantRetentionPolicy ( POA_PortableServer::ServantRetentionPolicy_ptr servant, STUB_Object *stub ) - : ServantRetentionPolicy (stub), + : CORBA_Object (stub, servant, CORBA::B_TRUE), + ServantRetentionPolicy (stub), _tao_collocated_Policy (servant, 0), servant_ (servant) { @@ -768,6 +849,11 @@ POA_PortableServer::ServantRetentionPolicy_ptr POA_PortableServer::_tao_collocat return this->servant_; } +PortableServer::ServantRetentionPolicyValue +POA_PortableServer::_tao_collocated_ServantRetentionPolicy::value (CORBA::Environment &env) +{ + return this->servant_->value (env); +} PortableServer::ServantRetentionPolicy* POA_PortableServer::ServantRetentionPolicy::_this (CORBA_Environment &_env) @@ -846,11 +932,18 @@ const char* POA_PortableServer::RequestProcessingPolicy::_interface_repository_i return "IDL:PortableServer/RequestProcessingPolicy:1.0"; } +void * +POA_PortableServer::RequestProcessingPolicy::_downcast (const char *repository_id) +{ + return this; +} + POA_PortableServer::_tao_collocated_RequestProcessingPolicy::_tao_collocated_RequestProcessingPolicy ( POA_PortableServer::RequestProcessingPolicy_ptr servant, STUB_Object *stub ) - : RequestProcessingPolicy (stub), + : CORBA_Object (stub, servant, CORBA::B_TRUE), + RequestProcessingPolicy (stub), _tao_collocated_Policy (servant, 0), servant_ (servant) { @@ -861,6 +954,11 @@ POA_PortableServer::RequestProcessingPolicy_ptr POA_PortableServer::_tao_colloca return this->servant_; } +PortableServer::RequestProcessingPolicyValue +POA_PortableServer::_tao_collocated_RequestProcessingPolicy::value (CORBA::Environment &env) +{ + return this->servant_->value (env); +} PortableServer::RequestProcessingPolicy* POA_PortableServer::RequestProcessingPolicy::_this (CORBA_Environment &_env) @@ -995,11 +1093,18 @@ const char* POA_PortableServer::POAManager::_interface_repository_id (void) cons return "IDL:PortableServer/POAManager:1.0"; } +void * +POA_PortableServer::POAManager::_downcast (const char *repository_id) +{ + return this; +} + POA_PortableServer::_tao_collocated_POAManager::_tao_collocated_POAManager ( POA_PortableServer::POAManager_ptr servant, STUB_Object *stub ) - : POAManager (stub), + : CORBA_Object (stub, servant, CORBA::B_TRUE), + POAManager (stub), servant_ (servant) { } @@ -1146,11 +1251,18 @@ const char* POA_PortableServer::AdapterActivator::_interface_repository_id (void return "IDL:PortableServer/AdapterActivator:1.0"; } +void * +POA_PortableServer::AdapterActivator::_downcast (const char *repository_id) +{ + return this; +} + POA_PortableServer::_tao_collocated_AdapterActivator::_tao_collocated_AdapterActivator ( POA_PortableServer::AdapterActivator_ptr servant, STUB_Object *stub ) - : AdapterActivator (stub), + : CORBA_Object (stub, servant, CORBA::B_TRUE), + AdapterActivator (stub), servant_ (servant) { } @@ -1236,11 +1348,18 @@ const char* POA_PortableServer::ServantManager::_interface_repository_id (void) return "IDL:PortableServer/ServantManager:1.0"; } +void * +POA_PortableServer::ServantManager::_downcast (const char *repository_id) +{ + return this; +} + POA_PortableServer::_tao_collocated_ServantManager::_tao_collocated_ServantManager ( POA_PortableServer::ServantManager_ptr servant, STUB_Object *stub ) - : ServantManager (stub), + : CORBA_Object (stub, servant, CORBA::B_TRUE), + ServantManager (stub), servant_ (servant) { } @@ -1328,11 +1447,18 @@ const char* POA_PortableServer::ServantActivator::_interface_repository_id (void return "IDL:PortableServer/ServantActivator:1.0"; } +void * +POA_PortableServer::ServantActivator::_downcast (const char *repository_id) +{ + return this; +} + POA_PortableServer::_tao_collocated_ServantActivator::_tao_collocated_ServantActivator ( POA_PortableServer::ServantActivator_ptr servant, STUB_Object *stub ) - : ServantActivator (stub), + : CORBA_Object (stub, servant, CORBA::B_TRUE), + ServantActivator (stub), _tao_collocated_ServantManager (servant, 0), servant_ (servant) { @@ -1453,11 +1579,18 @@ const char* POA_PortableServer::ServantLocator::_interface_repository_id (void) return "IDL:PortableServer/ServantLocator:1.0"; } +void * +POA_PortableServer::ServantLocator::_downcast (const char *repository_id) +{ + return this; +} + POA_PortableServer::_tao_collocated_ServantLocator::_tao_collocated_ServantLocator ( POA_PortableServer::ServantLocator_ptr servant, STUB_Object *stub ) - : ServantLocator (stub), + : CORBA_Object (stub, servant, CORBA::B_TRUE), + ServantLocator (stub), _tao_collocated_ServantManager (servant, 0), servant_ (servant) { @@ -2089,11 +2222,17 @@ const char* POA_PortableServer::POA::_interface_repository_id (void) const return "IDL:PortableServer/POA:1.0"; } +void * +POA_PortableServer::POA::_downcast (const char *repository_id) +{ + return this; +} + POA_PortableServer::_tao_collocated_POA::_tao_collocated_POA ( POA_PortableServer::POA_ptr servant, STUB_Object *stub ) - : CORBA_Object (stub), + : CORBA_Object (stub, servant, CORBA::B_TRUE), POA (stub), servant_ (servant) { @@ -2222,6 +2361,36 @@ PortableServer::RequestProcessingPolicy_ptr POA_PortableServer::_tao_collocated_ ); } +char * +POA_PortableServer::_tao_collocated_POA::the_name (CORBA::Environment &env) +{ + return this->servant_->the_name (env); +} + +PortableServer::POA_ptr +POA_PortableServer::_tao_collocated_POA::the_parent (CORBA::Environment &env) +{ + return this->servant_->the_parent (env); +} + +PortableServer::POAManager_ptr +POA_PortableServer::_tao_collocated_POA::the_POAManager (CORBA::Environment &env) +{ + return this->servant_->the_POAManager (env); +} + +PortableServer::AdapterActivator_ptr +POA_PortableServer::_tao_collocated_POA::the_activator (CORBA::Environment &env) +{ + return this->servant_->the_activator (env); +} + +void +POA_PortableServer::_tao_collocated_POA::the_activator(PortableServer::AdapterActivator_ptr the_activator, CORBA::Environment &env) +{ + this->servant_->the_activator(the_activator, env); +} + PortableServer::ServantManager_ptr POA_PortableServer::_tao_collocated_POA::get_servant_manager ( CORBA::Environment &_tao_environment ) @@ -2490,11 +2659,18 @@ const char* POA_PortableServer::Current::_interface_repository_id (void) const return "IDL:PortableServer/Current:1.0"; } +void * +POA_PortableServer::Current::_downcast (const char *repository_id) +{ + return this; +} + POA_PortableServer::_tao_collocated_Current::_tao_collocated_Current ( POA_PortableServer::Current_ptr servant, STUB_Object *stub ) - : Current (stub), + : CORBA_Object (stub, servant, CORBA::B_TRUE), + Current (stub), _tao_collocated_CurrentBase (servant, 0), servant_ (servant) { diff --git a/TAO/tao/poaS.h b/TAO/tao/poaS.h index 911d469f15d..d381c9859c1 100644 --- a/TAO/tao/poaS.h +++ b/TAO/tao/poaS.h @@ -15,7 +15,7 @@ class POA_PortableServer public: class CurrentBase; typedef CurrentBase *CurrentBase_ptr; - class CurrentBase : public virtual PortableServer::ServantBase + class CurrentBase : public virtual PortableServer::LocalServantBase { protected: CurrentBase (void); @@ -27,6 +27,7 @@ public: PortableServer::CurrentBase *_this (CORBA::Environment &_tao_environment); virtual const char* _interface_repository_id (void) const; + virtual void *_downcast (const char *repository_id); }; @@ -52,7 +53,7 @@ public: class Policy; typedef Policy *Policy_ptr; - class Policy : public virtual PortableServer::ServantBase + class Policy : public virtual PortableServer::LocalServantBase { protected: Policy (void); @@ -70,6 +71,7 @@ public: PortableServer::Policy *_this (CORBA::Environment &_tao_environment); virtual const char* _interface_repository_id (void) const; + virtual void *_downcast (const char *repository_id); }; @@ -120,6 +122,7 @@ public: PortableServer::ThreadPolicy *_this (CORBA::Environment &_tao_environment); virtual const char* _interface_repository_id (void) const; + virtual void *_downcast (const char *repository_id); }; @@ -135,6 +138,7 @@ public: STUB_Object *stub ); ThreadPolicy_ptr _get_servant (void) const; + virtual PortableServer::ThreadPolicyValue value (CORBA::Environment &env); private: ThreadPolicy_ptr servant_; @@ -165,6 +169,7 @@ public: PortableServer::LifespanPolicy *_this (CORBA::Environment &_tao_environment); virtual const char* _interface_repository_id (void) const; + virtual void *_downcast (const char *repository_id); }; @@ -180,6 +185,7 @@ public: STUB_Object *stub ); LifespanPolicy_ptr _get_servant (void) const; + virtual PortableServer::LifespanPolicyValue value (CORBA::Environment &env); private: LifespanPolicy_ptr servant_; @@ -210,6 +216,7 @@ public: PortableServer::IdUniquenessPolicy *_this (CORBA::Environment &_tao_environment); virtual const char* _interface_repository_id (void) const; + virtual void *_downcast (const char *repository_id); }; @@ -225,6 +232,7 @@ public: STUB_Object *stub ); IdUniquenessPolicy_ptr _get_servant (void) const; + virtual PortableServer::IdUniquenessPolicyValue value (CORBA::Environment &env); private: IdUniquenessPolicy_ptr servant_; @@ -255,6 +263,7 @@ public: PortableServer::IdAssignmentPolicy *_this (CORBA::Environment &_tao_environment); virtual const char* _interface_repository_id (void) const; + virtual void *_downcast (const char *repository_id); }; @@ -270,6 +279,7 @@ public: STUB_Object *stub ); IdAssignmentPolicy_ptr _get_servant (void) const; + virtual PortableServer::IdAssignmentPolicyValue value (CORBA::Environment &env); private: IdAssignmentPolicy_ptr servant_; @@ -300,6 +310,7 @@ public: PortableServer::ImplicitActivationPolicy *_this (CORBA::Environment &_tao_environment); virtual const char* _interface_repository_id (void) const; + virtual void *_downcast (const char *repository_id); }; @@ -315,6 +326,7 @@ public: STUB_Object *stub ); ImplicitActivationPolicy_ptr _get_servant (void) const; + virtual PortableServer::ImplicitActivationPolicyValue value (CORBA::Environment &env); private: ImplicitActivationPolicy_ptr servant_; @@ -345,6 +357,7 @@ public: PortableServer::ServantRetentionPolicy *_this (CORBA::Environment &_tao_environment); virtual const char* _interface_repository_id (void) const; + virtual void *_downcast (const char *repository_id); }; @@ -360,6 +373,7 @@ public: STUB_Object *stub ); ServantRetentionPolicy_ptr _get_servant (void) const; + virtual PortableServer::ServantRetentionPolicyValue value (CORBA::Environment &env); private: ServantRetentionPolicy_ptr servant_; @@ -390,6 +404,7 @@ public: PortableServer::RequestProcessingPolicy *_this (CORBA::Environment &_tao_environment); virtual const char* _interface_repository_id (void) const; + virtual void *_downcast (const char *repository_id); }; @@ -405,6 +420,7 @@ public: STUB_Object *stub ); RequestProcessingPolicy_ptr _get_servant (void) const; + virtual PortableServer::RequestProcessingPolicyValue value (CORBA::Environment &env); private: RequestProcessingPolicy_ptr servant_; @@ -416,7 +432,7 @@ public: class POAManager; typedef POAManager *POAManager_ptr; - class POAManager : public virtual PortableServer::ServantBase + class POAManager : public virtual PortableServer::LocalServantBase { protected: POAManager (void); @@ -440,6 +456,7 @@ public: PortableServer::POAManager *_this (CORBA::Environment &_tao_environment); virtual const char* _interface_repository_id (void) const; + virtual void *_downcast (const char *repository_id); }; @@ -481,7 +498,7 @@ public: class AdapterActivator; typedef AdapterActivator *AdapterActivator_ptr; - class AdapterActivator : public virtual PortableServer::ServantBase + class AdapterActivator : public virtual PortableServer::LocalServantBase { protected: AdapterActivator (void); @@ -496,6 +513,7 @@ public: PortableServer::AdapterActivator *_this (CORBA::Environment &_tao_environment); virtual const char* _interface_repository_id (void) const; + virtual void *_downcast (const char *repository_id); }; @@ -526,7 +544,7 @@ public: class ServantManager; typedef ServantManager *ServantManager_ptr; - class ServantManager : public virtual PortableServer::ServantBase + class ServantManager : public virtual PortableServer::LocalServantBase { protected: ServantManager (void); @@ -538,6 +556,7 @@ public: PortableServer::ServantManager *_this (CORBA::Environment &_tao_environment); virtual const char* _interface_repository_id (void) const; + virtual void *_downcast (const char *repository_id); }; @@ -581,6 +600,7 @@ public: PortableServer::ServantActivator *_this (CORBA::Environment &_tao_environment); virtual const char* _interface_repository_id (void) const; + virtual void *_downcast (const char *repository_id); }; @@ -638,6 +658,7 @@ public: PortableServer::ServantLocator *_this (CORBA::Environment &_tao_environment); virtual const char* _interface_repository_id (void) const; + virtual void *_downcast (const char *repository_id); }; @@ -679,7 +700,7 @@ public: class POA; typedef POA *POA_ptr; - class POA : public virtual PortableServer::ServantBase + class POA : public virtual PortableServer::LocalServantBase { protected: POA (void); @@ -781,6 +802,7 @@ public: PortableServer::POA *_this (CORBA::Environment &_tao_environment); virtual const char* _interface_repository_id (void) const; + virtual void *_downcast (const char *repository_id); }; @@ -839,6 +861,16 @@ public: PortableServer::RequestProcessingPolicyValue value, CORBA::Environment &_tao_environment ); + virtual char * the_name (CORBA::Environment &env); + + virtual PortableServer::POA_ptr the_parent (CORBA::Environment &env); + + virtual PortableServer::POAManager_ptr the_POAManager (CORBA::Environment &env); + + virtual PortableServer::AdapterActivator_ptr the_activator (CORBA::Environment &env); + + virtual void the_activator(PortableServer::AdapterActivator_ptr the_activator, CORBA::Environment &env); + virtual PortableServer::ServantManager_ptr get_servant_manager ( CORBA::Environment &_tao_environment ); @@ -928,6 +960,7 @@ public: PortableServer::Current *_this (CORBA::Environment &_tao_environment); virtual const char* _interface_repository_id (void) const; + virtual void *_downcast (const char *repository_id); }; diff --git a/TAO/tao/servant_base.cpp b/TAO/tao/servant_base.cpp index a33f6a45652..30658f389d1 100644 --- a/TAO/tao/servant_base.cpp +++ b/TAO/tao/servant_base.cpp @@ -104,3 +104,12 @@ TAO_ServantBase::_create_stub (CORBA_Environment &_env) return stub; } + +STUB_Object * +TAO_Local_ServantBase::_create_stub (CORBA_Environment &_env) +{ + // Note the use of a fake key and no registration with POAs + return new IIOP_Object (CORBA::string_copy (this->_interface_repository_id ()), + IIOP::Profile (TAO_ORB_Core_instance ()->orb_params ()->addr (), + "0")); +} diff --git a/TAO/tao/servant_base.h b/TAO/tao/servant_base.h index f8bafc85d88..0002288ba7c 100644 --- a/TAO/tao/servant_base.h +++ b/TAO/tao/servant_base.h @@ -46,6 +46,10 @@ public: // Get the "parent" in the QueryInterface hierarchy. virtual const char *_interface_repository_id (void) const = 0; + // Get this interface's repository id + + virtual void *_downcast (const char *repository_id) = 0; + // Get the correct vtable protected: TAO_ServantBase (void); @@ -72,4 +76,15 @@ protected: // @@ TODO find out why is this here.... }; +class TAO_Export TAO_Local_ServantBase : public TAO_ServantBase +{ + // = TITLE + // Base class for local skeletons and servants. + // +protected: + STUB_Object *_create_stub (CORBA_Environment &_env); + // This is an auxiliar method for _this(). Make sure *not* to + // register with the default POA +}; + #endif /* SERVANT_BASE_H */ diff --git a/TAO/tests/POA/Explicit_Activation_POA_Ids/Explicit_Activation_POA_Ids.dsp b/TAO/tests/POA/Explicit_Activation_POA_Ids/Explicit_Activation_POA_Ids.dsp new file mode 100644 index 00000000000..70c5085fcd9 --- /dev/null +++ b/TAO/tests/POA/Explicit_Activation_POA_Ids/Explicit_Activation_POA_Ids.dsp @@ -0,0 +1,86 @@ +# Microsoft Developer Studio Project File - Name="Explicit_Activation_POA_Ids" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=Explicit_Activation_POA_Ids - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "Explicit_Activation_POA_Ids.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "Explicit_Activation_POA_Ids.mak"\
+ CFG="Explicit_Activation_POA_Ids - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Explicit_Activation_POA_Ids - Win32 Release" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "Explicit_Activation_POA_Ids - Win32 Debug" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Explicit_Activation_POA_Ids - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "Explicit_Activation_POA_Ids - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "Explicit_Activation_POA_Ids - Win32 Release"
+# Name "Explicit_Activation_POA_Ids - Win32 Debug"
+# End Target
+# End Project
diff --git a/TAO/tests/POA/Explicit_Activation_POA_Ids/Explicit_Activation_POA_Ids.dsw b/TAO/tests/POA/Explicit_Activation_POA_Ids/Explicit_Activation_POA_Ids.dsw new file mode 100644 index 00000000000..f6006d20cb7 --- /dev/null +++ b/TAO/tests/POA/Explicit_Activation_POA_Ids/Explicit_Activation_POA_Ids.dsw @@ -0,0 +1,41 @@ +Microsoft Developer Studio Workspace File, Format Version 5.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "client"=.\client.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "server"=.\server.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/TAO/tests/POA/Explicit_Activation_POA_Ids/Foo.idl b/TAO/tests/POA/Explicit_Activation_POA_Ids/Foo.idl new file mode 100644 index 00000000000..9e248115e9c --- /dev/null +++ b/TAO/tests/POA/Explicit_Activation_POA_Ids/Foo.idl @@ -0,0 +1,4 @@ +interface Foo +{ + long doit(); +}; diff --git a/TAO/tests/POA/Explicit_Activation_POA_Ids/MyFooServant.cpp b/TAO/tests/POA/Explicit_Activation_POA_Ids/MyFooServant.cpp new file mode 100644 index 00000000000..91f748c1900 --- /dev/null +++ b/TAO/tests/POA/Explicit_Activation_POA_Ids/MyFooServant.cpp @@ -0,0 +1,25 @@ +#include "MyFooServant.h" + +MyFooServant::MyFooServant (PortableServer::POA_ptr poa, + CORBA::Long value) + : poa_ (PortableServer::POA::_duplicate (poa)), + value_ (value) +{ +} + +MyFooServant::~MyFooServant (void) +{ +} + +PortableServer::POA_ptr +MyFooServant::_default_POA (CORBA::Environment &env) +{ + return PortableServer::POA::_duplicate (this->poa_); +} + +CORBA::Long +MyFooServant::doit (CORBA::Environment &env) +{ + return this->value_; +} + diff --git a/TAO/tests/POA/Explicit_Activation_POA_Ids/MyFooServant.h b/TAO/tests/POA/Explicit_Activation_POA_Ids/MyFooServant.h new file mode 100644 index 00000000000..3b7502cb466 --- /dev/null +++ b/TAO/tests/POA/Explicit_Activation_POA_Ids/MyFooServant.h @@ -0,0 +1,23 @@ +#if !defined (MYFOOSERVANT_H) +#define MYFOOSERVANT_H + +#include "FooS.h" + +class MyFooServant : public POA_Foo +{ +public: + MyFooServant (PortableServer::POA_ptr poa, + CORBA::Long value); + + virtual ~MyFooServant (void); + + virtual PortableServer::POA_ptr _default_POA (CORBA::Environment &env); + + virtual CORBA::Long doit (CORBA::Environment &env); + +protected: + PortableServer::POA_var poa_; + CORBA::Long value_; +}; + +#endif /* MYFOOSERVANT_H */ diff --git a/TAO/tests/POA/Explicit_Activation_POA_Ids/client.cpp b/TAO/tests/POA/Explicit_Activation_POA_Ids/client.cpp new file mode 100644 index 00000000000..e307cae1552 --- /dev/null +++ b/TAO/tests/POA/Explicit_Activation_POA_Ids/client.cpp @@ -0,0 +1,78 @@ +#include "ace/streams.h" +#include "ace/Get_Opt.h" +#include "FooC.h" + +char *ior = 0; + +static int +parse_args (int argc, char **argv) +{ + ACE_Get_Opt get_opts (argc, argv, "k:"); + int c; + + while ((c = get_opts ()) != -1) + switch (c) + { + case 'k': + ior = get_opts.optarg; + break; + case '?': + default: + ACE_ERROR_RETURN ((LM_ERROR, + "usage: %s" + "-k IOR" + "\n", + argv [0]), + -1); + } + + if (ior == 0) + ACE_ERROR_RETURN ((LM_ERROR, + "Please specify the IOR for the servant"), -1); + + // Indicates successful parsing of command line. + return 0; +} + +int +main (int argc, char **argv) +{ + CORBA::Environment env; + + CORBA::ORB_ptr orb = CORBA::ORB_init (argc, argv, 0, env); + if (env.exception () != 0) + { + env.print_exception ("CORBA::ORB_init"); + return -1; + } + + parse_args (argc, argv); + + CORBA::Object_var object = orb->string_to_object (ior, env); + if (env.exception () != 0) + { + env.print_exception ("CORBA::ORB::string_to_object"); + return -1; + } + + Foo_var foo = Foo::_narrow (object.in (), env); + if (env.exception () != 0) + { + env.print_exception ("Foo::_bind"); + return -1; + } + + CORBA::Long result = foo->doit (env); + if (env.exception () != 0) + { + env.print_exception ("Foo::doit"); + return -1; + } + + cout << result << endl; + + CORBA::release (orb); + + return 0; +} + diff --git a/TAO/tests/POA/Explicit_Activation_POA_Ids/client.dsp b/TAO/tests/POA/Explicit_Activation_POA_Ids/client.dsp new file mode 100644 index 00000000000..3a44ace0a59 --- /dev/null +++ b/TAO/tests/POA/Explicit_Activation_POA_Ids/client.dsp @@ -0,0 +1,93 @@ +# Microsoft Developer Studio Project File - Name="client" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=client - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "client.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "client.mak" CFG="client - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "client - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "client - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "client - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "client - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 tao.lib aced.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\tao\\"
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF
+
+# Begin Target
+
+# Name "client - Win32 Release"
+# Name "client - Win32 Debug"
+# Begin Source File
+
+SOURCE=.\client.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\FooC.cpp
+# End Source File
+# End Target
+# End Project
diff --git a/TAO/tests/POA/Explicit_Activation_POA_Ids/server.cpp b/TAO/tests/POA/Explicit_Activation_POA_Ids/server.cpp new file mode 100644 index 00000000000..06d63c27d81 --- /dev/null +++ b/TAO/tests/POA/Explicit_Activation_POA_Ids/server.cpp @@ -0,0 +1,62 @@ +#include "ace/streams.h" +#include "MyFooServant.h" + +int +main (int argc, char **argv) +{ + CORBA::Environment env; + + CORBA::ORB_ptr orb = CORBA::ORB_init (argc, argv, 0, env); + if (env.exception () != 0) + { + env.print_exception ("CORBA::ORB_init"); + return -1; + } + + CORBA::Object_var obj = orb->resolve_initial_references ("RootPOA"); + + PortableServer::POA_var rootPOA = PortableServer::POA::_narrow (obj, env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::_narrow"); + return -1; + } + + MyFooServant afoo (rootPOA, 27); + PortableServer::ObjectId_var oid = rootPOA->activate_object (&afoo, env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::activate_object"); + return -1; + } + + Foo_var foo = afoo._this (env); + if (env.exception () != 0) + { + env.print_exception ("POA_Foo::_this"); + return -1; + } + + CORBA::String_var ior = orb->object_to_string (foo, env); + if (env.exception () != 0) + { + env.print_exception ("CORBA::ORB::object_to_string"); + return -1; + } + + cout << (char *) ior << endl; + + rootPOA->the_POAManager (env)->activate (env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POAManager::activate"); + return -1; + } + + if (orb->run () == -1) + ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "CORBA::ORB::run"), -1); + + CORBA::release (orb); + + return 0; +} diff --git a/TAO/tests/POA/Explicit_Activation_POA_Ids/server.dsp b/TAO/tests/POA/Explicit_Activation_POA_Ids/server.dsp new file mode 100644 index 00000000000..4820a09c0f5 --- /dev/null +++ b/TAO/tests/POA/Explicit_Activation_POA_Ids/server.dsp @@ -0,0 +1,101 @@ +# Microsoft Developer Studio Project File - Name="server" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=server - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "server.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "server.mak" CFG="server - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "server - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "server - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "server - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "server - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 tao.lib aced.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\tao\\"
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF
+
+# Begin Target
+
+# Name "server - Win32 Release"
+# Name "server - Win32 Debug"
+# Begin Source File
+
+SOURCE=.\FooC.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\FooS.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\MyFooServant.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\server.cpp
+# End Source File
+# End Target
+# End Project
diff --git a/TAO/tests/POA/Explicit_Activation_POA_Ids/svc.conf b/TAO/tests/POA/Explicit_Activation_POA_Ids/svc.conf new file mode 100644 index 00000000000..43c6a486c92 --- /dev/null +++ b/TAO/tests/POA/Explicit_Activation_POA_Ids/svc.conf @@ -0,0 +1,49 @@ +# $Id$ +# +# This file contains a sample ACE_Service_Config configuration +# file specifying the strategy factories utilized by an application +# using TAO. There are currently only two possible factories: +# Client_Strategy_Factory and Server_Strategy_Factory. These names +# must be used as the second argument to their corresponding line, +# because that's what the ORB uses to find the desired factory. +# +# Note that there are two unordinary characteristics of the way *this* +# file is set up: +# - both client and server strategies are specified in the same +# file, which would only make sense for co-located clients & servers +# - both of the factories are actually sourced out of libTAO.so +# (TAO.DLL on Win32), and they would normally be in a separate +# dll from the TAO ORB Core. +# +# The options which can be passed to the Resource Factory are: +# +# -ORBresources <which> +# where <which> can be 'global' to specify globally-held resources, +# or 'tss' to specify thread-specific resources. +# +# The options which can be passed to the Client are: +# <none currently> +# +# The options which can be passed to the Server are: +# +# -ORBconcurrency <which> +# where <which> can be 'thread-per-connection' to specify +# use of the ACE_Threaded_Strategy concurrency strategy, +# or 'reactive' to specify use of the ACE_Reactive_Strategy +# concurrency strategy. +# +# -ORBthreadflags <flags> +# specifies the default thread flags to use, where <flags> is a +# logical OR'ing of the flags THR_DETACHED, THR_BOUND, THR_NEW_LWP, +# THR_SUSPENDED, or THR_DAEMON. Note that not every flag may be valid +# on every platform. +# +# -ORBdemuxstrategy <which> +# where <which> can be one of 'dynamic', 'linear', 'active', or 'user', +# and specifies the type of object lookup strategy used internally. +# -ORBtablesize <unsigned> +# specifies the size of the object table +# +dynamic Resource_Factory Service_Object * TAO:_make_TAO_Resource_Factory() "-ORBresources global" +dynamic Client_Strategy_Factory Service_Object * TAO:_make_TAO_Default_Client_Strategy_Factory() +dynamic Server_Strategy_Factory Service_Object * TAO:_make_TAO_Default_Server_Strategy_Factory() "-ORBconcurrency reactive -ORBdemuxstrategy dynamic -ORBtablesize 128" diff --git a/TAO/tests/POA/RootPOA/RootPOA.cpp b/TAO/tests/POA/RootPOA/RootPOA.cpp index 4ef3ab1ef00..e58951acdce 100644 --- a/TAO/tests/POA/RootPOA/RootPOA.cpp +++ b/TAO/tests/POA/RootPOA/RootPOA.cpp @@ -13,9 +13,9 @@ main (int argc, char **argv) return -1; } - CORBA::Object_ptr obj = orb->resolve_initial_references ("RootPOA"); + CORBA::Object_var obj = orb->resolve_initial_references ("RootPOA"); - PortableServer::POA_ptr rootPOA = PortableServer::POA::_narrow (obj, env); + PortableServer::POA_var rootPOA = PortableServer::POA::_narrow (obj, env); if (env.exception () != 0) { env.print_exception ("PortableServer::POA::_narrow"); @@ -29,6 +29,10 @@ main (int argc, char **argv) return -1; } - cout << poa_name << endl; + char *name = poa_name; + cout << name << endl; + + CORBA::release (orb); + return 0; } |