diff options
Diffstat (limited to 'TAO')
74 files changed, 3356 insertions, 3212 deletions
diff --git a/TAO/ChangeLog-99c b/TAO/ChangeLog-99c index 411513246e8..68f1e0d3247 100644 --- a/TAO/ChangeLog-99c +++ b/TAO/ChangeLog-99c @@ -1,10 +1,99 @@ +Wed Mar 17 22:53:33 1999 Irfan Pyarali <irfan@cs.wustl.edu> + + * tao/POA.cpp: Phase one of the new POA design is complete. + + - We now have support for active demuxing of user defined + ids. This is achieved by using a active demux hint field in + the object key. + + - We have support for reactivating servants with system + generated ids. In this case, system ids are simply generated + by incrementing a counter. Note that in this case, the id -> + servant map is a hash map since active demux keys cannot be + reused once deactivated. However, the good news is that the + active demux key can be used as the hint in the object key. + + - The use of the hint in the object key is optional. If used, + the lookups are faster (unless the hint is invalidated by a + deactivation or by restarting a persistent POA). However, + using the hint results in a larger IOR, and more memory being + used in the active object map. This option can be controlled + through the -ORBactivehintinids runtime switch and is turned + on by default. + + - If the applications knows that reactivations will not occur, + they can simply use the old scheme of directly using the + active demux key as the system id. This will (a) make the IOR + shorter, (b) less memory will be used in the active object + map, and (c) the lookups will be quicker and (more) + predictable. + + - Etherialization of servants (through the use of a Servant + Activator) is temporarily disabled. Once we fix the reference + counting on the servants, this will start working again. + + - Removed the POA exceptions from the list of system exceptions, + and reverted them back to being user exceptions. + + - Timestamps are no longer used in persistent object keys. + + - Removed the TAO specific synchronization POA policy. In the + new POA design, this scheme will not be required. Also, + removed the POA locking example in + $TAO_ROOT/examples/POA/locking. + + * tao: Added support for minimalCORBA to TAO. For some + applications CORBA is too large to meet exacting size and + performance requirements. Such scenarios require a cut-down + version of CORBA. This cut-down version is called + minimumCORBA. minimumCORBA defines a profile (or subset) of + CORBA where the following features are removed: + + - Dynamic Invocation Interface + - Dynamic Skeleton Interface + - Dynamic Any + - Interface Repository + - Interceptors + - Advance POA features: + - Servant Managers + - Adpator Activators + - Most POA Manager features + + On platforms that use the Makefiles, simply minimum_corba=1. On + Win32, define TAO_HAS_MINIMUM_CORBA in the orbconf.h file. + + * tao/Makefile: Added support for measuring subsets of TAO. These + subsets are not independent, but are useful in providing an idea + of how big different components of the ORB are. + + * tao/Server_Strategy_Factory.cpp: Remove the active object map + creation responsibilities from this class. Now it simply holds + on to the creation parameters and feeds them to the active + object map constructor. + + * tao/Sequence_T.i (operator->): Added operator-> to + TAO_Object_Manager. Also, made the in() method return a + non-const pointer. Missing still is operator= taking + T::var_type. Other managers should also be check for these + features (Carlos said he'll look into it). + + * examples/POA/Loader/run_test.pl: + * examples/POA/On_Demand_Loading/run_test.pl: + * examples/POA/On_Demand_Activation/run_test.pl: + + Fixed the above scripts to pass the extra parameters along to + the client and the server. + + * examples/POA/DSI/server.cpp: Added missing #include + "ace/Get_Opt.h" + Wed Mar 17 19:36:31 1999 Vishal Kachroo <vishal@merengue.cs.wustl.edu> - Fixed compilation errors for VxWorks and CHORUS. Used the constructor - of ACE_ULongLong (UINT32, UINT32) for VxWorks which doesnt have an - unsigned long long. - * orbsvcs/orbsvcs/Time/Timer_Helper.cpp (handle_timeout) - * orbsvcs/orbsvcs/Time/TAO_UTO.cpp (TAO_UTO). + Fixed compilation errors for VxWorks and CHORUS. Used the + constructor of ACE_ULongLong (UINT32, UINT32) for VxWorks which + doesnt have an unsigned long long. * + orbsvcs/orbsvcs/Time/Timer_Helper.cpp (handle_timeout) * + orbsvcs/orbsvcs/Time/TAO_UTO.cpp (TAO_UTO). Wed Mar 17 19:00:14 1999 Nanbor Wang <nanbor@cs.wustl.edu> diff --git a/TAO/docs/Options.html b/TAO/docs/Options.html index 4db3ac62af9..b4f6d86194d 100644 --- a/TAO/docs/Options.html +++ b/TAO/docs/Options.html @@ -248,7 +248,7 @@ copied instead of appended to the CDR stream.</TD></TR> <H3><CODE>TAO_Default_Server_Strategy_Factory</CODE><A NAME="DefaultServer"></A></H3> -<p><em>Note:</em> <code>-ORBdemuxstrategy</code> flag has been changed to <code>-ORBsystemidpolicydemuxstrategy</code>. +<p><em>Note:</em> <code>-ORBdemuxstrategy</code> flag has been changed to <code>-ORBsystemidpolicydemuxstrategy</code> and <code>-ORBuseridpolicydemuxstrategy</code>. <blockquote> <P><TABLE BORDER="2" CELLSPACING="2" CELLPADDING="0" > @@ -288,6 +288,26 @@ policy. The <EM>reverse demultiplexing strategy</EM> can be one of <CODE>dynamic</CODE> or <CODE>user</CODE>. This option defaults to use the <CODE>dynamic</CODE> strategy. </TD></TR> <TR> +<TD><CODE>-ORBallowreactivationofsystemids</CODE> <EM>allows +reactivation of system ids</EM></TD> <TD>Specify whether system ids +can be reactivated, i.e., once an id that was generated by the system +has be deactivated, will the user reactivate a new servant using the +old id. If the user is not going to use this feature, the IORs can be +shortened, an extra comparison in the critical upcall path removed, +and some memory on the server side can be saved. The +<CODE>ORBallowreactivationofsystemids</CODE> can be <CODE>0</CODE> or +<CODE>1</CODE>. This option defaults to <CODE>1</CODE>. </TD></TR> +<TR> + +<TD><CODE>-ORBactivehintinids</CODE> <EM>adds an active hint in +ids</EM></TD> <TD>Specify whether an active hint should be added to +ids. With active hints, ids can be found quickly. However, they lead +to larger IORs. Note that this option is disregarded +<CODE>-ORBallowreactivationofsystemids</CODE> is set to +<CODE>0</CODE>. The <EM>-ORBactivehintinids</EM> can be <CODE>0</CODE> +or <CODE>1</CODE>. This option defaults to <CODE>1</CODE>. </TD></TR> +<TR> + <TD><CODE>-ORBthreadflags</CODE> <EM>thread flags</EM></TD> <TD>Specify the flags used for thread creation. Flags can be any logical-OR combination of <CODE>THR_DETACHED</CODE>, diff --git a/TAO/examples/POA/DSI/server.cpp b/TAO/examples/POA/DSI/server.cpp index 21271bc9e9e..576304e1a1b 100644 --- a/TAO/examples/POA/DSI/server.cpp +++ b/TAO/examples/POA/DSI/server.cpp @@ -16,9 +16,10 @@ //==================================================================== #include "Database_i.h" +#include "ace/Get_Opt.h" ACE_RCSID(DSI, server, "$Id$") - + static char *ior_output_file = 0; static int @@ -55,31 +56,31 @@ write_iors_to_file (const char *first_ior) return 0; FILE *output_file = ACE_OS::fopen (ior_output_file, "w"); - + if (output_file == 0) - ACE_ERROR_RETURN ((LM_ERROR, "Cannot open output files for writing IOR: %s\n", - ior_output_file), + ACE_ERROR_RETURN ((LM_ERROR, "Cannot open output files for writing IOR: %s\n", + ior_output_file), -1); - + int result = 0; result = ACE_OS::fprintf (output_file, - "%s", + "%s", first_ior); - if (result < 0 || + if (result < 0 || ACE_static_cast (size_t, result) != ACE_OS::strlen (first_ior)) - ACE_ERROR_RETURN ((LM_ERROR, - "ACE_OS::fprintf failed while writing %s to %s\n", + ACE_ERROR_RETURN ((LM_ERROR, + "ACE_OS::fprintf failed while writing %s to %s\n", first_ior, ior_output_file), -1); - + ACE_OS::fclose (output_file); return 0; } -int +int main (int argc, char **argv) { CORBA::Environment env; @@ -106,16 +107,16 @@ main (int argc, char **argv) env.print_exception ("PortableServer::POA::_narrow"); return -1; } - + PortableServer::POAManager_var poa_manager = root_poa->the_POAManager (env); if (env.exception () != 0) { env.print_exception ("PortableServer::POA::the_POAManager"); return -1; } - + CORBA::PolicyList policies (5); - policies.length (5); + policies.length (5); // ID Assignment Policy policies[0] = @@ -134,7 +135,7 @@ main (int argc, char **argv) env.print_exception ("PortableServer::POA::create_lifespan_policy"); return -1; } - + // Request Processing Policy policies[2] = root_poa->create_request_processing_policy (PortableServer::USE_DEFAULT_SERVANT, env); @@ -143,7 +144,7 @@ main (int argc, char **argv) env.print_exception ("PortableServer::POA::create_request_processing_policy"); return -1; } - + // Servant Retention Policy policies[3] = root_poa->create_servant_retention_policy (PortableServer::RETAIN, env); @@ -166,7 +167,7 @@ main (int argc, char **argv) PortableServer::POA_var first_poa = root_poa->create_POA (name.c_str (), poa_manager.in (), policies, - env); + env); if (env.exception () != 0) { env.print_exception ("PortableServer::POA::create_POA"); @@ -179,7 +180,7 @@ main (int argc, char **argv) { CORBA::Policy_ptr policy = policies[i]; policy->destroy (env); - } + } if (env.exception () != 0) { env.print_exception ("PortableServer::POA::create_POA"); @@ -193,15 +194,15 @@ main (int argc, char **argv) PortableServer::ObjectId_var database_agent_oid = PortableServer::string_to_ObjectId ("DatabaseAgent"); - first_poa->activate_object_with_id (database_agent_oid.in (), - &database_agent_impl, + first_poa->activate_object_with_id (database_agent_oid.in (), + &database_agent_impl, env); if (env.exception () != 0) { env.print_exception ("PortableServer::POA::activate_object_with_id"); return -1; } - + CORBA::Object_var database_agent = first_poa->id_to_reference (database_agent_oid.in (), env); if (env.exception () != 0) @@ -220,7 +221,7 @@ main (int argc, char **argv) ACE_DEBUG ((LM_DEBUG,"%s\n", database_agent_ior.in ())); - + int write_result = write_iors_to_file (database_agent_ior.in ()); if (write_result != 0) return write_result; @@ -238,8 +239,8 @@ main (int argc, char **argv) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "CORBA::ORB::run"), -1); // Destroy the rootPOA and its children - root_poa->destroy (1, - 1, + root_poa->destroy (1, + 1, env); if (env.exception () != 0) { @@ -249,5 +250,3 @@ main (int argc, char **argv) return 0; } - - diff --git a/TAO/examples/POA/Default_Servant/test b/TAO/examples/POA/Default_Servant/test deleted file mode 100644 index 09ab97bfb35..00000000000 --- a/TAO/examples/POA/Default_Servant/test +++ /dev/null @@ -1 +0,0 @@ -POA rules!!
\ No newline at end of file diff --git a/TAO/examples/POA/Loader/run_test.pl b/TAO/examples/POA/Loader/run_test.pl index 025f876b3fe..b9b054c9fa4 100755 --- a/TAO/examples/POA/Loader/run_test.pl +++ b/TAO/examples/POA/Loader/run_test.pl @@ -12,6 +12,8 @@ $iorfile = "ior"; $oneway = ""; $iterations = 100; +$extra_args = ""; + # Parse the arguments for ($i = 0; $i <= $#ARGV; $i++) { @@ -44,7 +46,7 @@ for ($i = 0; $i <= $#ARGV; $i++) $i++; last SWITCH; } - print "run_test: Unknown Option: ".$ARGV[$i]."\n"; + $extra_args .= " " . $ARGV[$i]; } } @@ -54,13 +56,13 @@ $iorfile_2 = $iorfile."_2"; unlink $iorfile_1; unlink $iorfile_2; -$SV = Process::Create ($EXEPREFIX."server$Process::EXE_EXT", "-f $iorfile"); +$SV = Process::Create ($EXEPREFIX."server$Process::EXE_EXT", "-f $iorfile $extra_args"); ACE::waitforfile ($iorfile_1); ACE::waitforfile ($iorfile_2); -$status = system ("../Generic_Servant/client$Process::EXE_EXT $oneway -i $iterations -f $iorfile_1"); -$status = system ("../Generic_Servant/client$Process::EXE_EXT $oneway -i $iterations -f $iorfile_2 -x"); +$status = system ("../Generic_Servant/client$Process::EXE_EXT $extra_args $oneway -i $iterations -f $iorfile_1"); +$status = system ("../Generic_Servant/client$Process::EXE_EXT $extra_args $oneway -i $iterations -f $iorfile_2 -x"); unlink $iorfile_1; unlink $iorfile_2; diff --git a/TAO/examples/POA/On_Demand_Activation/run_test.pl b/TAO/examples/POA/On_Demand_Activation/run_test.pl index 075fbce9d81..4c94fe6590d 100755 --- a/TAO/examples/POA/On_Demand_Activation/run_test.pl +++ b/TAO/examples/POA/On_Demand_Activation/run_test.pl @@ -12,6 +12,8 @@ $iorfile = "ior"; $oneway = ""; $iterations = 100; +$extra_args = ""; + # Parse the arguments for ($i = 0; $i <= $#ARGV; $i++) { @@ -44,7 +46,7 @@ for ($i = 0; $i <= $#ARGV; $i++) $i++; last SWITCH; } - print "run_test: Unknown Option: ".$ARGV[$i]."\n"; + $extra_args .= " " . $ARGV[$i]; } } @@ -54,13 +56,13 @@ $iorfile_2 = $iorfile."_2"; unlink $iorfile_1; unlink $iorfile_2; -$SV = Process::Create ($EXEPREFIX."server$Process::EXE_EXT", "-f $iorfile"); +$SV = Process::Create ($EXEPREFIX."server$Process::EXE_EXT", "-f $iorfile $extra_args"); ACE::waitforfile ($iorfile_1); ACE::waitforfile ($iorfile_2); -$status = system ("../Generic_Servant/client$Process::EXE_EXT $oneway -i $iterations -f $iorfile_1"); -$status = system ("../Generic_Servant/client$Process::EXE_EXT $oneway -i $iterations -f $iorfile_2 -x"); +$status = system ("../Generic_Servant/client$Process::EXE_EXT $extra_args $oneway -i $iterations -f $iorfile_1"); +$status = system ("../Generic_Servant/client$Process::EXE_EXT $extra_args $oneway -i $iterations -f $iorfile_2 -x"); unlink $iorfile_1; unlink $iorfile_2; diff --git a/TAO/examples/POA/On_Demand_Loading/run_test.pl b/TAO/examples/POA/On_Demand_Loading/run_test.pl index 7ecf9218f71..c902f9e081a 100755 --- a/TAO/examples/POA/On_Demand_Loading/run_test.pl +++ b/TAO/examples/POA/On_Demand_Loading/run_test.pl @@ -13,6 +13,8 @@ $iorfile = "ior"; $oneway = ""; $iterations = 100; +$extra_args = ""; + # Parse the arguments for ($i = 0; $i <= $#ARGV; $i++) { @@ -45,7 +47,7 @@ for ($i = 0; $i <= $#ARGV; $i++) $i++; last SWITCH; } - print "run_test: Unknown Option: ".$ARGV[$i]."\n"; + $extra_args .= " " . $ARGV[$i]; } } @@ -55,13 +57,13 @@ $iorfile_2 = $iorfile."_2"; unlink $iorfile_1; unlink $iorfile_2; -$SV = Process::Create ($EXEPREFIX."server$Process::EXE_EXT", "-f $iorfile"); +$SV = Process::Create ($EXEPREFIX."server$Process::EXE_EXT", "-f $iorfile $extra_args"); ACE::waitforfile ($iorfile_1); ACE::waitforfile ($iorfile_2); -$status = system ("../Generic_Servant/client$Process::EXE_EXT $oneway -i $iterations -f $iorfile_1"); -$status = system ("../Generic_Servant/client$Process::EXE_EXT $oneway -i $iterations -f $iorfile_2 -x"); +$status = system ("../Generic_Servant/client$Process::EXE_EXT $extra_args $oneway -i $iterations -f $iorfile_1"); +$status = system ("../Generic_Servant/client$Process::EXE_EXT $extra_args $oneway -i $iterations -f $iorfile_2 -x"); unlink $iorfile_1; unlink $iorfile_2; diff --git a/TAO/examples/TAO_Examples.dsw b/TAO/examples/TAO_Examples.dsw index 129e0f02ff7..c97872ca9ae 100644 --- a/TAO/examples/TAO_Examples.dsw +++ b/TAO/examples/TAO_Examples.dsw @@ -144,18 +144,6 @@ Package=<4> ###############################################################################
-Project: "POA Locking"=.\POA\locking\locking.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
Project: "POA NewPOA"=.\POA\NewPOA\NewPOA.dsp - Package Owner=<4>
Package=<5>
diff --git a/TAO/tao/Active_Object_Map.cpp b/TAO/tao/Active_Object_Map.cpp index b4a51617543..cc51eaac8ac 100644 --- a/TAO/tao/Active_Object_Map.cpp +++ b/TAO/tao/Active_Object_Map.cpp @@ -1,342 +1,1230 @@ // $Id$ -#include "ace/Auto_Ptr.h" #include "tao/Active_Object_Map.h" -#include "tao/ORB_Core.h" -#include "tao/POA.h" -#include "tao/Server_Strategy_Factory.h" - -ACE_RCSID(tao, Active_Object_Map, "$Id$") +#include "tao/params.h" #if !defined (__ACE_INLINE__) # include "tao/Active_Object_Map.i" -#endif /* ! __ACE_INLINE__ */ +#endif /* __ACE_INLINE__ */ + +//////////////////////////////////////////////////////////////////////////////// + +TAO_Incremental_Key_Generator::TAO_Incremental_Key_Generator (void) + : counter_ (0) +{ +} + +int +TAO_Incremental_Key_Generator::operator() (PortableServer::ObjectId &id) +{ + // Resize to accommodate the counter. + id.length (sizeof this->counter_); + + // Add new key data. + ACE_OS::memcpy (id.get_buffer (), + &++this->counter_, + sizeof this->counter_); -u_long + // Success. + return 0; +} + +//////////////////////////////////////////////////////////////////////////////// + +u_long TAO_ObjectId_Hash::operator () (const PortableServer::ObjectId &id) const { return ACE::hash_pjw ((const char *) id.get_buffer (), id.length ()); } -TAO_Active_Object_Map::TAO_Active_Object_Map (int user_id_policy, - int unique_id_policy) - : unique_id_policy_ (unique_id_policy) +//////////////////////////////////////////////////////////////////////////////// + +int +TAO_Ignore_Original_Key_Adapter::encode (const PortableServer::ObjectId &original_key, + const ACE_Active_Map_Manager_Key &active_key, + PortableServer::ObjectId &modified_key) +{ + // Size of active key. + size_t active_key_size = active_key.size (); + + // Resize to accommodate both the original data and the new active key. + modified_key.length (active_key_size); + + // Copy active key data into user key. + active_key.encode (modified_key.get_buffer ()); + + // Success. + return 0; +} + +int +TAO_Ignore_Original_Key_Adapter::decode (const PortableServer::ObjectId &modified_key, + ACE_Active_Map_Manager_Key &active_key) +{ + // Read off value of index and generation. + active_key.decode (modified_key.get_buffer ()); + + // Success. + return 0; +} + +int +TAO_Ignore_Original_Key_Adapter::decode (const PortableServer::ObjectId &modified_key, + PortableServer::ObjectId &original_key) +{ + // Smartly copy all the data; <original_key does not own the data>. + original_key.replace (modified_key.maximum (), + modified_key.length (), + ACE_const_cast (CORBA::Octet *, + modified_key.get_buffer ()), + 0); + + // Success. + return 0; +} + +//////////////////////////////////////////////////////////////////////////////// + +int +TAO_Preserve_Original_Key_Adapter::encode (const PortableServer::ObjectId &original_key, + const ACE_Active_Map_Manager_Key &active_key, + PortableServer::ObjectId &modified_key) +{ + // Size of active key. + size_t active_key_size = active_key.size (); + + // Resize to accommodate both the original data and the new active key. + modified_key.length (active_key_size + original_key.length ()); + + // Copy active key data into user key. + active_key.encode (modified_key.get_buffer ()); + + // Copy the original key after the active key. + ACE_OS::memcpy (modified_key.get_buffer () + active_key_size, + original_key.get_buffer (), + original_key.length ()); + + // Success. + return 0; +} + +int +TAO_Preserve_Original_Key_Adapter::decode (const PortableServer::ObjectId &modified_key, + ACE_Active_Map_Manager_Key &active_key) { - this->impl_ = - TAO_ORB_Core_instance ()->server_factory ()->create_active_object_map (user_id_policy); - this->reverse_impl_ = - TAO_ORB_Core_instance ()->server_factory ()->create_reverse_active_object_map (unique_id_policy); + // Read off value of index and generation. + active_key.decode (modified_key.get_buffer ()); + + // Success. + return 0; } int -TAO_Active_Object_Map_Impl::find (const PortableServer::Servant servant, - PortableServer::ObjectId &id) +TAO_Preserve_Original_Key_Adapter::decode (const PortableServer::ObjectId &modified_key, + PortableServer::ObjectId &original_key) +{ + // Size of active key. + size_t active_key_size = ACE_Active_Map_Manager_Key::size (); + + // Smartly copy all the data; <original_key does not own the data>. + original_key.replace (modified_key.maximum () - active_key_size, + modified_key.length () - active_key_size, + ACE_const_cast (CORBA::Octet *, + modified_key.get_buffer ()) + active_key_size, + 0); + + // Success. + return 0; +} + +//////////////////////////////////////////////////////////////////////////////// + +TAO_Active_Object_Map::TAO_Active_Object_Map (int user_id_policy, + int unique_id_policy, + int persistent_id_policy, + const TAO_Server_Strategy_Factory::Active_Object_Map_Creation_Parameters &creation_parameters) + : id_uniqueness_strategy_ (0), + lifespan_strategy_ (0), + id_assignment_strategy_ (0), + id_hint_strategy_ (0), + user_id_map_ (0), + servant_map_ (0) { - auto_ptr<TAO_Active_Object_Map_Iterator_Impl> end (this->end ()); + if (unique_id_policy) + { + ACE_NEW (this->id_uniqueness_strategy_, + TAO_Unique_Id_Strategy); + } + else + { + ACE_NEW (this->id_uniqueness_strategy_, + TAO_Multiple_Id_Strategy); + } - for (auto_ptr<TAO_Active_Object_Map_Iterator_Impl> i (this->begin ()); - !i->done (end.get ()); - i->advance ()) + if (persistent_id_policy) + { + ACE_NEW (this->lifespan_strategy_, + TAO_Persistent_Strategy); + } + else { - const TAO_Active_Object_Map_Entry &item = i->item (); + ACE_NEW (this->lifespan_strategy_, + TAO_Transient_Strategy); + } - if (!this->is_free (item)) + if (user_id_policy) + { + ACE_NEW (this->id_assignment_strategy_, + TAO_User_Id_Strategy); + } + else + { + if (unique_id_policy) { - if (item.servant_ == servant) - { - // Store the match.... - id = item.id_; - return 0; - } + ACE_NEW (this->id_assignment_strategy_, + TAO_System_Id_With_Unique_Id_Strategy); + } + else + { + ACE_NEW (this->id_assignment_strategy_, + TAO_System_Id_With_Multiple_Id_Strategy); } } - - return -1; + + if ((user_id_policy || + creation_parameters.allow_reactivation_of_system_ids_) && + creation_parameters.use_active_hint_in_ids_) + { + ACE_NEW (this->id_hint_strategy_, + TAO_Active_Hint_Strategy); + } + else + { + ACE_NEW (this->id_hint_strategy_, + TAO_No_Hint_Strategy); + } + + if (unique_id_policy) + { + switch (creation_parameters.reverse_object_lookup_strategy_for_unique_id_policy_) + { + case TAO_LINEAR: + ACE_NEW (this->servant_map_, + servant_linear_map (creation_parameters.active_object_map_size_)); + break; + case TAO_DYNAMIC_HASH: + default: + ACE_NEW (this->servant_map_, + servant_hash_map (creation_parameters.active_object_map_size_)); + break; + } + } + + if (user_id_policy || + creation_parameters.allow_reactivation_of_system_ids_) + { + switch (creation_parameters.object_lookup_strategy_for_user_id_policy_) + { + case TAO_LINEAR: + + ACE_NEW (this->user_id_map_, + user_id_linear_map (creation_parameters.active_object_map_size_)); + + this->system_id_size_ = sizeof (CORBA::ULong); + + break; + + case TAO_DYNAMIC_HASH: + default: + + ACE_NEW (this->user_id_map_, + user_id_hash_map (creation_parameters.active_object_map_size_)); + + this->system_id_size_ = sizeof (CORBA::ULong); + + break; + } + } + else + { + switch (creation_parameters.object_lookup_strategy_for_system_id_policy_) + { + case TAO_LINEAR: + + ACE_NEW (this->user_id_map_, + user_id_linear_map (creation_parameters.active_object_map_size_)); + + this->system_id_size_ = sizeof (CORBA::ULong); + + break; + + case TAO_DYNAMIC_HASH: + + ACE_NEW (this->user_id_map_, + user_id_hash_map (creation_parameters.active_object_map_size_)); + + this->system_id_size_ = sizeof (CORBA::ULong); + + break; + + case TAO_ACTIVE_DEMUX: + default: + + ACE_NEW (this->user_id_map_, + user_id_active_map (creation_parameters.active_object_map_size_)); + + this->system_id_size_ = ACE_Active_Map_Manager_Key::size (); + + break; + } + } + + this->id_uniqueness_strategy_->set_active_object_map (this); + this->lifespan_strategy_->set_active_object_map (this); + this->id_assignment_strategy_->set_active_object_map (this); + + this->system_id_size_ += this->id_hint_strategy_->hint_size (); +} + +TAO_Active_Object_Map::~TAO_Active_Object_Map (void) +{ + delete this->id_uniqueness_strategy_; + delete this->lifespan_strategy_; + delete this->id_assignment_strategy_; + delete this->id_hint_strategy_; + delete this->servant_map_; + delete this->user_id_map_; +} + +int +TAO_Active_Object_Map::is_servant_in_map (PortableServer::Servant servant) +{ + return this->id_uniqueness_strategy_->is_servant_in_map (servant); +} + +int +TAO_Active_Object_Map::is_user_id_in_map (const PortableServer::ObjectId &user_id) +{ + Map_Entry *entry = 0; + int result = this->user_id_map_->find (user_id, + entry); + if (result == 0) + { + if (entry->servant_ == 0) + { + result = 0; + } + else + { + result = 1; + } + } + else + { + result = 0; + } + + return result; +} + +int +TAO_Active_Object_Map::bind_using_system_id_returning_system_id (PortableServer::Servant servant, + PortableServer::ObjectId_out system_id) +{ + Map_Entry *entry = 0; + + int result = this->id_assignment_strategy_->bind_using_system_id (servant, + entry); + + if (result == 0) + { + result = this->id_hint_strategy_->system_id (system_id, + *entry); + } + + return result; +} + +int +TAO_Active_Object_Map::bind_using_system_id_returning_user_id (PortableServer::Servant servant, + PortableServer::ObjectId_out user_id) +{ + Map_Entry *entry = 0; + + int result = this->id_assignment_strategy_->bind_using_system_id (servant, + entry); + + if (result == 0) + { + ACE_NEW_RETURN (user_id, + PortableServer::ObjectId (entry->user_id_), + -1); + } + + return result; } -PortableServer::ObjectId * -TAO_Dynamic_Hash_Active_Object_Map::create_object_id (PortableServer::Servant, - CORBA::Environment &) +int +TAO_Active_Object_Map::bind_using_user_id (PortableServer::Servant servant, + const PortableServer::ObjectId &user_id) +{ + Map_Entry *entry = 0; + return this->id_uniqueness_strategy_->bind_using_user_id (servant, + user_id, + entry); +} + +int +TAO_Active_Object_Map::find_system_id_using_user_id (const PortableServer::ObjectId &user_id, + PortableServer::ObjectId_out system_id) +{ + Map_Entry *entry = 0; + int result = this->id_uniqueness_strategy_->bind_using_user_id (0, + user_id, + entry); + if (result == 0) + { + result = this->id_hint_strategy_->system_id (system_id, + *entry); + } + + return result; +} + +int +TAO_Active_Object_Map::rebind_using_user_id_and_system_id (PortableServer::Servant servant, + const PortableServer::ObjectId &user_id, + const PortableServer::ObjectId &system_id) { - // This method assumes that locks are held when it is called - PortableServer::ObjectId *id; - CORBA::ULong size = sizeof (CORBA::ULong); - ACE_NEW_RETURN (id, - PortableServer::ObjectId (size), - 0); + ACE_UNUSED_ARG (system_id); - id->length (size); + Map_Entry *entry = 0; + return this->id_uniqueness_strategy_->bind_using_user_id (servant, + user_id, + entry); +} - ACE_OS::memcpy (id->get_buffer (), - &this->counter_, - size); +int +TAO_Active_Object_Map::unbind_using_user_id (const PortableServer::ObjectId &user_id) +{ + return this->id_uniqueness_strategy_->unbind_using_user_id (user_id); +} - this->counter_++; +int +TAO_Active_Object_Map::find_user_id_using_servant (PortableServer::Servant servant, + PortableServer::ObjectId_out user_id) +{ + return this->id_uniqueness_strategy_->find_user_id_using_servant (servant, + user_id); +} - return id; +int +TAO_Active_Object_Map::find_system_id_using_servant (PortableServer::Servant servant, + PortableServer::ObjectId_out system_id) +{ + return this->id_uniqueness_strategy_->find_system_id_using_servant (servant, + system_id); } int -TAO_Linear_Active_Object_Map::bind (const PortableServer::ObjectId &id, - PortableServer::Servant servant) +TAO_Active_Object_Map::find_servant_using_user_id (const PortableServer::ObjectId &user_id, + PortableServer::Servant &servant) { - // Check existing entries - for (TAO_Active_Object_Map_Entry *i = this->map_; - i != this->map_ + this->next_; - ++i) + Map_Entry *entry = 0; + int result = this->user_id_map_->find (user_id, + entry); + if (result == 0) { - if (i->is_free_) + if (entry->servant_ == 0) { - i->id_ = id; - i->servant_ = servant; - i->is_free_ = 0; - return 0; + result = -1; + } + else + { + servant = entry->servant_; } } - // Resize - if (this->next_ == this->mapsize_) + return result; +} + +int +TAO_Active_Object_Map::find_servant_using_system_id (const PortableServer::ObjectId &system_id, + PortableServer::Servant &servant) +{ + return this->lifespan_strategy_->find_servant_using_system_id (system_id, + servant); +} + +int +TAO_Active_Object_Map::find_servant_and_system_id_using_user_id (const PortableServer::ObjectId &user_id, + PortableServer::Servant &servant, + PortableServer::ObjectId_out system_id) +{ + Map_Entry *entry = 0; + int result = this->user_id_map_->find (user_id, + entry); + + if (result == 0) { - int result = this->resize (); - if (result != 0) - return result; + if (entry->servant_ == 0) + { + result = -1; + } + else + { + servant = entry->servant_; + result = this->id_hint_strategy_->system_id (system_id, + *entry); + } } - // Put the entry at the end of the new section - this->map_[this->next_].id_ = id; - this->map_[this->next_].servant_ = servant; - this->map_[this->next_].is_free_ = 0; + return result; +} - // Increment next - this->next_++; +int +TAO_Active_Object_Map::find_user_id_using_system_id (const PortableServer::ObjectId &system_id, + PortableServer::ObjectId_out user_id) +{ + PortableServer::ObjectId id; + int result = this->id_hint_strategy_->recover_key (system_id, + id); + + if (result == 0) + { + ACE_NEW_RETURN (user_id, + PortableServer::ObjectId (id), + -1); + } return 0; } +size_t +TAO_Active_Object_Map::system_id_size (void) +{ + return this->system_id_size_; +} + +//////////////////////////////////////////////////////////////////////////////// + +TAO_Id_Uniqueness_Strategy::~TAO_Id_Uniqueness_Strategy (void) +{ +} + +void +TAO_Id_Uniqueness_Strategy::set_active_object_map (TAO_Active_Object_Map *active_object_map) +{ + this->active_object_map_ = active_object_map; +} + +//////////////////////////////////////////////////////////////////////////////// + +int +TAO_Unique_Id_Strategy::is_servant_in_map (PortableServer::Servant servant) +{ + int result = this->active_object_map_->servant_map_->find (servant); + if (result == 0) + { + return 1; + } + else + { + return 0; + } +} + int -TAO_Linear_Active_Object_Map::find (const PortableServer::ObjectId &id, - PortableServer::Servant &servant) +TAO_Unique_Id_Strategy::bind_using_user_id (PortableServer::Servant servant, + const PortableServer::ObjectId &user_id, + TAO_Active_Object_Map::Map_Entry *&entry) { - for (TAO_Active_Object_Map_Entry *i = this->map_; - i != this->map_ + this->next_; - ++i) - if (i->is_free_) - continue; - else if (i->id_ == id) - { - servant = i->servant_; - return 0; - } + int result = this->active_object_map_->user_id_map_->find (user_id, + entry); - return -1; + if (result == 0) + { + if (servant != 0) + { + entry->servant_ = servant; + + result = this->active_object_map_->servant_map_->bind (entry->servant_, + entry); + } + } + else + { + ACE_NEW_RETURN (entry, + TAO_Active_Object_Map::Map_Entry, + -1); + + entry->user_id_ = user_id; + entry->servant_ = servant; + + result = this->active_object_map_->id_hint_strategy_->bind (*entry); + + if (result == 0) + { + result = this->active_object_map_->user_id_map_->bind (entry->user_id_, + entry); + + if (result == 0) + { + if (servant != 0) + { + result = this->active_object_map_->servant_map_->bind (entry->servant_, + entry); + } + + if (result != 0) + { + this->active_object_map_->user_id_map_->unbind (entry->user_id_); + this->active_object_map_->id_hint_strategy_->unbind (*entry); + delete entry; + } + } + else + { + this->active_object_map_->id_hint_strategy_->unbind (*entry); + delete entry; + } + } + else + { + delete entry; + } + } + + return result; +} + +int +TAO_Unique_Id_Strategy::unbind_using_user_id (const PortableServer::ObjectId &user_id) +{ + TAO_Active_Object_Map::Map_Entry *entry = 0; + int result = this->active_object_map_->user_id_map_->unbind (user_id, + entry); + + if (result == 0) + { + result = this->active_object_map_->servant_map_->unbind (entry->servant_); + + if (result == 0) + { + result = this->active_object_map_->id_hint_strategy_->unbind (*entry); + } + + if (result == 0) + { + delete entry; + } + } + + return result; +} + +int +TAO_Unique_Id_Strategy::find_user_id_using_servant (PortableServer::Servant servant, + PortableServer::ObjectId_out user_id) +{ + TAO_Active_Object_Map::Map_Entry *entry = 0; + int result = this->active_object_map_->servant_map_->find (servant, + entry); + + if (result == 0) + { + ACE_NEW_RETURN (user_id, + PortableServer::ObjectId (entry->user_id_), + -1); + } + + return result; } int -TAO_Linear_Active_Object_Map::unbind (const PortableServer::ObjectId &id, - PortableServer::Servant &servant) +TAO_Unique_Id_Strategy::find_system_id_using_servant (PortableServer::Servant servant, + PortableServer::ObjectId_out system_id) { - for (TAO_Active_Object_Map_Entry *i = this->map_; - i != this->map_ + this->next_; - ++i) - if (i->is_free_) - continue; - else if (i->id_ == id) - { - servant = i->servant_; - i->is_free_ = 1; - return 0; - } + TAO_Active_Object_Map::Map_Entry *entry = 0; + int result = this->active_object_map_->servant_map_->find (servant, + entry); + + if (result == 0) + { + result = this->active_object_map_->id_hint_strategy_->system_id (system_id, + *entry); + } + + return result; +} + +//////////////////////////////////////////////////////////////////////////////// +int +TAO_Multiple_Id_Strategy::is_servant_in_map (PortableServer::Servant servant) +{ return -1; } int -TAO_Linear_Active_Object_Map::resize (void) +TAO_Multiple_Id_Strategy::bind_using_user_id (PortableServer::Servant servant, + const PortableServer::ObjectId &user_id, + TAO_Active_Object_Map::Map_Entry *&entry) { - if (this->mapsize_ < TAO_Linear_Active_Object_Map::MAX_EXPONENTIAL) - this->mapsize_ *= 2; + int result = this->active_object_map_->user_id_map_->find (user_id, + entry); + + if (result == 0) + { + if (servant != 0) + { + entry->servant_ = servant; + } + } else - this->mapsize_ += TAO_Linear_Active_Object_Map::LINEAR_INCREASE; + { + ACE_NEW_RETURN (entry, + TAO_Active_Object_Map::Map_Entry, + -1); - TAO_Active_Object_Map_Entry *tmp; - ACE_NEW_RETURN (tmp, - TAO_Active_Object_Map_Entry[this->mapsize_], - -1); + entry->user_id_ = user_id; + entry->servant_ = servant; - // Copy old stuff - for (TAO_Active_Object_Map_Entry *i = this->map_, *j = tmp; - i != this->map_ + this->next_; - ++i, ++j) - *j = *i; + result = this->active_object_map_->id_hint_strategy_->bind (*entry); - delete [] this->map_; + if (result == 0) + { + result = this->active_object_map_->user_id_map_->bind (entry->user_id_, + entry); - this->map_ = tmp; - return 0; + if (result != 0) + { + this->active_object_map_->id_hint_strategy_->unbind (*entry); + delete entry; + } + } + else + { + delete entry; + } + } + + return result; } -PortableServer::ObjectId * -TAO_Linear_Active_Object_Map::create_object_id (PortableServer::Servant, - CORBA::Environment &) +int +TAO_Multiple_Id_Strategy::unbind_using_user_id (const PortableServer::ObjectId &user_id) { - PortableServer::ObjectId *id; - CORBA::ULong size = sizeof (CORBA::ULong); - ACE_NEW_RETURN (id, - PortableServer::ObjectId (size), - 0); + TAO_Active_Object_Map::Map_Entry *entry = 0; + int result = this->active_object_map_->user_id_map_->unbind (user_id, + entry); - id->length (size); + if (result == 0) + { + result = this->active_object_map_->id_hint_strategy_->unbind (*entry); - ACE_OS::memcpy (id->get_buffer (), - &this->counter_, - size); + if (result == 0) + { + delete entry; + } + } - this->counter_++; - - return id; + return result; +} + +int +TAO_Multiple_Id_Strategy::find_user_id_using_servant (PortableServer::Servant servant, + PortableServer::ObjectId_out user_id) +{ + return -1; } int -TAO_Active_Demux_Active_Object_Map::bind (const PortableServer::ObjectId &id, - PortableServer::Servant servant) +TAO_Multiple_Id_Strategy::find_system_id_using_servant (PortableServer::Servant servant, + PortableServer::ObjectId_out system_id) { - CORBA::ULong index = 0; - CORBA::ULong generation = 0; - int result = this->parse_object_id (id, index, generation); + return -1; +} - if (result != 0 || - index > this->mapsize_ || - this->map_[index].generation_ != generation || - this->map_[index].is_free_ != 0) - return -1; +//////////////////////////////////////////////////////////////////////////////// - this->map_[index].servant_ = servant; +TAO_Lifespan_Strategy::~TAO_Lifespan_Strategy (void) +{ +} - return 0; +void +TAO_Lifespan_Strategy::set_active_object_map (TAO_Active_Object_Map *active_object_map) +{ + this->active_object_map_ = active_object_map; } +//////////////////////////////////////////////////////////////////////////////// + int -TAO_Active_Demux_Active_Object_Map::find (const PortableServer::ObjectId &id, - PortableServer::Servant &servant) +TAO_Transient_Strategy::find_servant_using_system_id (const PortableServer::ObjectId &system_id, + PortableServer::Servant &servant) { - CORBA::ULong index = 0; - CORBA::ULong generation = 0; - int result = this->parse_object_id (id, index, generation); - - if (result != 0 - || index > this->mapsize_ - || this->map_[index].generation_ != generation - || this->map_[index].is_free_ != 0) - return -1; + TAO_Active_Object_Map::Map_Entry *entry = 0; + int result = this->active_object_map_->id_hint_strategy_->find (system_id, + entry); + if (result == 0) + { + if (entry->servant_ == 0) + { + result = -1; + } + else + { + servant = entry->servant_; + } + } + else + { + PortableServer::ObjectId user_id; + result = this->active_object_map_->id_hint_strategy_->recover_key (system_id, + user_id); - servant = this->map_[index].servant_; + if (result == 0) + { + result = this->active_object_map_->user_id_map_->find (user_id, + entry); + if (result == 0) + { + if (entry->servant_ == 0) + { + result = -1; + } + else + { + servant = entry->servant_; + } + } + } + } - return 0; + return result; } +//////////////////////////////////////////////////////////////////////////////// + int -TAO_Active_Demux_Active_Object_Map::unbind (const PortableServer::ObjectId &id, - PortableServer::Servant &servant) +TAO_Persistent_Strategy::find_servant_using_system_id (const PortableServer::ObjectId &system_id, + PortableServer::Servant &servant) { - CORBA::ULong index = 0; - CORBA::ULong generation = 0; - int result = this->parse_object_id (id, index, generation); + PortableServer::ObjectId user_id; + int result = this->active_object_map_->id_hint_strategy_->recover_key (system_id, + user_id); + + if (result == 0) + { + TAO_Active_Object_Map::Map_Entry *entry = 0; + result = this->active_object_map_->id_hint_strategy_->find (system_id, + entry); + if (result == 0 && + user_id == entry->user_id_) + { + if (entry->servant_ == 0) + { + result = -1; + } + else + { + servant = entry->servant_; + } + } + else + { + result = this->active_object_map_->user_id_map_->find (user_id, + entry); + if (result == 0) + { + if (entry->servant_ == 0) + { + result = -1; + } + else + { + servant = entry->servant_; + } + } + } + } - if (result != 0 || - index > this->mapsize_ || - this->map_[index].generation_ != generation || - this->map_[index].is_free_ != 0) - return -1; + return result; +} - servant = this->map_[index].servant_; - this->map_[index].is_free_ = 1; +//////////////////////////////////////////////////////////////////////////////// - return 0; +TAO_Id_Assignment_Strategy::~TAO_Id_Assignment_Strategy (void) +{ } -PortableServer::ObjectId * -TAO_Active_Demux_Active_Object_Map::create_object_id (PortableServer::Servant servant, - CORBA::Environment &) +void +TAO_Id_Assignment_Strategy::set_active_object_map (TAO_Active_Object_Map *active_object_map) { - // This method assumes that locks are held when it is called - CORBA::ULong id_data[2]; - CORBA::ULong index = this->next_free (); - id_data[TAO_Active_Demux_Active_Object_Map::INDEX_FIELD] = index; + this->active_object_map_ = active_object_map; +} - // Increment generation count. - id_data[TAO_Active_Demux_Active_Object_Map::GENERATION_FIELD] = - ++this->map_[index].generation_; +//////////////////////////////////////////////////////////////////////////////// - // Move next along if index is not reused - if (index == this->next_) - this->next_++; +int +TAO_User_Id_Strategy::bind_using_system_id (PortableServer::Servant servant, + TAO_Active_Object_Map::Map_Entry *&entry) +{ + return -1; +} + +//////////////////////////////////////////////////////////////////////////////// + +int +TAO_System_Id_With_Unique_Id_Strategy::bind_using_system_id (PortableServer::Servant servant, + TAO_Active_Object_Map::Map_Entry *&entry) +{ + ACE_NEW_RETURN (entry, + TAO_Active_Object_Map::Map_Entry, + -1); - PortableServer::ObjectId *id; - CORBA::ULong size = 2 * sizeof (CORBA::ULong); - ACE_NEW_RETURN (id, - PortableServer::ObjectId (size), - 0); + int result = this->active_object_map_->user_id_map_->bind_create_key (entry, + entry->user_id_); + if (result == 0) + { + entry->servant_ = servant; - id->length (size); + result = this->active_object_map_->id_hint_strategy_->bind (*entry); - ACE_OS::memcpy (id->get_buffer (), - &id_data, - size); + if (result == 0) + { + if (servant != 0) + { + result = this->active_object_map_->servant_map_->bind (entry->servant_, + entry); + } - // Set the new values - this->map_[index].id_ = *id; - this->map_[index].servant_ = servant; - this->map_[index].is_free_ = 0; + if (result != 0) + { + this->active_object_map_->user_id_map_->unbind (entry->user_id_); + this->active_object_map_->id_hint_strategy_->unbind (*entry); + delete entry; + } + } + else + { + this->active_object_map_->user_id_map_->unbind (entry->user_id_); + delete entry; + } + } + else + { + delete entry; + } - return id; + return result; } -CORBA::ULong -TAO_Active_Demux_Active_Object_Map::next_free (void) +//////////////////////////////////////////////////////////////////////////////// + +int +TAO_System_Id_With_Multiple_Id_Strategy::bind_using_system_id (PortableServer::Servant servant, + TAO_Active_Object_Map::Map_Entry *&entry) { - for (;;) + ACE_NEW_RETURN (entry, + TAO_Active_Object_Map::Map_Entry, + -1); + + int result = this->active_object_map_->user_id_map_->bind_create_key (entry, + entry->user_id_); + if (result == 0) { - for (TAO_Active_Object_Map_Entry *i = this->map_; - i != this->map_ + this->mapsize_; - ++i) - if (i->is_free_) - return i - this->map_; + entry->system_id_ = entry->user_id_; + entry->servant_ = servant; + + result = this->active_object_map_->id_hint_strategy_->bind (*entry); - this->resize (); + if (result != 0) + { + this->active_object_map_->user_id_map_->unbind (entry->user_id_); + delete entry; + } } + else + { + delete entry; + } + + return result; +} + +//////////////////////////////////////////////////////////////////////////////// + +TAO_Id_Hint_Strategy::~TAO_Id_Hint_Strategy (void) +{ +} + +//////////////////////////////////////////////////////////////////////////////// + +int +TAO_Active_Hint_Strategy::recover_key (const PortableServer::ObjectId &system_id, + PortableServer::ObjectId &user_id) +{ + return this->system_id_map_.recover_key (system_id, + user_id); +} + +int +TAO_Active_Hint_Strategy::bind (TAO_Active_Object_Map::Map_Entry &entry) +{ + entry.system_id_ = entry.user_id_; + + return this->system_id_map_.bind_modify_key (&entry, + entry.system_id_); +} + +int +TAO_Active_Hint_Strategy::unbind (TAO_Active_Object_Map::Map_Entry &entry) +{ + return this->system_id_map_.unbind (entry.system_id_); +} + +int +TAO_Active_Hint_Strategy::find (const PortableServer::ObjectId &system_id, + TAO_Active_Object_Map::Map_Entry *&entry) +{ + return this->system_id_map_.find (system_id, + entry); } +size_t +TAO_Active_Hint_Strategy::hint_size (void) +{ + return ACE_Active_Map_Manager_Key::size (); +} + +int +TAO_Active_Hint_Strategy::system_id (PortableServer::ObjectId_out system_id, + TAO_Active_Object_Map::Map_Entry &entry) +{ + ACE_NEW_RETURN (system_id, + PortableServer::ObjectId (entry.system_id_), + -1); + return 0; +} + +//////////////////////////////////////////////////////////////////////////////// + +int +TAO_No_Hint_Strategy::recover_key (const PortableServer::ObjectId &system_id, + PortableServer::ObjectId &user_id) +{ + // Smartly copy all the data; <user_id does not own the data>. + user_id.replace (system_id.maximum (), + system_id.length (), + ACE_const_cast (CORBA::Octet *, + system_id.get_buffer ()), + 0); + + return 0; +} + +int +TAO_No_Hint_Strategy::bind (TAO_Active_Object_Map::Map_Entry &entry) +{ + return 0; +} + +int +TAO_No_Hint_Strategy::unbind (TAO_Active_Object_Map::Map_Entry &entry) +{ + return 0; +} + +int +TAO_No_Hint_Strategy::find (const PortableServer::ObjectId &system_id, + TAO_Active_Object_Map::Map_Entry *&entry) +{ + return -1; +} + +size_t +TAO_No_Hint_Strategy::hint_size (void) +{ + return 0; +} + +int +TAO_No_Hint_Strategy::system_id (PortableServer::ObjectId_out system_id, + TAO_Active_Object_Map::Map_Entry &entry) +{ + ACE_NEW_RETURN (system_id, + PortableServer::ObjectId (entry.user_id_), + -1); + return 0; +} + +//////////////////////////////////////////////////////////////////////////////// + #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Hash_Map_Iterator_Base_Ex<PortableServer::ObjectId, PortableServer::Servant, TAO_ObjectId_Hash, ACE_Equal_To<PortableServer::ObjectId>, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Ex<PortableServer::ObjectId, PortableServer::Servant, TAO_ObjectId_Hash, ACE_Equal_To<PortableServer::ObjectId>, ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator_Ex<PortableServer::ObjectId, PortableServer::Servant, TAO_ObjectId_Hash, ACE_Equal_To<PortableServer::ObjectId>, ACE_Null_Mutex>; -template class ACE_Hash_Map_Manager_Ex<PortableServer::ObjectId, PortableServer::Servant, TAO_ObjectId_Hash, ACE_Equal_To<PortableServer::ObjectId>, ACE_Null_Mutex>; -template class ACE_Hash_Map_Entry<PortableServer::ObjectId, PortableServer::Servant>; -template class ACE_Equal_To<PortableServer::ObjectId>; +// Common typedefs. +typedef PortableServer::ObjectId id; +typedef PortableServer::Servant servant; +typedef TAO_Active_Object_Map::Map_Entry * value; -template class ACE_Hash_Map_Iterator_Base_Ex<PortableServer::Servant, PortableServer::ObjectId, TAO_Servant_Hash, ACE_Equal_To<PortableServer::Servant>, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Ex<PortableServer::Servant, PortableServer::ObjectId, TAO_Servant_Hash, ACE_Equal_To<PortableServer::Servant>, ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator_Ex<PortableServer::Servant, PortableServer::ObjectId, TAO_Servant_Hash, ACE_Equal_To<PortableServer::Servant>, ACE_Null_Mutex>; -template class ACE_Hash_Map_Manager_Ex<PortableServer::Servant, PortableServer::ObjectId, TAO_Servant_Hash, ACE_Equal_To<PortableServer::Servant>, ACE_Null_Mutex>; -template class ACE_Hash_Map_Entry<PortableServer::Servant, PortableServer::ObjectId>; -template class ACE_Equal_To<PortableServer::Servant>; +typedef ACE_Pair<id, value> id_expanded_value; +typedef ACE_Reference_Pair<const id, value> id_value_type; +typedef ACE_Reference_Pair<const servant, value> servant_value_type; +typedef ACE_Equal_To<id> id_compare_keys; +typedef ACE_Equal_To<servant> servant_compare_keys; + +// Common +template class ACE_Reference_Pair<const id, value>; +template class ACE_Reference_Pair<const servant, value>; + +// Map and iterator classes. +template class ACE_Map<id, value>; +template class ACE_Map<servant, value>; +template class ACE_Iterator<id_value_type>; +template class ACE_Iterator<servant_value_type>; +template class ACE_Reverse_Iterator<id_value_type>; +template class ACE_Reverse_Iterator<servant_value_type>; + +// Iterator base classes. +template class ACE_Iterator_Impl<id_value_type>; +template class ACE_Iterator_Impl<servant_value_type>; +template class ACE_Reverse_Iterator_Impl<id_value_type>; +template class ACE_Reverse_Iterator_Impl<servant_value_type>; + +// Active Map Manager related. +template class ACE_Pair<id, value>; +template class ACE_Active_Map_Manager_Adapter<id, value, TAO_Ignore_Original_Key_Adapter>; +template class ACE_Active_Map_Manager_Adapter<id, value, TAO_Preserve_Original_Key_Adapter>; +template class ACE_Active_Map_Manager_Iterator_Adapter<id_value_type, id_expanded_value>; +template class ACE_Active_Map_Manager_Reverse_Iterator_Adapter<id_value_type, id_expanded_value>; +template class ACE_Active_Map_Manager<id_expanded_value>; +template class ACE_Map_Manager<ACE_Active_Map_Manager_Key, id_expanded_value, ACE_Null_Mutex>; +template class ACE_Map_Iterator_Base<ACE_Active_Map_Manager_Key, id_expanded_value, ACE_Null_Mutex>; +template class ACE_Map_Iterator<ACE_Active_Map_Manager_Key, id_expanded_value, ACE_Null_Mutex>; +template class ACE_Map_Reverse_Iterator<ACE_Active_Map_Manager_Key, id_expanded_value, ACE_Null_Mutex>; +template class ACE_Map_Entry<ACE_Active_Map_Manager_Key, id_expanded_value>; + +// Hash Map Manager related. +template class ACE_Hash_Map_Manager_Ex_Adapter<id, value, Hash_Key, id_compare_keys, TAO_Incremental_Key_Generator>; +template class ACE_Hash_Map_Manager_Ex_Adapter<servant, value, Hash_Key, servant_compare_keys, TAO_Noop_Key_Generator>; +template class ACE_Hash_Map_Manager_Ex_Iterator_Adapter<id_value_type, id, value, Hash_Key, id_compare_keys>; +template class ACE_Hash_Map_Manager_Ex_Iterator_Adapter<servant_value_type, servant, value, Hash_Key, servant_compare_keys>; +template class ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<id_value_type, id, value, Hash_Key, id_compare_keys>; +template class ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<servant_value_type, servant, value, Hash_Key, servant_compare_keys>; +template class ACE_Hash_Map_Manager_Ex<id, value, Hash_Key, id_compare_keys, ACE_Null_Mutex>; +template class ACE_Hash_Map_Manager_Ex<servant, value, Hash_Key, servant_compare_keys, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator_Base_Ex<id, value, Hash_Key, id_compare_keys, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator_Base_Ex<servant, value, Hash_Key, servant_compare_keys, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator_Ex<id, value, Hash_Key, id_compare_keys, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator_Ex<servant, value, Hash_Key, servant_compare_keys, ACE_Null_Mutex>; +template class ACE_Hash_Map_Reverse_Iterator_Ex<id, value, Hash_Key, id_compare_keys, ACE_Null_Mutex>; +template class ACE_Hash_Map_Reverse_Iterator_Ex<servant, value, Hash_Key, servant_compare_keys, ACE_Null_Mutex>; +template class ACE_Hash_Map_Entry<id, value>; +template class ACE_Hash_Map_Entry<servant, value>; +template class ACE_Equal_To<id>; +template class ACE_Equal_To<servant>; + +// Map Manager related. +template class ACE_Map_Manager_Iterator_Adapter<id_value_type, id, value>; +template class ACE_Map_Manager_Iterator_Adapter<servant_value_type, servant, value>; +template class ACE_Map_Manager_Reverse_Iterator_Adapter<id_value_type, id, value>; +template class ACE_Map_Manager_Reverse_Iterator_Adapter<servant_value_type, servant, value>; +template class ACE_Map_Manager_Adapter<id, value, TAO_Incremental_Key_Generator>; +template class ACE_Map_Manager_Adapter<servant, value, TAO_Noop_Key_Generator>; +template class ACE_Map_Manager<id, value, ACE_Null_Mutex>; +template class ACE_Map_Manager<servant, value, ACE_Null_Mutex>; +template class ACE_Map_Iterator_Base<id, value, ACE_Null_Mutex>; +template class ACE_Map_Iterator_Base<servant, value, ACE_Null_Mutex>; +template class ACE_Map_Iterator<id, value, ACE_Null_Mutex>; +template class ACE_Map_Iterator<servant, value, ACE_Null_Mutex>; +template class ACE_Map_Reverse_Iterator<id, value, ACE_Null_Mutex>; +template class ACE_Map_Reverse_Iterator<servant, value, ACE_Null_Mutex>; +template class ACE_Map_Entry<id, value>; +template class ACE_Map_Entry<servant, value>; #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<PortableServer::ObjectId, PortableServer::Servant, TAO_ObjectId_Hash, ACE_Equal_To<PortableServer::ObjectId>, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Ex<PortableServer::ObjectId, PortableServer::Servant, TAO_ObjectId_Hash, ACE_Equal_To<PortableServer::ObjectId>, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<PortableServer::ObjectId, PortableServer::Servant, TAO_ObjectId_Hash, ACE_Equal_To<PortableServer::ObjectId>, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Manager_Ex<PortableServer::ObjectId, PortableServer::Servant, TAO_ObjectId_Hash, ACE_Equal_To<PortableServer::ObjectId>, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Entry<PortableServer::ObjectId, PortableServer::Servant> -#pragma instantiate ACE_Equal_To<PortableServer::ObjectId> - -#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<PortableServer::Servant, PortableServer::ObjectId, TAO_Servant_Hash, ACE_Equal_To<PortableServer::Servant>, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Ex<PortableServer::Servant, PortableServer::ObjectId, TAO_Servant_Hash, ACE_Equal_To<PortableServer::Servant>, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<PortableServer::Servant, PortableServer::ObjectId, TAO_Servant_Hash, ACE_Equal_To<PortableServer::Servant>, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Manager_Ex<PortableServer::Servant, PortableServer::ObjectId, TAO_Servant_Hash, ACE_Equal_To<PortableServer::Servant>, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Entry<PortableServer::Servant, PortableServer::ObjectId> -#pragma instantiate ACE_Equal_To<PortableServer::Servant> +// Common typedefs. +typedef PortableServer::ObjectId id; +typedef PortableServer::Servant servant; +typedef TAO_Active_Object_Map::Map_Entry * value; + +typedef ACE_Pair<id, value> id_expanded_value; +typedef ACE_Reference_Pair<const id, value> id_value_type; +typedef ACE_Reference_Pair<const servant, value> servant_value_type; +typedef ACE_Equal_To<id> id_compare_keys; +typedef ACE_Equal_To<servant> servant_compare_keys; + +// Common +#pragma instantiate ACE_Reference_Pair<const id, value> +#pragma instantiate ACE_Reference_Pair<const servant, value> + +// Map and iterator classes. +#pragma instantiate ACE_Map<id, value> +#pragma instantiate ACE_Map<servant, value> +#pragma instantiate ACE_Iterator<id_value_type> +#pragma instantiate ACE_Iterator<servant_value_type> +#pragma instantiate ACE_Reverse_Iterator<id_value_type> +#pragma instantiate ACE_Reverse_Iterator<servant_value_type> + +// Iterator base classes. +#pragma instantiate ACE_Iterator_Impl<id_value_type> +#pragma instantiate ACE_Iterator_Impl<servant_value_type> +#pragma instantiate ACE_Reverse_Iterator_Impl<id_value_type> +#pragma instantiate ACE_Reverse_Iterator_Impl<servant_value_type> + +// Active Map Manager related. +#pragma instantiate ACE_Pair<id, value> +#pragma instantiate ACE_Active_Map_Manager_Adapter<id, value, TAO_Ignore_Original_Key_Adapter> +#pragma instantiate ACE_Active_Map_Manager_Adapter<id, value, TAO_Preserve_Original_Key_Adapter> +#pragma instantiate ACE_Active_Map_Manager_Iterator_Adapter<id_value_type, id_expanded_value> +#pragma instantiate ACE_Active_Map_Manager_Reverse_Iterator_Adapter<id_value_type, id_expanded_value> +#pragma instantiate ACE_Active_Map_Manager<id_expanded_value> +#pragma instantiate ACE_Map_Manager<ACE_Active_Map_Manager_Key, id_expanded_value, ACE_Null_Mutex> +#pragma instantiate ACE_Map_Iterator_Base<ACE_Active_Map_Manager_Key, id_expanded_value, ACE_Null_Mutex> +#pragma instantiate ACE_Map_Iterator<ACE_Active_Map_Manager_Key, id_expanded_value, ACE_Null_Mutex> +#pragma instantiate ACE_Map_Reverse_Iterator<ACE_Active_Map_Manager_Key, id_expanded_value, ACE_Null_Mutex> +#pragma instantiate ACE_Map_Entry<ACE_Active_Map_Manager_Key, id_expanded_value> + +// Hash Map Manager related. +#pragma instantiate ACE_Hash_Map_Manager_Ex_Adapter<id, value, Hash_Key, id_compare_keys, TAO_Incremental_Key_Generator> +#pragma instantiate ACE_Hash_Map_Manager_Ex_Adapter<servant, value, Hash_Key, servant_compare_keys, TAO_Noop_Key_Generator> +#pragma instantiate ACE_Hash_Map_Manager_Ex_Iterator_Adapter<id_value_type, id, value, Hash_Key, id_compare_keys> +#pragma instantiate ACE_Hash_Map_Manager_Ex_Iterator_Adapter<servant_value_type, servant, value, Hash_Key, servant_compare_keys> +#pragma instantiate ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<id_value_type, id, value, Hash_Key, id_compare_keys> +#pragma instantiate ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<servant_value_type, servant, value, Hash_Key, servant_compare_keys> +#pragma instantiate ACE_Hash_Map_Manager_Ex<id, value, Hash_Key, id_compare_keys, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Manager_Ex<servant, value, Hash_Key, servant_compare_keys, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<id, value, Hash_Key, id_compare_keys, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<servant, value, Hash_Key, servant_compare_keys, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator_Ex<id, value, Hash_Key, id_compare_keys, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator_Ex<servant, value, Hash_Key, servant_compare_keys, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<id, value, Hash_Key, id_compare_keys, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<servant, value, Hash_Key, servant_compare_keys, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Entry<id, value> +#pragma instantiate ACE_Hash_Map_Entry<servant, value> +#pragma instantiate ACE_Equal_To<id> +#pragma instantiate ACE_Equal_To<servant> + +// Map Manager related. +#pragma instantiate ACE_Map_Manager_Iterator_Adapter<id_value_type, id, value> +#pragma instantiate ACE_Map_Manager_Iterator_Adapter<servant_value_type, servant, value> +#pragma instantiate ACE_Map_Manager_Reverse_Iterator_Adapter<id_value_type, id, value> +#pragma instantiate ACE_Map_Manager_Reverse_Iterator_Adapter<servant_value_type, servant, value> +#pragma instantiate ACE_Map_Manager_Adapter<id, value, TAO_Incremental_Key_Generator> +#pragma instantiate ACE_Map_Manager_Adapter<servant, value, TAO_Noop_Key_Generator> +#pragma instantiate ACE_Map_Manager<id, value, ACE_Null_Mutex> +#pragma instantiate ACE_Map_Manager<servant, value, ACE_Null_Mutex> +#pragma instantiate ACE_Map_Iterator_Base<id, value, ACE_Null_Mutex> +#pragma instantiate ACE_Map_Iterator_Base<servant, value, ACE_Null_Mutex> +#pragma instantiate ACE_Map_Iterator<id, value, ACE_Null_Mutex> +#pragma instantiate ACE_Map_Iterator<servant, value, ACE_Null_Mutex> +#pragma instantiate ACE_Map_Reverse_Iterator<id, value, ACE_Null_Mutex> +#pragma instantiate ACE_Map_Reverse_Iterator<servant, value, ACE_Null_Mutex> +#pragma instantiate ACE_Map_Entry<id, value> +#pragma instantiate ACE_Map_Entry<servant, value> #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/tao/Active_Object_Map.h b/TAO/tao/Active_Object_Map.h index b35f67cc68e..c817637ed53 100644 --- a/TAO/tao/Active_Object_Map.h +++ b/TAO/tao/Active_Object_Map.h @@ -1,3 +1,4 @@ +/* -*- C++ -*- */ // $Id$ // ============================================================================ @@ -9,551 +10,637 @@ // Active_Object_Map.h // // = AUTHOR -// Aniruddha Gokhale // Irfan Pyarali -// Carlos O'Ryan // // ============================================================================ #ifndef TAO_ACTIVE_OBJECT_MAP_H #define TAO_ACTIVE_OBJECT_MAP_H -#include "ace/Hash_Map_Manager_T.h" #include "tao/corbafwd.h" #include "tao/Servant_Base.h" +#include "ace/Map.h" +#include "tao/Server_Strategy_Factory.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +//////////////////////////////////////////////////////////////////////////////// + +class TAO_Incremental_Key_Generator +{ + // = TITLE + // Defines a key generator. + // + // = DESCRIPTION + // This class is used in adapters of maps that do not produce keys. +public: + + TAO_Incremental_Key_Generator (void); + + int operator() (PortableServer::ObjectId &id); + +protected: + + CORBA::ULong counter_; +}; + +//////////////////////////////////////////////////////////////////////////////// class TAO_Export TAO_ObjectId_Hash { // = TITLE - // @@ Irfan, please fill in here... + // Hashing class for Object Ids. + // + // = DESCRIPTION + // Define the hash() method for Object Ids. public: + u_long operator () (const PortableServer::ObjectId &id) const; // Returns hash value. }; -// Defined in Stub.cpp for TAO_opaque (an alias of -// PortableServer::ObjectId). -extern TAO_Export int operator== (const PortableServer::ObjectId &l, - const PortableServer::ObjectId &r); +//////////////////////////////////////////////////////////////////////////////// -class TAO_Export TAO_Active_Object_Map_Entry +class TAO_Ignore_Original_Key_Adapter { // = TITLE - // Common entry for all maps + // A key adapter (encode/decode) class. + // + // = DESCRIPTION + // Define the encoding and decoding methods for converting + // between Object Ids and active keys. This class ignores the + // <original_key> passed to it. public: - TAO_Active_Object_Map_Entry (void); - // Constructor - PortableServer::ObjectId id_; - // Object id + int encode (const PortableServer::ObjectId &original_key, + const ACE_Active_Map_Manager_Key &active_key, + PortableServer::ObjectId &modified_key); - CORBA::ULong generation_; - // Generation count + int decode (const PortableServer::ObjectId &modified_key, + ACE_Active_Map_Manager_Key &active_key); - PortableServer::Servant servant_; - // Servant pointer - - int is_free_; - // Is the entry currently in use + int decode (const PortableServer::ObjectId &modified_key, + PortableServer::ObjectId &original_key); }; -// Forward declaration -class TAO_Active_Object_Map_Iterator_Impl; +//////////////////////////////////////////////////////////////////////////////// -class TAO_Export TAO_Active_Object_Map_Iterator +class TAO_Preserve_Original_Key_Adapter { // = TITLE - // Bridge for abstract iterator. + // A key adapter (encode/decode) class. // // = DESCRIPTION - // This class provides the "abstraction" for iteration over the - // active object maps. + // Define the encoding and decoding methods for converting + // between Object Ids and active keys. This class remembers the + // <original_key> passed to it. public: - TAO_Active_Object_Map_Iterator (TAO_Active_Object_Map_Iterator_Impl *impl); - // Constructor taking an implementation. - TAO_Active_Object_Map_Iterator (const TAO_Active_Object_Map_Iterator &x); - TAO_Active_Object_Map_Iterator &operator= (const TAO_Active_Object_Map_Iterator &x); - virtual ~TAO_Active_Object_Map_Iterator (void); - // This is a well behaved class + int encode (const PortableServer::ObjectId &original_key, + const ACE_Active_Map_Manager_Key &active_key, + PortableServer::ObjectId &modified_key); - const TAO_Active_Object_Map_Entry &operator *(void) const; - // Return the current item. + int decode (const PortableServer::ObjectId &modified_key, + ACE_Active_Map_Manager_Key &active_key); - TAO_Active_Object_Map_Iterator operator++ (void); - TAO_Active_Object_Map_Iterator operator++ (int); - // Increase the current position. + int decode (const PortableServer::ObjectId &modified_key, + PortableServer::ObjectId &original_key); +}; - friend int operator== (const TAO_Active_Object_Map_Iterator &l, - const TAO_Active_Object_Map_Iterator &r); - friend int operator!= (const TAO_Active_Object_Map_Iterator &l, - const TAO_Active_Object_Map_Iterator &r); - // Compare two iterators. +//////////////////////////////////////////////////////////////////////////////// -protected: - TAO_Active_Object_Map_Iterator_Impl *impl_; -}; +// Comparison of Object Ids. Defined in Stub.cpp for TAO_opaque (an +// alias of PortableServer::ObjectId). +extern TAO_Export int operator== (const PortableServer::ObjectId &l, + const PortableServer::ObjectId &r); + +//////////////////////////////////////////////////////////////////////////////// -// Forward declaration -class TAO_Active_Object_Map_Impl; -class TAO_Reverse_Active_Object_Map_Impl; +// Forward declarations. +class TAO_Id_Uniqueness_Strategy; +class TAO_Lifespan_Strategy; +class TAO_Id_Assignment_Strategy; +class TAO_Id_Hint_Strategy; -class TAO_Export TAO_Active_Object_Map +class TAO_Active_Object_Map { // = TITLE - // Interface class for maintaining a mapping of object ids to - // pointers to servants. + // Map of object ids to servants. + // + // = DESCRIPTION + // Implementation to be used by the POA. public: + TAO_Active_Object_Map (int user_id_policy, - int unique_id_policy); - // System creates map based on <user_id_policy> and - // <unique_id_policy> + int unique_id_policy, + int persistent_id_policy, + const TAO_Server_Strategy_Factory::Active_Object_Map_Creation_Parameters &creation_parameters); + // Constructor. - virtual ~TAO_Active_Object_Map (void); + ~TAO_Active_Object_Map (void); // Destructor. - int bind (const PortableServer::ObjectId &id, - PortableServer::Servant servant); - // Associate <id> with <servant>, returning 0 if object is - // registered successfully, 1 if it's already registered, and -1 if - // a failure occurs during registration. + int is_servant_in_map (PortableServer::Servant servant); + // Must be used with UNIQUE_ID policy. + + int is_user_id_in_map (const PortableServer::ObjectId &user_id); + // Can be used with any policy. With the SYSTEM_ID policy, + // <user_id> is actually <system_id>. + + int bind_using_system_id_returning_system_id (PortableServer::Servant servant, + PortableServer::ObjectId_out system_id); + // Must be used with SYSTEM_ID policy. + + int bind_using_system_id_returning_user_id (PortableServer::Servant servant, + PortableServer::ObjectId_out user_id); + // Must be used with SYSTEM_ID policy. + + int bind_using_user_id (PortableServer::Servant servant, + const PortableServer::ObjectId &user_id); + // Can be used with any policy. With the SYSTEM_ID policy, + // <user_id> is actually <system_id>. + + int find_system_id_using_user_id (const PortableServer::ObjectId &user_id, + PortableServer::ObjectId_out system_id); + // Can be used with any policy. With the SYSTEM_ID policy, + // <user_id> is actually <system_id>. + + int rebind_using_user_id_and_system_id (PortableServer::Servant servant, + const PortableServer::ObjectId &user_id, + const PortableServer::ObjectId &system_id); + // Can be used with any policy. + + int unbind_using_user_id (const PortableServer::ObjectId &user_id); + // Can be used with any policy. With the SYSTEM_ID policy, + // <user_id> is actually <system_id>. + + int find_user_id_using_servant (PortableServer::Servant servant, + PortableServer::ObjectId_out user_id); + // Must be used with UNIQUE_ID policy. With the SYSTEM_ID policy, + // <user_id> is actually <system_id>. + + int find_system_id_using_servant (PortableServer::Servant servant, + PortableServer::ObjectId_out system_id); + // Must be used with UNIQUE_ID policy. With the SYSTEM_ID policy, + // <user_id> is actually <system_id>. + + int find_servant_using_user_id (const PortableServer::ObjectId &user_id, + PortableServer::Servant &servant); + // Can be used with any policy. With the SYSTEM_ID policy, + // <user_id> is actually <system_id>. + + int find_servant_using_system_id (const PortableServer::ObjectId &system_id, + PortableServer::Servant &servant); + // Can be used with any policy. + + int find_servant_and_system_id_using_user_id (const PortableServer::ObjectId &user_id, + PortableServer::Servant &servant, + PortableServer::ObjectId_out system_id); + // Can be used with any policy. With the SYSTEM_ID policy, + // <user_id> is identical to <system_id>. + + int find_user_id_using_system_id (const PortableServer::ObjectId &system_id, + PortableServer::ObjectId_out user_id); + // Can be used with any policy. When the SYSTEM_ID policy is used, + // the <system_id> is identical to <user_id>. + + size_t system_id_size (void); + // Can be used with any policy. + + struct Map_Entry + { + // = TITLE + // Value field of the active object map. + // + // = DESCRIPTION + // + // We need a mapping from and to all of the following fields: + // <user_id>, <system_id>, and <servant>. Therefore, we keep + // all the fields together in the map. + + PortableServer::ObjectId user_id_; + PortableServer::ObjectId system_id_; + PortableServer::Servant servant_; + }; - int unbind (const PortableServer::ObjectId &id, - PortableServer::Servant &servant); - // Remove any association among <id> and <servant>. Returns 0 if - // the operation was succesful, <-1> otherwise. + typedef ACE_Map< + PortableServer::ObjectId, + Map_Entry *> user_id_map; + // Base class of the id map. + + typedef ACE_Hash_Map_Manager_Ex_Adapter< + PortableServer::ObjectId, + Map_Entry *, + TAO_ObjectId_Hash, + ACE_Equal_To<PortableServer::ObjectId>, + TAO_Incremental_Key_Generator> user_id_hash_map; + // Id hash map. + + typedef ACE_Map_Manager_Adapter< + PortableServer::ObjectId, + Map_Entry *, + TAO_Incremental_Key_Generator> user_id_linear_map; + // Id linear map. + + typedef ACE_Active_Map_Manager_Adapter< + PortableServer::ObjectId, + Map_Entry *, + TAO_Ignore_Original_Key_Adapter> user_id_active_map; + // Id active map. + + typedef ACE_Map< + PortableServer::Servant, + Map_Entry *> servant_map; + // Base class of the servant map. + + typedef ACE_Hash_Map_Manager_Ex_Adapter< + PortableServer::Servant, + Map_Entry *, + TAO_Servant_Hash, + ACE_Equal_To<PortableServer::Servant>, + ACE_Noop_Key_Generator<PortableServer::Servant> > servant_hash_map; + // Servant hash map. + + typedef ACE_Map_Manager_Adapter< + PortableServer::Servant, + Map_Entry *, + ACE_Noop_Key_Generator<PortableServer::Servant> > servant_linear_map; + // Servant linear map. + + user_id_map *user_id_map_; + // Id map. + + servant_map *servant_map_; + // Servant map. + + TAO_Id_Uniqueness_Strategy *id_uniqueness_strategy_; + // Id uniqueness strategy. + + TAO_Lifespan_Strategy *lifespan_strategy_; + // Lifespan strategy. + + TAO_Id_Assignment_Strategy *id_assignment_strategy_; + // Id assignment strategy. + + TAO_Id_Hint_Strategy *id_hint_strategy_; + // Id hint strategy. + + size_t system_id_size_; + // Size of the system id produced by the map. +}; - int find (const PortableServer::ObjectId &id); - // Returns 0 if there is a servant for <id> in the map, <-1> - // otherwise. +//////////////////////////////////////////////////////////////////////////////// - int find (const PortableServer::ObjectId &id, - PortableServer::Servant &servant); - // Find object associated with <id>. If the <id> is found it sets - // <servant> and returns 0. If not found, <servant> is unchanged - // and the value <-1> is returned. +class TAO_Id_Uniqueness_Strategy +{ + // = TITLE + // Id uniqueness strategy. + // + // = DESCRIPTION + // Strategy for implementing points of variation between the + // UNIQUE_ID and the MULTIPLE_ID policies. +public: - int find (const PortableServer::Servant servant); - // Returns 0 if <servant> is in the map, <-1> otherwise. + virtual ~TAO_Id_Uniqueness_Strategy (void); + // Virtual destructor. - int find (const PortableServer::Servant servant, - PortableServer::ObjectId &id); - // This method is only used with unique ids. Find the <id> for - // <servant>. Returns <-1> if <servant> is not found, returns <0> - // if <servant> is found. + virtual int is_servant_in_map (PortableServer::Servant servant) = 0; + // Must be used with UNIQUE_ID policy. - PortableServer::ObjectId *create_object_id (PortableServer::Servant servant, - CORBA::Environment &TAO_IN_ENV); - // Create an object id + virtual int unbind_using_user_id (const PortableServer::ObjectId &user_id) = 0; + // Can be used with any policy. With the SYSTEM_ID policy, + // <user_id> is actually <system_id>. - virtual CORBA::ULong system_id_size (void) const; - // Size of the system generated id. + virtual int find_user_id_using_servant (PortableServer::Servant servant, + PortableServer::ObjectId_out user_id) = 0; + // Must be used with UNIQUE_ID policy. With the SYSTEM_ID policy, + // <user_id> is actually <system_id>. - typedef TAO_Active_Object_Map_Iterator iterator; - iterator begin (void) const; - iterator end (void) const; + virtual int find_system_id_using_servant (PortableServer::Servant servant, + PortableServer::ObjectId_out system_id) = 0; + // Must be used with UNIQUE_ID policy. With the SYSTEM_ID policy, + // <user_id> is actually <system_id>. -protected: - TAO_Active_Object_Map (const TAO_Active_Object_Map &); - TAO_Active_Object_Map &operator= (const TAO_Active_Object_Map &); - // Disallow copying. + virtual int bind_using_user_id (PortableServer::Servant servant, + const PortableServer::ObjectId &user_id, + TAO_Active_Object_Map::Map_Entry *&entry) = 0; + // Can be used with any policy. With the SYSTEM_ID policy, + // <user_id> is actually <system_id>. -protected: - TAO_Active_Object_Map_Impl *impl_; - // Implementation pointer + virtual void set_active_object_map (TAO_Active_Object_Map *active_object_map); + // Set the active map. - TAO_Reverse_Active_Object_Map_Impl *reverse_impl_; - // Reverse implementation pointer +protected: - int unique_id_policy_; - // Flag to indicate whether we have the UNIQUE_ID policy or the - // SYSTEM_ID policy + TAO_Active_Object_Map *active_object_map_; + // Pointer to the active map. }; -class TAO_Export TAO_Active_Object_Map_Iterator_Impl +//////////////////////////////////////////////////////////////////////////////// + +class TAO_Unique_Id_Strategy : public TAO_Id_Uniqueness_Strategy { // = TITLE - // Abstract iterator for all active object maps. + // Unique id strategy. // // = DESCRIPTION - // We want to provide an common interface for the different active - // object maps and their iterators. Active object maps are - // handled using base classes and virtual methods; but we must - // provide a "by value" interface for iterators. - // - // To do this we use several well know patterns: - // - // TAO_Active_Object_Map::iterator uses the Bridge pattern to - // give a consistent and "by-value" interface to all the - // iterators. The base class for all the iterators is - // TAO_Active_Object_Map_Iterator, here we use external - // polymorphism to adapt all the iterators to this common - // interface. + // Strategy for the UNIQUE_ID policy. public: - virtual ~TAO_Active_Object_Map_Iterator_Impl (void); - // Dtor - virtual TAO_Active_Object_Map_Iterator_Impl *clone (void) const = 0; - // Make a copy of the iterator, pointing to the current position. + virtual int is_servant_in_map (PortableServer::Servant servant); + // Must be used with UNIQUE_ID policy. - virtual const TAO_Active_Object_Map_Entry &item (void) const = 0; - // Obtain the current item + virtual int unbind_using_user_id (const PortableServer::ObjectId &user_id); + // Can be used with any policy. With the SYSTEM_ID policy, + // <user_id> is actually <system_id>. - virtual void advance (void) = 0; - // Advance to the next element. + virtual int find_user_id_using_servant (PortableServer::Servant servant, + PortableServer::ObjectId_out user_id); + // Must be used with UNIQUE_ID policy. With the SYSTEM_ID policy, + // <user_id> is actually <system_id>. - virtual int done (const TAO_Active_Object_Map_Iterator_Impl *end) const = 0; - // Returns 1 if "this" points to the same position as <end>, returns - // 0 otherwise. + virtual int find_system_id_using_servant (PortableServer::Servant servant, + PortableServer::ObjectId_out system_id); + // Must be used with UNIQUE_ID policy. With the SYSTEM_ID policy, + // <user_id> is actually <system_id>. + + virtual int bind_using_user_id (PortableServer::Servant servant, + const PortableServer::ObjectId &user_id, + TAO_Active_Object_Map::Map_Entry *&entry); + // Can be used with any policy. With the SYSTEM_ID policy, + // <user_id> is actually <system_id>. }; -class TAO_Export TAO_Active_Object_Map_Impl +//////////////////////////////////////////////////////////////////////////////// + +class TAO_Multiple_Id_Strategy : public TAO_Id_Uniqueness_Strategy { // = TITLE - // Abstract class for maintaining a mapping from object ids to - // servants. + // Multiple id strategy. // - // = NOTES - // Iterators may return free entries, whose "int_id" (the servant) - // is 0. + // = DESCRIPTION + // Strategy for the MULTIPLE_ID policy. public: - virtual ~TAO_Active_Object_Map_Impl (void); - // Destructor. - virtual TAO_Active_Object_Map_Iterator_Impl *begin () const = 0; - virtual TAO_Active_Object_Map_Iterator_Impl *end () const = 0; - // Iterator interface - - virtual int bind (const PortableServer::ObjectId &id, - PortableServer::Servant servant) = 0; - virtual int unbind (const PortableServer::ObjectId &id, - PortableServer::Servant &servant) = 0; - virtual int find (const PortableServer::ObjectId &id, - PortableServer::Servant &servant) = 0; - virtual int find (const PortableServer::ObjectId &id); - virtual int find (const PortableServer::Servant servant); - virtual int find (const PortableServer::Servant servant, - PortableServer::ObjectId &id); - virtual PortableServer::ObjectId *create_object_id (PortableServer::Servant servant, - CORBA::Environment &TAO_IN_ENV) = 0; - virtual CORBA::ULong system_id_size (void) const = 0; - virtual int is_free (const TAO_Active_Object_Map_Entry &item) const = 0; + virtual int is_servant_in_map (PortableServer::Servant servant); + // Must be used with UNIQUE_ID policy. + + virtual int unbind_using_user_id (const PortableServer::ObjectId &user_id); + // Can be used with any policy. With the SYSTEM_ID policy, + // <user_id> is actually <system_id>. + + virtual int find_user_id_using_servant (PortableServer::Servant servant, + PortableServer::ObjectId_out user_id); + // Must be used with UNIQUE_ID policy. With the SYSTEM_ID policy, + // <user_id> is actually <system_id>. + + virtual int find_system_id_using_servant (PortableServer::Servant servant, + PortableServer::ObjectId_out system_id); + // Must be used with UNIQUE_ID policy. With the SYSTEM_ID policy, + // <user_id> is actually <system_id>. + + virtual int bind_using_user_id (PortableServer::Servant servant, + const PortableServer::ObjectId &user_id, + TAO_Active_Object_Map::Map_Entry *&entry); + // Can be used with any policy. With the SYSTEM_ID policy, + // <user_id> is actually <system_id>. }; -class TAO_Export TAO_Reverse_Active_Object_Map_Impl +//////////////////////////////////////////////////////////////////////////////// + +class TAO_Lifespan_Strategy { // = TITLE - // Abstract base class for maintaining a mapping of servant to - // object ids. + // Lifespan strategy. + // + // = DESCRIPTION + // Strategy for implementing points of variation between the + // TRANSIENT and the PERSISTENT policies. public: - TAO_Reverse_Active_Object_Map_Impl (void); - // Constructor - - virtual ~TAO_Reverse_Active_Object_Map_Impl (void); - // Destructor. - virtual int bind (PortableServer::Servant servant, - const PortableServer::ObjectId &id) = 0; - // Associate <servant> with <id>. + virtual ~TAO_Lifespan_Strategy (void); + // Virtual destructor. - virtual int unbind (PortableServer::Servant servant) = 0; - // Remote <servant> from table. + virtual int find_servant_using_system_id (const PortableServer::ObjectId &system_id, + PortableServer::Servant &servant) = 0; + // Can be used with any policy. - virtual int find (const PortableServer::Servant servant, - PortableServer::ObjectId &id) = 0; - // Find <id> of <servant>. + virtual void set_active_object_map (TAO_Active_Object_Map *active_object_map); + // Set the active map. - virtual int find (PortableServer::Servant servant) = 0; - // Find <servant> in the table. +protected: -private: - TAO_Reverse_Active_Object_Map_Impl (const TAO_Reverse_Active_Object_Map_Impl &); - TAO_Reverse_Active_Object_Map_Impl &operator= (const TAO_Reverse_Active_Object_Map_Impl &); - // Disallow copying. + TAO_Active_Object_Map *active_object_map_; + // Pointer to the active map. }; -class TAO_Export TAO_Reverse_Active_Object_Map_For_Unique_Id_Policy : public TAO_Reverse_Active_Object_Map_Impl +//////////////////////////////////////////////////////////////////////////////// + +class TAO_Transient_Strategy : public TAO_Lifespan_Strategy { // = TITLE - // Table for maintaining a mapping of servant to object ids (for - // the UNIQUE_ID POA_Policy) + // Transient strategy. + // + // = DESCRIPTION + // Strategy for the TRANSIENT policy. public: - TAO_Reverse_Active_Object_Map_For_Unique_Id_Policy (size_t size); - // Constructor - virtual ~TAO_Reverse_Active_Object_Map_For_Unique_Id_Policy (void); - // Destructor - - virtual int bind (PortableServer::Servant servant, - const PortableServer::ObjectId &id); - // Associate <servant> with <id>. - - virtual int unbind (PortableServer::Servant servant); - // Remote <servant> from table. - - virtual int find (const PortableServer::Servant servant, - PortableServer::ObjectId &id); - // Find <id> of <servant>. + virtual int find_servant_using_system_id (const PortableServer::ObjectId &system_id, + PortableServer::Servant &servant); + // Can be used with any policy. +}; - virtual int find (PortableServer::Servant servant); - // Find <servant> in the table. +//////////////////////////////////////////////////////////////////////////////// -protected: +class TAO_Persistent_Strategy : public TAO_Lifespan_Strategy +{ + // = TITLE + // Persistent strategy. + // + // = DESCRIPTION + // Strategy for the PERSISTENT policy. +public: - // = Typedef for the hash map - typedef ACE_Hash_Map_Manager_Ex<PortableServer::Servant, - PortableServer::ObjectId, - TAO_Servant_Hash, - ACE_Equal_To<PortableServer::Servant>, - ACE_Null_Mutex> - REVERSE_MAP; + virtual int find_servant_using_system_id (const PortableServer::ObjectId &system_id, + PortableServer::Servant &servant); + // Can be used with any policy. - REVERSE_MAP map_; - // Hash map instance }; -class TAO_Export TAO_Reverse_Active_Object_Map_For_Multiple_Id_Policy : public TAO_Reverse_Active_Object_Map_Impl +//////////////////////////////////////////////////////////////////////////////// + +class TAO_Id_Assignment_Strategy { // = TITLE - // Table for maintaining a mapping of servant to object ids (for - // the MULTIPLE_ID POA_Policy) + // Id uniqueness strategy. + // + // = DESCRIPTION + // Strategy for implementing points of variation between the + // USER_ID and the SYSTEM_ID policies. public: - TAO_Reverse_Active_Object_Map_For_Multiple_Id_Policy (void); - // Constructor - virtual ~TAO_Reverse_Active_Object_Map_For_Multiple_Id_Policy (void); - // Destructor + virtual ~TAO_Id_Assignment_Strategy (void); + // Virtual destructor. - virtual int bind (PortableServer::Servant servant, - const PortableServer::ObjectId &id); - // Associate <servant> with <id>. + virtual int bind_using_system_id (PortableServer::Servant servant, + TAO_Active_Object_Map::Map_Entry *&entry) = 0; + // Must be used with SYSTEM_ID policy. - virtual int unbind (PortableServer::Servant servant); - // Remote <servant> from table. + virtual void set_active_object_map (TAO_Active_Object_Map *active_object_map); + // Set the active map. - virtual int find (const PortableServer::Servant servant, - PortableServer::ObjectId &id); - // Find <id> of <servant>. +protected: - virtual int find (PortableServer::Servant servant); - // Find <servant> in the table. + TAO_Active_Object_Map *active_object_map_; + // Pointer to the active map. }; -/*******************************************************************/ - -// In the next section we implement a few concrete active object map -// implementations, namely: -// -// TAO_Dynamic_Hash_Active_Object_Map, based on dynamic hashing -// (ACE_Hash_Map_Manager). -// -// TAO_Linear_Active_Object_Map, using linear search and a simple -// dynamically growing array. -// -// TAO_Active_Demux_Active_Object_Map, using also a dynamically -// allocated array, but using active demultiplexing to do the -// lookups. - -/*******************************************************************/ +//////////////////////////////////////////////////////////////////////////////// -class TAO_Export TAO_Dynamic_Hash_Active_Object_Map : public TAO_Active_Object_Map_Impl +class TAO_User_Id_Strategy : public TAO_Id_Assignment_Strategy { // = TITLE - // Lookup strategy based on dynamic hashing. + // User id strategy. // // = DESCRIPTION - // The active object map is implemented using a ACE_Hash_Map_Manager, - // the iterators are implemented using the ACE_Hash_Map_Iterator - // class. + // Strategy for the USER_ID policy. public: - TAO_Dynamic_Hash_Active_Object_Map (CORBA::ULong size); - - virtual ~TAO_Dynamic_Hash_Active_Object_Map (void); - - virtual TAO_Active_Object_Map_Iterator_Impl *begin (void) const; - virtual TAO_Active_Object_Map_Iterator_Impl *end (void) const; - - virtual int find (const PortableServer::Servant servant); - virtual int find (const PortableServer::ObjectId &id); - virtual int find (const PortableServer::Servant servant, - PortableServer::ObjectId &id); - virtual int find (const PortableServer::ObjectId &id, - PortableServer::Servant &servant); - virtual int bind (const PortableServer::ObjectId &id, - PortableServer::Servant servant); - virtual int unbind (const PortableServer::ObjectId &id, - PortableServer::Servant &servant); - virtual PortableServer::ObjectId *create_object_id (PortableServer::Servant servant, - CORBA::Environment &TAO_IN_ENV); - virtual CORBA::ULong system_id_size (void) const; - virtual int is_free (const TAO_Active_Object_Map_Entry &item) const; - - typedef ACE_Hash_Map_Manager_Ex<PortableServer::ObjectId, - PortableServer::Servant, - TAO_ObjectId_Hash, - ACE_Equal_To<PortableServer::ObjectId>, - ACE_Null_Mutex> - Hash_Map; - - typedef Hash_Map::iterator iterator; -protected: - Hash_Map hash_map_; - // Internal hash map. - - CORBA::ULong counter_; - // Internal counter for generating unique ids + virtual int bind_using_system_id (PortableServer::Servant servant, + TAO_Active_Object_Map::Map_Entry *&entry); + // Must be used with SYSTEM_ID policy. }; -class TAO_Export TAO_Dynamic_Hash_Active_Object_Map_Iterator : public TAO_Active_Object_Map_Iterator_Impl +//////////////////////////////////////////////////////////////////////////////// + +class TAO_System_Id_With_Unique_Id_Strategy : public TAO_Id_Assignment_Strategy { // = TITLE - // Iterator for TAO_Dynamic_Hash_Active_Object_Map. + // System id strategy. + // + // = DESCRIPTION + // Strategy for the SYSTEM_ID policy (with UNIQUE_ID policy). public: - typedef TAO_Dynamic_Hash_Active_Object_Map::iterator Impl; - TAO_Dynamic_Hash_Active_Object_Map_Iterator (const Impl &impl); - virtual ~TAO_Dynamic_Hash_Active_Object_Map_Iterator (void); - // default copy ctor and dtor + virtual int bind_using_system_id (PortableServer::Servant servant, + TAO_Active_Object_Map::Map_Entry *&entry); + // Must be used with SYSTEM_ID policy. +}; - // TAO_Active_Object_Map_Impl methods... - virtual TAO_Active_Object_Map_Iterator_Impl *clone (void) const; - virtual const TAO_Active_Object_Map_Entry &item (void) const; - virtual void advance (void); - virtual int done (const TAO_Active_Object_Map_Iterator_Impl *end) const; +//////////////////////////////////////////////////////////////////////////////// -protected: - Impl impl_; +class TAO_System_Id_With_Multiple_Id_Strategy : public TAO_Id_Assignment_Strategy +{ + // = TITLE + // System id strategy. + // + // = DESCRIPTION + // Strategy for the SYSTEM_ID policy (with MULTIPLE_ID policy). +public: - TAO_Active_Object_Map_Entry entry_; + virtual int bind_using_system_id (PortableServer::Servant servant, + TAO_Active_Object_Map::Map_Entry *&entry); + // Must be used with SYSTEM_ID policy. }; -/****************************************************************/ +//////////////////////////////////////////////////////////////////////////////// -class TAO_Export TAO_Array_Active_Object_Map_Iterator : public TAO_Active_Object_Map_Iterator_Impl +class TAO_Id_Hint_Strategy { // = TITLE - // Iterator for TAO_Linear_Active_Object_Map and - // TAO_Active_Demux_Active_Object_Map + // Id uniqueness strategy. + // + // = DESCRIPTION + // Strategy for implementing points of variation between the + // active hint and the no hint policies. public: - TAO_Array_Active_Object_Map_Iterator (TAO_Active_Object_Map_Entry *pos); - virtual ~TAO_Array_Active_Object_Map_Iterator (void); - // default copy ctor and dtor - // TAO_Active_Object_Map_Impl methods... - virtual TAO_Active_Object_Map_Iterator_Impl *clone (void) const; - virtual const TAO_Active_Object_Map_Entry &item (void) const; - virtual void advance (void); - virtual int done (const TAO_Active_Object_Map_Iterator_Impl *end) const; + virtual ~TAO_Id_Hint_Strategy (void); + // Virtual destructor. -protected: - TAO_Active_Object_Map_Entry *pos_; + virtual int recover_key (const PortableServer::ObjectId &system_id, + PortableServer::ObjectId &user_id) = 0; + + virtual int bind (TAO_Active_Object_Map::Map_Entry &entry) = 0; + + virtual int unbind (TAO_Active_Object_Map::Map_Entry &entry) = 0; + + virtual int find (const PortableServer::ObjectId &system_id, + TAO_Active_Object_Map::Map_Entry *&entry) = 0; + + virtual size_t hint_size (void) = 0; + + virtual int system_id (PortableServer::ObjectId_out system_id, + TAO_Active_Object_Map::Map_Entry &entry) = 0; }; -/****************************************************************/ +//////////////////////////////////////////////////////////////////////////////// -class TAO_Export TAO_Linear_Active_Object_Map : public TAO_Active_Object_Map_Impl +class TAO_Active_Hint_Strategy : public TAO_Id_Hint_Strategy { // = TITLE - // Lookup strategy based on a simple linear search. Not - // efficient, but most likely will always work. + // Active hint strategy. // // = DESCRIPTION - // Uses a dynamic array to store the objects and linear search for - // the lookups. + // Strategy for adding active hints to ids. public: - TAO_Linear_Active_Object_Map (CORBA::ULong size); - virtual ~TAO_Linear_Active_Object_Map (void); - - virtual int find (const PortableServer::Servant servant); - virtual int find (const PortableServer::ObjectId &id); - virtual int find (const PortableServer::Servant servant, - PortableServer::ObjectId &id); - virtual int find (const PortableServer::ObjectId &id, - PortableServer::Servant &servant); - virtual int bind (const PortableServer::ObjectId &id, - PortableServer::Servant servant); - virtual int unbind (const PortableServer::ObjectId &id, - PortableServer::Servant &servant); - virtual PortableServer::ObjectId *create_object_id (PortableServer::Servant servant, - CORBA::Environment &TAO_IN_ENV); - virtual CORBA::ULong system_id_size (void) const; - virtual int is_free (const TAO_Active_Object_Map_Entry &item) const; - virtual TAO_Active_Object_Map_Iterator_Impl *begin () const; - virtual TAO_Active_Object_Map_Iterator_Impl *end () const; -protected: + virtual int recover_key (const PortableServer::ObjectId &system_id, + PortableServer::ObjectId &user_id); - enum - { - // Grow map exponentially up to 64K - MAX_EXPONENTIAL = 64 *1024, + virtual int bind (TAO_Active_Object_Map::Map_Entry &entry); - // Afterwards grow in chunks of 32K - LINEAR_INCREASE = 32 * 1024 - }; + virtual int unbind (TAO_Active_Object_Map::Map_Entry &entry); - virtual int resize (void); + virtual int find (const PortableServer::ObjectId &system_id, + TAO_Active_Object_Map::Map_Entry *&entry); - CORBA::ULong next_; - CORBA::ULong mapsize_; - TAO_Active_Object_Map_Entry *map_; - PortableServer::ObjectId empty_id_; - CORBA::ULong counter_; + virtual size_t hint_size (void); + + virtual int system_id (PortableServer::ObjectId_out system_id, + TAO_Active_Object_Map::Map_Entry &entry); + + typedef ACE_Active_Map_Manager_Adapter< + PortableServer::ObjectId, + TAO_Active_Object_Map::Map_Entry *, + TAO_Preserve_Original_Key_Adapter> system_id_map; + + system_id_map system_id_map_; }; -/****************************************************************/ +//////////////////////////////////////////////////////////////////////////////// -class TAO_Export TAO_Active_Demux_Active_Object_Map : public TAO_Linear_Active_Object_Map +class TAO_No_Hint_Strategy : public TAO_Id_Hint_Strategy { // = TITLE - // An active object map lookup strategy based on active - // demultiplexing strategy. + // No hint strategy. // // = DESCRIPTION - // Use the linear active object map as the base; keys must be the - // string representation of the indices into the array and a - // generation count, so lookups can be done in O(1). - // - // Iterators are implemented using pointers on the array. + // Strategy for not adding active hints to ids. public: - TAO_Active_Demux_Active_Object_Map (CORBA::ULong size); - // Constructor, including an initial size. - - virtual ~TAO_Active_Demux_Active_Object_Map (void); - // Destructor - - // Implement TAO_Dynamic_Hash_Active_Object_Map.... - virtual int find (const PortableServer::Servant servant); - virtual int find (const PortableServer::ObjectId &id); - virtual int find (const PortableServer::Servant servant, - PortableServer::ObjectId &id); - virtual int find (const PortableServer::ObjectId &id, - PortableServer::Servant &servant); - virtual int bind (const PortableServer::ObjectId &id, - PortableServer::Servant servant); - virtual int unbind (const PortableServer::ObjectId &id, - PortableServer::Servant &servant); - virtual CORBA::ULong system_id_size (void) const; - virtual PortableServer::ObjectId *create_object_id (PortableServer::Servant servant, - CORBA::Environment &TAO_IN_ENV); -protected: - enum - { - INDEX_FIELD = 0, - GENERATION_FIELD = 1 - }; + virtual int recover_key (const PortableServer::ObjectId &system_id, + PortableServer::ObjectId &user_id); + + virtual int bind (TAO_Active_Object_Map::Map_Entry &entry); - virtual CORBA::ULong next_free (void); + virtual int unbind (TAO_Active_Object_Map::Map_Entry &entry); - virtual int parse_object_id (const PortableServer::ObjectId &id, - CORBA::ULong &index, - CORBA::ULong &generation); + virtual int find (const PortableServer::ObjectId &system_id, + TAO_Active_Object_Map::Map_Entry *&entry); + + virtual size_t hint_size (void); + + virtual int system_id (PortableServer::ObjectId_out system_id, + TAO_Active_Object_Map::Map_Entry &entry); }; +//////////////////////////////////////////////////////////////////////////////// + #if defined (__ACE_INLINE__) # include "tao/Active_Object_Map.i" -#endif /* ! __ACE_INLINE__ */ +#endif /* __ACE_INLINE__ */ -#endif /* TAO_ACTIVE_OBJECT_MAP_H */ +#endif /* TAO_ACTIVE_OBJECT_MAP_T_H */ diff --git a/TAO/tao/Active_Object_Map.i b/TAO/tao/Active_Object_Map.i index 73b5edd8f60..cfa1da318d3 100644 --- a/TAO/tao/Active_Object_Map.i +++ b/TAO/tao/Active_Object_Map.i @@ -1,601 +1 @@ // $Id$ - -ACE_INLINE -TAO_Active_Object_Map_Entry::TAO_Active_Object_Map_Entry (void) - : id_ (), - generation_ (0), - servant_ (0), - is_free_ (1) -{ -} - -ACE_INLINE -TAO_Active_Object_Map_Iterator_Impl::~TAO_Active_Object_Map_Iterator_Impl (void) -{ -} - -ACE_INLINE -TAO_Active_Object_Map_Impl::~TAO_Active_Object_Map_Impl (void) -{ -} - -ACE_INLINE int -TAO_Active_Object_Map_Impl::find (const PortableServer::ObjectId &id) -{ - PortableServer::Servant servant; - return this->find (id, servant); -} - -ACE_INLINE int -TAO_Active_Object_Map_Impl::find (const PortableServer::Servant servant) -{ - PortableServer::ObjectId id; - return this->find (servant, id); -} - -ACE_INLINE -TAO_Dynamic_Hash_Active_Object_Map::TAO_Dynamic_Hash_Active_Object_Map (CORBA::ULong size) - : hash_map_ (size), - counter_ (0) -{ -} - -ACE_INLINE int -TAO_Dynamic_Hash_Active_Object_Map::find (const PortableServer::ObjectId &id, - PortableServer::Servant &servant) -{ - return this->hash_map_.find (id, servant); -} - -ACE_INLINE int -TAO_Dynamic_Hash_Active_Object_Map::bind (const PortableServer::ObjectId &id, - PortableServer::Servant servant) -{ - return this->hash_map_.bind (id, servant); -} - -ACE_INLINE int -TAO_Dynamic_Hash_Active_Object_Map::unbind (const PortableServer::ObjectId &id, - PortableServer::Servant &servant) -{ - return this->hash_map_.unbind (id, servant); -} - -ACE_INLINE int -TAO_Dynamic_Hash_Active_Object_Map::find (const PortableServer::Servant servant) -{ - return this->TAO_Active_Object_Map_Impl::find (servant); -} - -ACE_INLINE int -TAO_Dynamic_Hash_Active_Object_Map::find (const PortableServer::ObjectId &id) -{ - return this->TAO_Active_Object_Map_Impl::find (id); -} - -ACE_INLINE int -TAO_Dynamic_Hash_Active_Object_Map::find (const PortableServer::Servant servant, - PortableServer::ObjectId &id) -{ - return this->TAO_Active_Object_Map_Impl::find (servant, id); -} - -ACE_INLINE CORBA::ULong -TAO_Dynamic_Hash_Active_Object_Map::system_id_size (void) const -{ - return sizeof (CORBA::ULong); -} - -ACE_INLINE int -TAO_Dynamic_Hash_Active_Object_Map::is_free (const TAO_Active_Object_Map_Entry &item) const -{ - ACE_UNUSED_ARG (item); - return 0; -} - -ACE_INLINE -TAO_Dynamic_Hash_Active_Object_Map_Iterator::TAO_Dynamic_Hash_Active_Object_Map_Iterator (const Impl &impl) - : impl_ (impl) -{ -} - -ACE_INLINE TAO_Active_Object_Map_Iterator_Impl * -TAO_Dynamic_Hash_Active_Object_Map::begin (void) const -{ - TAO_Dynamic_Hash_Active_Object_Map *non_const = - ACE_const_cast (TAO_Dynamic_Hash_Active_Object_Map *, - this); - - TAO_Active_Object_Map_Iterator_Impl *tmp; - ACE_NEW_RETURN (tmp, - TAO_Dynamic_Hash_Active_Object_Map_Iterator (iterator (non_const->hash_map_)), - 0); - return tmp; -} - -ACE_INLINE TAO_Active_Object_Map_Iterator_Impl * -TAO_Dynamic_Hash_Active_Object_Map::end (void) const -{ - return 0; -} - -ACE_INLINE TAO_Active_Object_Map_Iterator_Impl* -TAO_Dynamic_Hash_Active_Object_Map_Iterator::clone (void) const -{ - TAO_Active_Object_Map_Iterator_Impl *tmp; - ACE_NEW_RETURN (tmp, - TAO_Dynamic_Hash_Active_Object_Map_Iterator (*this), - 0); - return tmp; -} - -ACE_INLINE const TAO_Active_Object_Map_Entry & -TAO_Dynamic_Hash_Active_Object_Map_Iterator::item (void) const -{ - TAO_Active_Object_Map_Entry &entry = - ACE_const_cast (TAO_Active_Object_Map_Entry &, - this->entry_); - ACE_Hash_Map_Entry<PortableServer::ObjectId, PortableServer::Servant> *tmp; - - if (ACE_const_cast (TAO_Dynamic_Hash_Active_Object_Map_Iterator*, - this)->impl_.next (tmp) == 1) - { - entry.servant_ = tmp->int_id_; - entry.id_ = tmp->ext_id_; - } - - return entry; -} - -ACE_INLINE void -TAO_Dynamic_Hash_Active_Object_Map_Iterator::advance (void) -{ - this->impl_.advance (); -} - -ACE_INLINE int -TAO_Dynamic_Hash_Active_Object_Map_Iterator::done (const TAO_Active_Object_Map_Iterator_Impl *) const -{ - return this->impl_.done (); -} - -ACE_INLINE -TAO_Array_Active_Object_Map_Iterator::TAO_Array_Active_Object_Map_Iterator (TAO_Active_Object_Map_Entry *pos) - : pos_ (pos) -{ -} - -ACE_INLINE TAO_Active_Object_Map_Iterator_Impl * -TAO_Array_Active_Object_Map_Iterator::clone (void) const -{ - TAO_Active_Object_Map_Iterator_Impl *tmp; - ACE_NEW_RETURN (tmp, - TAO_Array_Active_Object_Map_Iterator (*this), - 0); - return tmp; -} - -ACE_INLINE const TAO_Active_Object_Map_Entry & -TAO_Array_Active_Object_Map_Iterator::item (void) const -{ - return *this->pos_; -} - -ACE_INLINE void -TAO_Array_Active_Object_Map_Iterator::advance (void) -{ - ++this->pos_; -} - -ACE_INLINE int -TAO_Array_Active_Object_Map_Iterator::done (const TAO_Active_Object_Map_Iterator_Impl *end) const -{ - const TAO_Array_Active_Object_Map_Iterator *tmp = - ACE_dynamic_cast (const TAO_Array_Active_Object_Map_Iterator*, end); - return this->pos_ == tmp->pos_; -} - -ACE_INLINE -TAO_Linear_Active_Object_Map::TAO_Linear_Active_Object_Map (CORBA::ULong size) - : next_ (0), - mapsize_ (size), - counter_ (0) -{ - ACE_NEW (map_, - TAO_Active_Object_Map_Entry[this->mapsize_]); -} - -ACE_INLINE -TAO_Linear_Active_Object_Map::~TAO_Linear_Active_Object_Map (void) -{ - delete [] this->map_; -} - -ACE_INLINE int -TAO_Linear_Active_Object_Map::find (const PortableServer::Servant servant) -{ - return this->TAO_Active_Object_Map_Impl::find (servant); -} - -ACE_INLINE int -TAO_Linear_Active_Object_Map::find (const PortableServer::ObjectId &id) -{ - return this->TAO_Active_Object_Map_Impl::find (id); -} - -ACE_INLINE int -TAO_Linear_Active_Object_Map::find (const PortableServer::Servant servant, - PortableServer::ObjectId &id) -{ - return this->TAO_Active_Object_Map_Impl::find (servant, id); -} - -ACE_INLINE CORBA::ULong -TAO_Linear_Active_Object_Map::system_id_size (void) const -{ - return sizeof (CORBA::ULong); -} - -ACE_INLINE int -TAO_Linear_Active_Object_Map::is_free (const TAO_Active_Object_Map_Entry &item) const -{ - return item.is_free_; -} - -ACE_INLINE TAO_Active_Object_Map_Iterator_Impl * -TAO_Linear_Active_Object_Map::begin (void) const -{ - TAO_Active_Object_Map_Iterator_Impl *tmp; - ACE_NEW_RETURN (tmp, - TAO_Array_Active_Object_Map_Iterator (this->map_), - 0); - return tmp; -} - -ACE_INLINE TAO_Active_Object_Map_Iterator_Impl * -TAO_Linear_Active_Object_Map::end (void) const -{ - TAO_Active_Object_Map_Iterator_Impl *tmp; - ACE_NEW_RETURN (tmp, - TAO_Array_Active_Object_Map_Iterator (this->map_ + this->next_), - 0); - return tmp; -} - -ACE_INLINE -TAO_Active_Demux_Active_Object_Map::TAO_Active_Demux_Active_Object_Map (CORBA::ULong size) - : TAO_Linear_Active_Object_Map (size) -{ -} - -ACE_INLINE -TAO_Active_Demux_Active_Object_Map::~TAO_Active_Demux_Active_Object_Map (void) -{ -} - -ACE_INLINE int -TAO_Active_Demux_Active_Object_Map::find (const PortableServer::Servant servant) -{ - return this->TAO_Active_Object_Map_Impl::find (servant); -} - -ACE_INLINE int -TAO_Active_Demux_Active_Object_Map::find (const PortableServer::ObjectId &id) -{ - return this->TAO_Active_Object_Map_Impl::find (id); -} - -ACE_INLINE int -TAO_Active_Demux_Active_Object_Map::find (const PortableServer::Servant servant, - PortableServer::ObjectId &id) -{ - return this->TAO_Active_Object_Map_Impl::find (servant, id); -} - -ACE_INLINE int -TAO_Active_Demux_Active_Object_Map::parse_object_id (const PortableServer::ObjectId &id, - CORBA::ULong &index, - CORBA::ULong &generation) -{ - CORBA::ULong id_data[2]; - - ACE_OS::memcpy (&id_data, - id.get_buffer (), - sizeof id_data); - - index = - id_data[TAO_Active_Demux_Active_Object_Map::INDEX_FIELD]; - generation = - id_data[TAO_Active_Demux_Active_Object_Map::GENERATION_FIELD]; - - return 0; -} - -ACE_INLINE CORBA::ULong -TAO_Active_Demux_Active_Object_Map::system_id_size (void) const -{ - return 2 * sizeof (CORBA::ULong); -} - -ACE_INLINE -TAO_Dynamic_Hash_Active_Object_Map::~TAO_Dynamic_Hash_Active_Object_Map (void) -{ -} - -ACE_INLINE -TAO_Dynamic_Hash_Active_Object_Map_Iterator::~TAO_Dynamic_Hash_Active_Object_Map_Iterator (void) -{ -} - -ACE_INLINE -TAO_Array_Active_Object_Map_Iterator::~TAO_Array_Active_Object_Map_Iterator (void) -{ -} - -ACE_INLINE -TAO_Reverse_Active_Object_Map_Impl::TAO_Reverse_Active_Object_Map_Impl (void) -{ -} - -ACE_INLINE -TAO_Reverse_Active_Object_Map_Impl::~TAO_Reverse_Active_Object_Map_Impl (void) -{ -} - -ACE_INLINE -TAO_Reverse_Active_Object_Map_For_Unique_Id_Policy::TAO_Reverse_Active_Object_Map_For_Unique_Id_Policy (size_t size) - : map_ (size) -{ -} - -ACE_INLINE -TAO_Reverse_Active_Object_Map_For_Unique_Id_Policy::~TAO_Reverse_Active_Object_Map_For_Unique_Id_Policy (void) -{ -} - -ACE_INLINE int -TAO_Reverse_Active_Object_Map_For_Unique_Id_Policy::bind (PortableServer::Servant servant, - const PortableServer::ObjectId &id) -{ - return this->map_.bind (servant, id); -} - -ACE_INLINE int -TAO_Reverse_Active_Object_Map_For_Unique_Id_Policy::unbind (PortableServer::Servant servant) -{ - return this->map_.unbind (servant); -} - -ACE_INLINE int -TAO_Reverse_Active_Object_Map_For_Unique_Id_Policy::find (const PortableServer::Servant servant, - PortableServer::ObjectId &id) -{ - return this->map_.find (servant, id); -} - -ACE_INLINE int -TAO_Reverse_Active_Object_Map_For_Unique_Id_Policy::find (PortableServer::Servant servant) -{ - return this->map_.find (servant); -} - -ACE_INLINE -TAO_Reverse_Active_Object_Map_For_Multiple_Id_Policy::TAO_Reverse_Active_Object_Map_For_Multiple_Id_Policy (void) -{ -} - -ACE_INLINE -TAO_Reverse_Active_Object_Map_For_Multiple_Id_Policy::~TAO_Reverse_Active_Object_Map_For_Multiple_Id_Policy (void) -{ -} - -ACE_INLINE int -TAO_Reverse_Active_Object_Map_For_Multiple_Id_Policy::bind (PortableServer::Servant servant, - const PortableServer::ObjectId &id) -{ - ACE_UNUSED_ARG (servant); - ACE_UNUSED_ARG (id); - - // Successful no-op - return 0; -} - -ACE_INLINE int -TAO_Reverse_Active_Object_Map_For_Multiple_Id_Policy::unbind (PortableServer::Servant servant) -{ - ACE_UNUSED_ARG (servant); - - // Successful no-op - return 0; -} - -ACE_INLINE int -TAO_Reverse_Active_Object_Map_For_Multiple_Id_Policy::find (const PortableServer::Servant servant, - PortableServer::ObjectId &id) -{ - ACE_UNUSED_ARG (servant); - ACE_UNUSED_ARG (id); - - // Unsuccessful no-op - return -1; -} - -ACE_INLINE int -TAO_Reverse_Active_Object_Map_For_Multiple_Id_Policy::find (PortableServer::Servant servant) -{ - ACE_UNUSED_ARG (servant); - - // Unsuccessful no-op - return -1; -} - -ACE_INLINE -TAO_Active_Object_Map_Iterator::TAO_Active_Object_Map_Iterator (TAO_Active_Object_Map_Iterator_Impl *impl) - : impl_ (impl) -{ -} - -ACE_INLINE -TAO_Active_Object_Map_Iterator::TAO_Active_Object_Map_Iterator (const TAO_Active_Object_Map_Iterator &x) - : impl_ (0) -{ - if (x.impl_ != 0) - this->impl_ = x.impl_->clone (); -} - -ACE_INLINE TAO_Active_Object_Map_Iterator & -TAO_Active_Object_Map_Iterator::operator= (const TAO_Active_Object_Map_Iterator &x) -{ - if (this != &x) - { - delete this->impl_; - if (x.impl_ == 0) - this->impl_ = 0; - else - this->impl_ = x.impl_->clone (); - } - return *this; -} - -ACE_INLINE -TAO_Active_Object_Map_Iterator::~TAO_Active_Object_Map_Iterator (void) -{ - delete this->impl_; -} - -ACE_INLINE const TAO_Active_Object_Map_Entry & -TAO_Active_Object_Map_Iterator::operator *(void) const -{ - return this->impl_->item (); -} - -ACE_INLINE TAO_Active_Object_Map_Iterator -TAO_Active_Object_Map_Iterator::operator++ (void) -{ - TAO_Active_Object_Map_Iterator tmp = *this; - this->impl_->advance (); - return tmp; -} - -ACE_INLINE TAO_Active_Object_Map_Iterator -TAO_Active_Object_Map_Iterator::operator++ (int) -{ - this->impl_->advance (); - return *this; -} - -ACE_INLINE int -operator== (const TAO_Active_Object_Map_Iterator &l, - const TAO_Active_Object_Map_Iterator &r) -{ - return l.impl_->done (r.impl_); -} - -ACE_INLINE int -operator!= (const TAO_Active_Object_Map_Iterator &l, - const TAO_Active_Object_Map_Iterator &r) -{ - return !(l == r); -} - -ACE_INLINE -TAO_Active_Object_Map::~TAO_Active_Object_Map (void) -{ - delete this->impl_; - delete this->reverse_impl_; -} - -ACE_INLINE int -TAO_Active_Object_Map::bind (const PortableServer::ObjectId &id, - PortableServer::Servant servant) -{ - int result = this->impl_->bind (id, servant); - if (result != 0) - { - return result; - } - - result = this->reverse_impl_->bind (servant, id); - if (result != 0) - { - this->impl_->unbind (id, servant); - } - - return result; -} - -ACE_INLINE int -TAO_Active_Object_Map::unbind (const PortableServer::ObjectId &id, - PortableServer::Servant &servant) -{ - int result = this->impl_->unbind (id, servant); - if (result != 0) - return result; - - return this->reverse_impl_->unbind (servant); -} - -ACE_INLINE int -TAO_Active_Object_Map::find (const PortableServer::ObjectId &id, - PortableServer::Servant &servant) -{ - return this->impl_->find (id, servant); -} - -ACE_INLINE int -TAO_Active_Object_Map::find (const PortableServer::ObjectId &id) -{ - return this->impl_->find (id); -} - -ACE_INLINE int -TAO_Active_Object_Map::find (const PortableServer::Servant servant) -{ - if (this->unique_id_policy_) - { - return this->reverse_impl_->find (servant); - } - else - { - return this->impl_->find (servant); - } -} - -ACE_INLINE int -TAO_Active_Object_Map::find (const PortableServer::Servant servant, - PortableServer::ObjectId &id) -{ - if (this->unique_id_policy_) - { - return this->reverse_impl_->find (servant, id); - } - else - { - return this->impl_->find (servant, id); - } -} - -ACE_INLINE TAO_Active_Object_Map::iterator -TAO_Active_Object_Map::begin (void) const -{ - return TAO_Active_Object_Map::iterator (this->impl_->begin ()); -} - -ACE_INLINE TAO_Active_Object_Map::iterator -TAO_Active_Object_Map::end (void) const -{ - return TAO_Active_Object_Map::iterator (this->impl_->end ()); -} - -ACE_INLINE PortableServer::ObjectId * -TAO_Active_Object_Map::create_object_id (PortableServer::Servant servant, - CORBA::Environment &TAO_IN_ENV) -{ - return this->impl_->create_object_id (servant, TAO_IN_ENV); -} - -ACE_INLINE CORBA::ULong -TAO_Active_Object_Map::system_id_size (void) const -{ - return this->impl_->system_id_size (); -} diff --git a/TAO/tao/Connect.cpp b/TAO/tao/Connect.cpp index bd5f6566117..c170c1f4b7e 100644 --- a/TAO/tao/Connect.cpp +++ b/TAO/tao/Connect.cpp @@ -7,6 +7,7 @@ #include "tao/GIOP.h" #include "tao/Server_Request.h" #include "tao/ORB_Core.h" +#include "tao/CDR.h" #if !defined (__ACE_INLINE__) # include "tao/Connect.i" diff --git a/TAO/tao/CurrentS.cpp b/TAO/tao/CurrentS.cpp index f2daf95fdb5..2b46102aded 100644 --- a/TAO/tao/CurrentS.cpp +++ b/TAO/tao/CurrentS.cpp @@ -11,6 +11,8 @@ #include "tao/Operation_Table.h" #include "tao/POA_CORBA.h" #include "tao/Server_Request.h" +#include "tao/Environment.h" +#include "tao/Typecode.h" ACE_RCSID(tao, CurrentS, "$Id$") diff --git a/TAO/tao/DynAnyC.cpp b/TAO/tao/DynAnyC.cpp index 95c82aa53d3..7f565c8aac6 100644 --- a/TAO/tao/DynAnyC.cpp +++ b/TAO/tao/DynAnyC.cpp @@ -23,6 +23,9 @@ // ====================================================================== #include "tao/DynAnyC.h" + +#if !defined (TAO_HAS_MINIMUM_CORBA) + #include "tao/Stub.h" #include "tao/Servant_Base.h" #include "tao/varout.h" @@ -1527,3 +1530,4 @@ CORBA::TypeCode_ptr _tc_CORBA_DynArray = # pragma instantiate TAO_Object_Field_T<CORBA_DynArray> #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ +#endif /* TAO_HAS_MINIMUM_CORBA */ diff --git a/TAO/tao/DynAnyC.h b/TAO/tao/DynAnyC.h index adbf0860674..a9e9e0baa88 100644 --- a/TAO/tao/DynAnyC.h +++ b/TAO/tao/DynAnyC.h @@ -25,6 +25,10 @@ #ifndef TAO_IDL_CORBA_DYNANYC_H_ #define TAO_IDL_CORBA_DYNANYC_H_ +#include "tao/orbconf.h" + +#if !defined (TAO_HAS_MINIMUM_CORBA) + #include "tao/corbafwd.h" #include "tao/Any.h" #include "tao/ORB.h" @@ -1744,4 +1748,6 @@ extern CORBA::TypeCode_ptr _tc_CORBA_DynArray; #pragma warning(default:4250) #endif /* _MSC_VER */ +#endif /* TAO_HAS_MINIMUM_CORBA */ + #endif /* if !defined */ diff --git a/TAO/tao/DynAnyS.cpp b/TAO/tao/DynAnyS.cpp index c65c7f56229..5684075d2d1 100644 --- a/TAO/tao/DynAnyS.cpp +++ b/TAO/tao/DynAnyS.cpp @@ -23,6 +23,9 @@ // ====================================================================== #include "tao/DynAnyC.h" + +#if !defined (TAO_HAS_MINIMUM_CORBA) + #include "tao/POA_CORBA.h" #include "tao/Servant_Base.h" #include "tao/POAC.h" @@ -41,40 +44,40 @@ POA_CORBA::DynAny::~DynAny (void) { } -CORBA::Boolean +CORBA::Boolean POA_CORBA::DynAny::_is_a (const char* value, CORBA::Environment &_tao_environment) { - if ((!ACE_OS::strcmp ((char *) value, - "IDL:/CORBA_DynAny:1.0")) - || (!ACE_OS::strcmp ((char *) value, + if ((!ACE_OS::strcmp ((char *) value, + "IDL:/CORBA_DynAny:1.0")) + || (!ACE_OS::strcmp ((char *) value, CORBA::_tc_Object->id (_tao_environment)))) return 1; else return 0; } -void* +void* POA_CORBA::DynAny::_downcast (const char* logical_type_id) { - if (ACE_OS::strcmp (logical_type_id, + if (ACE_OS::strcmp (logical_type_id, "IDL:/CORBA_DynAny:1.0") == 0) return ACE_static_cast (POA_CORBA::DynAny_ptr, this); - if (ACE_OS::strcmp (logical_type_id, + if (ACE_OS::strcmp (logical_type_id, "IDL:omg.org/CORBA/Object:1.0") == 0) return ACE_static_cast(PortableServer::Servant, this); return 0; } -void POA_CORBA::DynAny::_dispatch (CORBA::ServerRequest &, - void *, +void POA_CORBA::DynAny::_dispatch (CORBA::ServerRequest &, + void *, CORBA::Environment &) { } -const char* +const char* POA_CORBA::DynAny::_interface_repository_id (void) const { return "IDL:/CORBA_DynAny:1.0"; @@ -85,20 +88,20 @@ POA_CORBA::_tao_collocated_DynAny::_tao_collocated_DynAny ( STUB_Object *stub ) : CORBA_DynAny (), - CORBA_Object (stub, - servant, + CORBA_Object (stub, + servant, 1), servant_ (servant) { } -POA_CORBA::DynAny_ptr +POA_CORBA::DynAny_ptr POA_CORBA::_tao_collocated_DynAny::_get_servant (void) const { return this->servant_; } -CORBA::Boolean +CORBA::Boolean POA_CORBA::_tao_collocated_DynAny::_is_a ( const char* logical_type_id, CORBA::Environment &_tao_environment @@ -110,7 +113,7 @@ POA_CORBA::_tao_collocated_DynAny::_is_a ( ); } -CORBA::TypeCode_ptr +CORBA::TypeCode_ptr POA_CORBA::_tao_collocated_DynAny::type ( CORBA::Environment &_tao_environment ) @@ -120,7 +123,7 @@ POA_CORBA::_tao_collocated_DynAny::type ( ); } -void +void POA_CORBA::_tao_collocated_DynAny::assign ( CORBA_DynAny_ptr CORBA_Dyn_any, CORBA::Environment &_tao_environment @@ -132,7 +135,7 @@ POA_CORBA::_tao_collocated_DynAny::assign ( ); } -void +void POA_CORBA::_tao_collocated_DynAny::from_any ( const CORBA::Any & value, CORBA::Environment &_tao_environment @@ -144,7 +147,7 @@ POA_CORBA::_tao_collocated_DynAny::from_any ( ); } -CORBA::Any * +CORBA::Any * POA_CORBA::_tao_collocated_DynAny::to_any ( CORBA::Environment &_tao_environment ) @@ -154,7 +157,7 @@ POA_CORBA::_tao_collocated_DynAny::to_any ( ); } -void +void POA_CORBA::_tao_collocated_DynAny::destroy ( CORBA::Environment &_tao_environment ) @@ -164,7 +167,7 @@ POA_CORBA::_tao_collocated_DynAny::destroy ( ); } -CORBA_DynAny_ptr +CORBA_DynAny_ptr POA_CORBA::_tao_collocated_DynAny::copy ( CORBA::Environment &_tao_environment ) @@ -174,7 +177,7 @@ POA_CORBA::_tao_collocated_DynAny::copy ( ); } -void +void POA_CORBA::_tao_collocated_DynAny::insert_boolean ( CORBA::Boolean value, CORBA::Environment &_tao_environment @@ -186,7 +189,7 @@ POA_CORBA::_tao_collocated_DynAny::insert_boolean ( ); } -void +void POA_CORBA::_tao_collocated_DynAny::insert_octet ( CORBA::Octet value, CORBA::Environment &_tao_environment @@ -198,7 +201,7 @@ POA_CORBA::_tao_collocated_DynAny::insert_octet ( ); } -void +void POA_CORBA::_tao_collocated_DynAny::insert_char ( CORBA::Char value, CORBA::Environment &_tao_environment @@ -210,7 +213,7 @@ POA_CORBA::_tao_collocated_DynAny::insert_char ( ); } -void +void POA_CORBA::_tao_collocated_DynAny::insert_short ( CORBA::Short value, CORBA::Environment &_tao_environment @@ -222,7 +225,7 @@ POA_CORBA::_tao_collocated_DynAny::insert_short ( ); } -void +void POA_CORBA::_tao_collocated_DynAny::insert_ushort ( CORBA::UShort value, CORBA::Environment &_tao_environment @@ -234,7 +237,7 @@ POA_CORBA::_tao_collocated_DynAny::insert_ushort ( ); } -void +void POA_CORBA::_tao_collocated_DynAny::insert_long ( CORBA::Long value, CORBA::Environment &_tao_environment @@ -246,7 +249,7 @@ POA_CORBA::_tao_collocated_DynAny::insert_long ( ); } -void +void POA_CORBA::_tao_collocated_DynAny::insert_ulong ( CORBA::ULong value, CORBA::Environment &_tao_environment @@ -258,7 +261,7 @@ POA_CORBA::_tao_collocated_DynAny::insert_ulong ( ); } -void +void POA_CORBA::_tao_collocated_DynAny::insert_float ( CORBA::Float value, CORBA::Environment &_tao_environment @@ -270,7 +273,7 @@ POA_CORBA::_tao_collocated_DynAny::insert_float ( ); } -void +void POA_CORBA::_tao_collocated_DynAny::insert_double ( CORBA::Double value, CORBA::Environment &_tao_environment @@ -282,7 +285,7 @@ POA_CORBA::_tao_collocated_DynAny::insert_double ( ); } -void +void POA_CORBA::_tao_collocated_DynAny::insert_string ( const char * value, CORBA::Environment &_tao_environment @@ -294,7 +297,7 @@ POA_CORBA::_tao_collocated_DynAny::insert_string ( ); } -void +void POA_CORBA::_tao_collocated_DynAny::insert_reference ( CORBA::Object_ptr value, CORBA::Environment &_tao_environment @@ -306,7 +309,7 @@ POA_CORBA::_tao_collocated_DynAny::insert_reference ( ); } -void +void POA_CORBA::_tao_collocated_DynAny::insert_typecode ( CORBA::TypeCode_ptr value, CORBA::Environment &_tao_environment @@ -318,7 +321,7 @@ POA_CORBA::_tao_collocated_DynAny::insert_typecode ( ); } -void +void POA_CORBA::_tao_collocated_DynAny::insert_longlong ( CORBA::LongLong value, CORBA::Environment &_tao_environment @@ -330,7 +333,7 @@ POA_CORBA::_tao_collocated_DynAny::insert_longlong ( ); } -void +void POA_CORBA::_tao_collocated_DynAny::insert_ulonglong ( CORBA::ULongLong value, CORBA::Environment &_tao_environment @@ -342,7 +345,7 @@ POA_CORBA::_tao_collocated_DynAny::insert_ulonglong ( ); } -void +void POA_CORBA::_tao_collocated_DynAny::insert_wchar ( CORBA::WChar value, CORBA::Environment &_tao_environment @@ -354,7 +357,7 @@ POA_CORBA::_tao_collocated_DynAny::insert_wchar ( ); } -void +void POA_CORBA::_tao_collocated_DynAny::insert_any ( const CORBA::Any & value, CORBA::Environment &_tao_environment @@ -366,7 +369,7 @@ POA_CORBA::_tao_collocated_DynAny::insert_any ( ); } -CORBA::Boolean +CORBA::Boolean POA_CORBA::_tao_collocated_DynAny::get_boolean ( CORBA::Environment &_tao_environment ) @@ -376,7 +379,7 @@ POA_CORBA::_tao_collocated_DynAny::get_boolean ( ); } -CORBA::Octet +CORBA::Octet POA_CORBA::_tao_collocated_DynAny::get_octet ( CORBA::Environment &_tao_environment ) @@ -386,7 +389,7 @@ POA_CORBA::_tao_collocated_DynAny::get_octet ( ); } -CORBA::Char +CORBA::Char POA_CORBA::_tao_collocated_DynAny::get_char ( CORBA::Environment &_tao_environment ) @@ -396,7 +399,7 @@ POA_CORBA::_tao_collocated_DynAny::get_char ( ); } -CORBA::Short +CORBA::Short POA_CORBA::_tao_collocated_DynAny::get_short ( CORBA::Environment &_tao_environment ) @@ -406,7 +409,7 @@ POA_CORBA::_tao_collocated_DynAny::get_short ( ); } -CORBA::UShort +CORBA::UShort POA_CORBA::_tao_collocated_DynAny::get_ushort ( CORBA::Environment &_tao_environment ) @@ -416,7 +419,7 @@ POA_CORBA::_tao_collocated_DynAny::get_ushort ( ); } -CORBA::Long +CORBA::Long POA_CORBA::_tao_collocated_DynAny::get_long ( CORBA::Environment &_tao_environment ) @@ -426,7 +429,7 @@ POA_CORBA::_tao_collocated_DynAny::get_long ( ); } -CORBA::ULong +CORBA::ULong POA_CORBA::_tao_collocated_DynAny::get_ulong ( CORBA::Environment &_tao_environment ) @@ -436,7 +439,7 @@ POA_CORBA::_tao_collocated_DynAny::get_ulong ( ); } -CORBA::Float +CORBA::Float POA_CORBA::_tao_collocated_DynAny::get_float ( CORBA::Environment &_tao_environment ) @@ -446,7 +449,7 @@ POA_CORBA::_tao_collocated_DynAny::get_float ( ); } -CORBA::Double +CORBA::Double POA_CORBA::_tao_collocated_DynAny::get_double ( CORBA::Environment &_tao_environment ) @@ -456,7 +459,7 @@ POA_CORBA::_tao_collocated_DynAny::get_double ( ); } -char * +char * POA_CORBA::_tao_collocated_DynAny::get_string ( CORBA::Environment &_tao_environment ) @@ -466,7 +469,7 @@ POA_CORBA::_tao_collocated_DynAny::get_string ( ); } -CORBA::Object_ptr +CORBA::Object_ptr POA_CORBA::_tao_collocated_DynAny::get_reference ( CORBA::Environment &_tao_environment ) @@ -476,7 +479,7 @@ POA_CORBA::_tao_collocated_DynAny::get_reference ( ); } -CORBA::TypeCode_ptr +CORBA::TypeCode_ptr POA_CORBA::_tao_collocated_DynAny::get_typecode ( CORBA::Environment &_tao_environment ) @@ -486,7 +489,7 @@ POA_CORBA::_tao_collocated_DynAny::get_typecode ( ); } -CORBA::LongLong +CORBA::LongLong POA_CORBA::_tao_collocated_DynAny::get_longlong ( CORBA::Environment &_tao_environment ) @@ -496,7 +499,7 @@ POA_CORBA::_tao_collocated_DynAny::get_longlong ( ); } -CORBA::ULongLong +CORBA::ULongLong POA_CORBA::_tao_collocated_DynAny::get_ulonglong ( CORBA::Environment &_tao_environment ) @@ -506,7 +509,7 @@ POA_CORBA::_tao_collocated_DynAny::get_ulonglong ( ); } -CORBA::WChar +CORBA::WChar POA_CORBA::_tao_collocated_DynAny::get_wchar ( CORBA::Environment &_tao_environment ) @@ -516,7 +519,7 @@ POA_CORBA::_tao_collocated_DynAny::get_wchar ( ); } -CORBA::Any * +CORBA::Any * POA_CORBA::_tao_collocated_DynAny::get_any ( CORBA::Environment &_tao_environment ) @@ -526,7 +529,7 @@ POA_CORBA::_tao_collocated_DynAny::get_any ( ); } -CORBA_DynAny_ptr +CORBA_DynAny_ptr POA_CORBA::_tao_collocated_DynAny::current_component ( CORBA::Environment &_tao_environment ) @@ -536,7 +539,7 @@ POA_CORBA::_tao_collocated_DynAny::current_component ( ); } -CORBA::Boolean +CORBA::Boolean POA_CORBA::_tao_collocated_DynAny::next ( CORBA::Environment &_tao_environment ) @@ -546,7 +549,7 @@ POA_CORBA::_tao_collocated_DynAny::next ( ); } -CORBA::Boolean +CORBA::Boolean POA_CORBA::_tao_collocated_DynAny::seek ( CORBA::Long index, CORBA::Environment &_tao_environment @@ -558,7 +561,7 @@ POA_CORBA::_tao_collocated_DynAny::seek ( ); } -void +void POA_CORBA::_tao_collocated_DynAny::rewind ( CORBA::Environment &_tao_environment ) @@ -595,16 +598,16 @@ POA_CORBA::DynEnum::~DynEnum (void) { } -CORBA::Boolean +CORBA::Boolean POA_CORBA::DynEnum::_is_a ( const char* value, CORBA::Environment &_tao_environment ) { - if ((!ACE_OS::strcmp ((char *) value, - "IDL:/CORBA_DynEnum:1.0")) - || (!ACE_OS::strcmp ((char *) value, - "IDL:/CORBA_DynAny:1.0")) + if ((!ACE_OS::strcmp ((char *) value, + "IDL:/CORBA_DynEnum:1.0")) + || (!ACE_OS::strcmp ((char *) value, + "IDL:/CORBA_DynAny:1.0")) || (!ACE_OS::strcmp ((char *) value, CORBA::_tc_Object->id (_tao_environment)))) return 1; @@ -612,37 +615,37 @@ POA_CORBA::DynEnum::_is_a ( return 0; } -void* +void* POA_CORBA::DynEnum::_downcast ( const char* logical_type_id ) { - if (!ACE_OS::strcmp (logical_type_id, + if (!ACE_OS::strcmp (logical_type_id, "IDL:/CORBA_DynEnum:1.0")) - return ACE_static_cast (POA_CORBA::DynEnum_ptr, + return ACE_static_cast (POA_CORBA::DynEnum_ptr, this); - if (!ACE_OS::strcmp (logical_type_id, + if (!ACE_OS::strcmp (logical_type_id, "IDL:/CORBA_DynAny:1.0")) - return ACE_static_cast (POA_CORBA::DynAny_ptr, + return ACE_static_cast (POA_CORBA::DynAny_ptr, this); - if (!ACE_OS::strcmp (logical_type_id, + if (!ACE_OS::strcmp (logical_type_id, "IDL:omg.org/CORBA/Object:1.0")) - return ACE_static_cast(PortableServer::Servant, + return ACE_static_cast(PortableServer::Servant, this); return 0; } -void -POA_CORBA::DynEnum::_dispatch (CORBA::ServerRequest &, - void *, +void +POA_CORBA::DynEnum::_dispatch (CORBA::ServerRequest &, + void *, CORBA::Environment &) { } -const char* +const char* POA_CORBA::DynEnum::_interface_repository_id (void) const { return "IDL:/CORBA_DynEnum:1.0"; @@ -653,22 +656,22 @@ POA_CORBA::_tao_collocated_DynEnum::_tao_collocated_DynEnum ( STUB_Object *stub ) : CORBA_DynEnum (), - _tao_collocated_DynAny (servant, + _tao_collocated_DynAny (servant, stub), - CORBA_Object (stub, - servant, + CORBA_Object (stub, + servant, 1), servant_ (servant) { } -POA_CORBA::DynEnum_ptr +POA_CORBA::DynEnum_ptr POA_CORBA::_tao_collocated_DynEnum::_get_servant (void) const { return this->servant_; } -CORBA::Boolean +CORBA::Boolean POA_CORBA::_tao_collocated_DynEnum::_is_a ( const char* logical_type_id, CORBA::Environment &_tao_environment @@ -680,7 +683,7 @@ POA_CORBA::_tao_collocated_DynEnum::_is_a ( ); } -char * +char * POA_CORBA::_tao_collocated_DynEnum::value_as_string ( CORBA::Environment &_tao_environment ) @@ -690,7 +693,7 @@ POA_CORBA::_tao_collocated_DynEnum::value_as_string ( ); } -void +void POA_CORBA::_tao_collocated_DynEnum::value_as_string ( const char * value_as_string, CORBA::Environment &_tao_environment @@ -702,7 +705,7 @@ POA_CORBA::_tao_collocated_DynEnum::value_as_string ( ); } -CORBA::ULong +CORBA::ULong POA_CORBA::_tao_collocated_DynEnum::value_as_ulong ( CORBA::Environment &_tao_environment ) @@ -712,7 +715,7 @@ POA_CORBA::_tao_collocated_DynEnum::value_as_ulong ( ); } -void +void POA_CORBA::_tao_collocated_DynEnum::value_as_ulong ( CORBA::ULong value_as_ulong, CORBA::Environment &_tao_environment @@ -733,7 +736,7 @@ POA_CORBA::DynEnum::_this (CORBA_Environment &TAO_IN_ENV) if (TAO_IN_ENV.exception () != 0) return 0; - return new POA_CORBA::_tao_collocated_DynEnum (this, + return new POA_CORBA::_tao_collocated_DynEnum (this, stub); } @@ -751,51 +754,51 @@ POA_CORBA::DynStruct::DynStruct (POA_CORBA::DynStruct& rhs) POA_CORBA::DynStruct::~DynStruct (void) { } -CORBA::Boolean +CORBA::Boolean POA_CORBA::DynStruct::_is_a ( const char* value, CORBA::Environment &_tao_environment ) { - if ((!ACE_OS::strcmp ((char *)value, "IDL:/CORBA_DynStruct:1.0")) - || (!ACE_OS::strcmp ((char *)value, "IDL:/CORBA_DynAny:1.0")) + if ((!ACE_OS::strcmp ((char *)value, "IDL:/CORBA_DynStruct:1.0")) + || (!ACE_OS::strcmp ((char *)value, "IDL:/CORBA_DynAny:1.0")) || (!ACE_OS::strcmp ((char *)value, CORBA::_tc_Object->id (_tao_environment)))) return 1; else return 0; } -void* +void* POA_CORBA::DynStruct::_downcast ( const char* logical_type_id ) { - if (!ACE_OS::strcmp (logical_type_id, + if (!ACE_OS::strcmp (logical_type_id, "IDL:/CORBA_DynStruct:1.0")) - return ACE_static_cast (POA_CORBA::DynStruct_ptr, + return ACE_static_cast (POA_CORBA::DynStruct_ptr, this); - if (!ACE_OS::strcmp (logical_type_id, + if (!ACE_OS::strcmp (logical_type_id, "IDL:/CORBA_DynAny:1.0")) - return ACE_static_cast (POA_CORBA::DynAny_ptr, + return ACE_static_cast (POA_CORBA::DynAny_ptr, this); - if (!ACE_OS::strcmp (logical_type_id, + if (!ACE_OS::strcmp (logical_type_id, "IDL:omg.org/CORBA/Object:1.0")) - return ACE_static_cast(PortableServer::Servant, + return ACE_static_cast(PortableServer::Servant, this); return 0; } -void -POA_CORBA::DynStruct::_dispatch (CORBA::ServerRequest &, - void *, +void +POA_CORBA::DynStruct::_dispatch (CORBA::ServerRequest &, + void *, CORBA::Environment &) { } -const char* +const char* POA_CORBA::DynStruct::_interface_repository_id (void) const { return "IDL:/CORBA_DynStruct:1.0"; @@ -806,22 +809,22 @@ POA_CORBA::_tao_collocated_DynStruct::_tao_collocated_DynStruct ( STUB_Object *stub ) : CORBA_DynStruct (), - ACE_NESTED_CLASS (POA_CORBA, _tao_collocated_DynAny (servant, + ACE_NESTED_CLASS (POA_CORBA, _tao_collocated_DynAny (servant, stub)), - CORBA_Object (stub, - servant, + CORBA_Object (stub, + servant, 1), servant_ (servant) { } -POA_CORBA::DynStruct_ptr +POA_CORBA::DynStruct_ptr POA_CORBA::_tao_collocated_DynStruct::_get_servant (void) const { return this->servant_; } -CORBA::Boolean +CORBA::Boolean POA_CORBA::_tao_collocated_DynStruct::_is_a ( const char* logical_type_id, CORBA::Environment &_tao_environment @@ -833,7 +836,7 @@ POA_CORBA::_tao_collocated_DynStruct::_is_a ( ); } -char * +char * POA_CORBA::_tao_collocated_DynStruct::current_member_name ( CORBA::Environment &_tao_environment ) @@ -843,7 +846,7 @@ POA_CORBA::_tao_collocated_DynStruct::current_member_name ( ); } -CORBA::TCKind +CORBA::TCKind POA_CORBA::_tao_collocated_DynStruct::current_member_kind ( CORBA::Environment &_tao_environment ) @@ -853,7 +856,7 @@ POA_CORBA::_tao_collocated_DynStruct::current_member_kind ( ); } -NameValuePairSeq * +NameValuePairSeq * POA_CORBA::_tao_collocated_DynStruct::get_members ( CORBA::Environment &_tao_environment ) @@ -863,7 +866,7 @@ POA_CORBA::_tao_collocated_DynStruct::get_members ( ); } -void +void POA_CORBA::_tao_collocated_DynStruct::set_members ( const NameValuePairSeq & value, CORBA::Environment &_tao_environment @@ -884,7 +887,7 @@ POA_CORBA::DynStruct::_this (CORBA_Environment &TAO_IN_ENV) if (TAO_IN_ENV.exception () != 0) return 0; - return new POA_CORBA::_tao_collocated_DynStruct (this, + return new POA_CORBA::_tao_collocated_DynStruct (this, stub); } @@ -902,36 +905,36 @@ POA_CORBA::DynUnion::DynUnion (POA_CORBA::DynUnion& rhs) POA_CORBA::DynUnion::~DynUnion (void) { } -CORBA::Boolean +CORBA::Boolean POA_CORBA::DynUnion::_is_a ( const char* value, CORBA::Environment &_tao_environment ) { - if ((!ACE_OS::strcmp ((char *)value, "IDL:/CORBA_DynUnion:1.0")) - || (!ACE_OS::strcmp ((char *)value, "IDL:/CORBA_DynAny:1.0")) + if ((!ACE_OS::strcmp ((char *)value, "IDL:/CORBA_DynUnion:1.0")) + || (!ACE_OS::strcmp ((char *)value, "IDL:/CORBA_DynAny:1.0")) || (!ACE_OS::strcmp ((char *)value, CORBA::_tc_Object->id (_tao_environment)))) return 1; else return 0; } -void* +void* POA_CORBA::DynUnion::_downcast ( const char* logical_type_id ) { - if (!ACE_OS::strcmp (logical_type_id, + if (!ACE_OS::strcmp (logical_type_id, "IDL:/CORBA_DynUnion:1.0")) - return ACE_static_cast (POA_CORBA::DynUnion_ptr, + return ACE_static_cast (POA_CORBA::DynUnion_ptr, this); - if (!ACE_OS::strcmp (logical_type_id, + if (!ACE_OS::strcmp (logical_type_id, "IDL:/CORBA_DynAny:1.0")) - return ACE_static_cast (POA_CORBA::DynAny_ptr, + return ACE_static_cast (POA_CORBA::DynAny_ptr, this); - if (!ACE_OS::strcmp (logical_type_id, + if (!ACE_OS::strcmp (logical_type_id, "IDL:omg.org/CORBA/Object:1.0")) return ACE_static_cast(PortableServer::Servant, this); @@ -939,8 +942,8 @@ POA_CORBA::DynUnion::_downcast ( return 0; } -void POA_CORBA::DynUnion::_dispatch (CORBA::ServerRequest &, - void *, +void POA_CORBA::DynUnion::_dispatch (CORBA::ServerRequest &, + void *, CORBA::Environment &) { } @@ -955,20 +958,20 @@ POA_CORBA::_tao_collocated_DynUnion::_tao_collocated_DynUnion ( STUB_Object *stub ) : CORBA_DynUnion (), - ACE_NESTED_CLASS (POA_CORBA, _tao_collocated_DynAny (servant, + ACE_NESTED_CLASS (POA_CORBA, _tao_collocated_DynAny (servant, stub)), CORBA_Object (stub, servant, 1), servant_ (servant) { } -POA_CORBA::DynUnion_ptr +POA_CORBA::DynUnion_ptr POA_CORBA::_tao_collocated_DynUnion::_get_servant (void) const { return this->servant_; } -CORBA::Boolean +CORBA::Boolean POA_CORBA::_tao_collocated_DynUnion::_is_a ( const char* logical_type_id, CORBA::Environment &_tao_environment @@ -980,7 +983,7 @@ POA_CORBA::_tao_collocated_DynUnion::_is_a ( ); } -CORBA::Boolean +CORBA::Boolean POA_CORBA::_tao_collocated_DynUnion::set_as_default ( CORBA::Environment &_tao_environment ) @@ -990,7 +993,7 @@ POA_CORBA::_tao_collocated_DynUnion::set_as_default ( ); } -void +void POA_CORBA::_tao_collocated_DynUnion::set_as_default ( CORBA::Boolean set_as_default, CORBA::Environment &_tao_environment @@ -1002,7 +1005,7 @@ POA_CORBA::_tao_collocated_DynUnion::set_as_default ( ); } -CORBA_DynAny_ptr +CORBA_DynAny_ptr POA_CORBA::_tao_collocated_DynUnion::discriminator ( CORBA::Environment &_tao_environment ) @@ -1012,7 +1015,7 @@ POA_CORBA::_tao_collocated_DynUnion::discriminator ( ); } -CORBA::TCKind +CORBA::TCKind POA_CORBA::_tao_collocated_DynUnion::discriminator_kind ( CORBA::Environment &_tao_environment ) @@ -1022,7 +1025,7 @@ POA_CORBA::_tao_collocated_DynUnion::discriminator_kind ( ); } -CORBA_DynAny_ptr +CORBA_DynAny_ptr POA_CORBA::_tao_collocated_DynUnion::member ( CORBA::Environment &_tao_environment ) @@ -1032,7 +1035,7 @@ POA_CORBA::_tao_collocated_DynUnion::member ( ); } -char * +char * POA_CORBA::_tao_collocated_DynUnion::member_name ( CORBA::Environment &_tao_environment ) @@ -1042,7 +1045,7 @@ POA_CORBA::_tao_collocated_DynUnion::member_name ( ); } -void +void POA_CORBA::_tao_collocated_DynUnion::member_name ( const char * member_name, CORBA::Environment &_tao_environment @@ -1054,7 +1057,7 @@ POA_CORBA::_tao_collocated_DynUnion::member_name ( ); } -CORBA::TCKind +CORBA::TCKind POA_CORBA::_tao_collocated_DynUnion::member_kind ( CORBA::Environment &_tao_environment ) @@ -1073,7 +1076,7 @@ POA_CORBA::DynUnion::_this (CORBA_Environment &TAO_IN_ENV) if (TAO_IN_ENV.exception () != 0) return 0; - return new POA_CORBA::_tao_collocated_DynUnion (this, + return new POA_CORBA::_tao_collocated_DynUnion (this, stub); } @@ -1091,51 +1094,51 @@ POA_CORBA::DynSequence::DynSequence (POA_CORBA::DynSequence& rhs) POA_CORBA::DynSequence::~DynSequence (void) { } -CORBA::Boolean +CORBA::Boolean POA_CORBA::DynSequence::_is_a ( const char* value, CORBA::Environment &_tao_environment ) { - if ((!ACE_OS::strcmp ((char *)value, "IDL:/CORBA_DynSequence:1.0")) - || (!ACE_OS::strcmp ((char *)value, "IDL:/CORBA_DynAny:1.0")) + if ((!ACE_OS::strcmp ((char *)value, "IDL:/CORBA_DynSequence:1.0")) + || (!ACE_OS::strcmp ((char *)value, "IDL:/CORBA_DynAny:1.0")) || (!ACE_OS::strcmp ((char *)value, CORBA::_tc_Object->id (_tao_environment)))) return 1; else return 0; } -void* +void* POA_CORBA::DynSequence::_downcast ( const char* logical_type_id ) { - if (!ACE_OS::strcmp (logical_type_id, + if (!ACE_OS::strcmp (logical_type_id, "IDL:/CORBA_DynSequence:1.0")) - return ACE_static_cast (POA_CORBA::DynSequence_ptr, + return ACE_static_cast (POA_CORBA::DynSequence_ptr, this); - if (!ACE_OS::strcmp (logical_type_id, + if (!ACE_OS::strcmp (logical_type_id, "IDL:/CORBA_DynAny:1.0")) - return ACE_static_cast (POA_CORBA::DynAny_ptr, + return ACE_static_cast (POA_CORBA::DynAny_ptr, this); - if (!ACE_OS::strcmp (logical_type_id, + if (!ACE_OS::strcmp (logical_type_id, "IDL:omg.org/CORBA/Object:1.0")) - return ACE_static_cast(PortableServer::Servant, + return ACE_static_cast(PortableServer::Servant, this); return 0; } -void -POA_CORBA::DynSequence::_dispatch (CORBA::ServerRequest &, - void *, +void +POA_CORBA::DynSequence::_dispatch (CORBA::ServerRequest &, + void *, CORBA::Environment &) { } -const char* +const char* POA_CORBA::DynSequence::_interface_repository_id (void) const { return "IDL:/CORBA_DynSequence:1.0"; @@ -1146,20 +1149,20 @@ POA_CORBA::_tao_collocated_DynSequence::_tao_collocated_DynSequence ( STUB_Object *stub ) : CORBA_DynSequence (), - ACE_NESTED_CLASS (POA_CORBA, _tao_collocated_DynAny (servant, + ACE_NESTED_CLASS (POA_CORBA, _tao_collocated_DynAny (servant, stub)), CORBA_Object (stub, servant, 1), servant_ (servant) { } -POA_CORBA::DynSequence_ptr +POA_CORBA::DynSequence_ptr POA_CORBA::_tao_collocated_DynSequence::_get_servant (void) const { return this->servant_; } -CORBA::Boolean +CORBA::Boolean POA_CORBA::_tao_collocated_DynSequence::_is_a ( const char* logical_type_id, CORBA::Environment &_tao_environment @@ -1171,7 +1174,7 @@ POA_CORBA::_tao_collocated_DynSequence::_is_a ( ); } -CORBA::ULong +CORBA::ULong POA_CORBA::_tao_collocated_DynSequence::length ( CORBA::Environment &_tao_environment ) @@ -1181,7 +1184,7 @@ POA_CORBA::_tao_collocated_DynSequence::length ( ); } -void +void POA_CORBA::_tao_collocated_DynSequence::length ( CORBA::ULong length, CORBA::Environment &_tao_environment @@ -1193,7 +1196,7 @@ POA_CORBA::_tao_collocated_DynSequence::length ( ); } -AnySeq * +AnySeq * POA_CORBA::_tao_collocated_DynSequence::get_elements ( CORBA::Environment &_tao_environment ) @@ -1203,7 +1206,7 @@ POA_CORBA::_tao_collocated_DynSequence::get_elements ( ); } -void +void POA_CORBA::_tao_collocated_DynSequence::set_elements ( const AnySeq & value, CORBA::Environment &_tao_environment @@ -1224,7 +1227,7 @@ POA_CORBA::DynSequence::_this (CORBA_Environment &TAO_IN_ENV) if (TAO_IN_ENV.exception () != 0) return 0; - return new POA_CORBA::_tao_collocated_DynSequence (this, + return new POA_CORBA::_tao_collocated_DynSequence (this, stub); } @@ -1242,51 +1245,51 @@ POA_CORBA::DynArray::DynArray (POA_CORBA::DynArray& rhs) POA_CORBA::DynArray::~DynArray (void) { } -CORBA::Boolean +CORBA::Boolean POA_CORBA::DynArray::_is_a ( const char* value, CORBA::Environment &_tao_environment ) { - if ((!ACE_OS::strcmp ((char *)value, "IDL:/CORBA_DynArray:1.0")) - || (!ACE_OS::strcmp ((char *)value, "IDL:/CORBA_DynAny:1.0")) + if ((!ACE_OS::strcmp ((char *)value, "IDL:/CORBA_DynArray:1.0")) + || (!ACE_OS::strcmp ((char *)value, "IDL:/CORBA_DynAny:1.0")) || (!ACE_OS::strcmp ((char *)value, CORBA::_tc_Object->id (_tao_environment)))) return 1; else return 0; } -void* +void* POA_CORBA::DynArray::_downcast ( const char* logical_type_id ) { - if (!ACE_OS::strcmp (logical_type_id, + if (!ACE_OS::strcmp (logical_type_id, "IDL:/CORBA_DynArray:1.0")) - return ACE_static_cast (POA_CORBA::DynArray_ptr, + return ACE_static_cast (POA_CORBA::DynArray_ptr, this); - if (!ACE_OS::strcmp (logical_type_id, + if (!ACE_OS::strcmp (logical_type_id, "IDL:/CORBA_DynAny:1.0")) - return ACE_static_cast (POA_CORBA::DynAny_ptr, + return ACE_static_cast (POA_CORBA::DynAny_ptr, this); - if (!ACE_OS::strcmp (logical_type_id, + if (!ACE_OS::strcmp (logical_type_id, "IDL:omg.org/CORBA/Object:1.0")) - return ACE_static_cast(PortableServer::Servant, + return ACE_static_cast(PortableServer::Servant, this); return 0; } -void -POA_CORBA::DynArray::_dispatch (CORBA::ServerRequest &, - void *, +void +POA_CORBA::DynArray::_dispatch (CORBA::ServerRequest &, + void *, CORBA::Environment &) { } -const char* +const char* POA_CORBA::DynArray::_interface_repository_id (void) const { return "IDL:/CORBA_DynArray:1.0"; @@ -1297,14 +1300,14 @@ POA_CORBA::_tao_collocated_DynArray::_tao_collocated_DynArray ( STUB_Object *stub ) : CORBA_DynArray (), - ACE_NESTED_CLASS (POA_CORBA, _tao_collocated_DynAny (servant, + ACE_NESTED_CLASS (POA_CORBA, _tao_collocated_DynAny (servant, stub)), CORBA_Object (stub, servant, 1), servant_ (servant) { } -POA_CORBA::DynArray_ptr +POA_CORBA::DynArray_ptr POA_CORBA::_tao_collocated_DynArray::_get_servant (void) const { return this->servant_; @@ -1321,7 +1324,7 @@ CORBA::Boolean POA_CORBA::_tao_collocated_DynArray::_is_a ( ); } -AnySeq * +AnySeq * POA_CORBA::_tao_collocated_DynArray::get_elements ( CORBA::Environment &_tao_environment ) @@ -1331,7 +1334,7 @@ POA_CORBA::_tao_collocated_DynArray::get_elements ( ); } -void +void POA_CORBA::_tao_collocated_DynArray::set_elements ( const AnySeq & value, CORBA::Environment &_tao_environment @@ -1352,7 +1355,8 @@ POA_CORBA::DynArray::_this (CORBA_Environment &TAO_IN_ENV) if (TAO_IN_ENV.exception () != 0) return 0; - return new POA_CORBA::_tao_collocated_DynArray (this, + return new POA_CORBA::_tao_collocated_DynArray (this, stub); } +#endif /* TAO_HAS_MINIMUM_CORBA */ diff --git a/TAO/tao/DynAny_i.cpp b/TAO/tao/DynAny_i.cpp index a05f533e8dc..004352d7a07 100644 --- a/TAO/tao/DynAny_i.cpp +++ b/TAO/tao/DynAny_i.cpp @@ -14,6 +14,9 @@ // ================================================================= #include "tao/DynAny_i.h" + +#if !defined (TAO_HAS_MINIMUM_CORBA) + #include "tao/DynStruct_i.h" #include "tao/DynSequence_i.h" #include "tao/DynEnum_i.h" @@ -752,3 +755,5 @@ TAO_DynAny_i::unalias (CORBA_TypeCode_ptr tc, return tck; } + +#endif /* TAO_HAS_MINIMUM_CORBA */ diff --git a/TAO/tao/DynAny_i.h b/TAO/tao/DynAny_i.h index dfc16ba6a8d..63fe1e668bf 100644 --- a/TAO/tao/DynAny_i.h +++ b/TAO/tao/DynAny_i.h @@ -16,6 +16,10 @@ #ifndef TAO_DYNANY_I_H #define TAO_DYNANY_I_H +#include "tao/orbconf.h" + +#if !defined (TAO_HAS_MINIMUM_CORBA) + #include "tao/corbafwd.h" #include "tao/POA_CORBA.h" @@ -185,4 +189,6 @@ private: TAO_DynAny_i &operator= (const TAO_DynAny_i &src); }; +#endif /* TAO_HAS_MINIMUM_CORBA */ + #endif /* TAO_DYNANY_I_H */ diff --git a/TAO/tao/DynArray_i.cpp b/TAO/tao/DynArray_i.cpp index 823f45a4218..ffc622f93e2 100644 --- a/TAO/tao/DynArray_i.cpp +++ b/TAO/tao/DynArray_i.cpp @@ -14,6 +14,9 @@ // ==================================================================== #include "tao/DynAny_i.h" + +#if !defined (TAO_HAS_MINIMUM_CORBA) + #include "tao/DynArray_i.h" #include "tao/InconsistentTypeCodeC.h" @@ -233,7 +236,7 @@ TAO_DynArray_i::from_any (const CORBA_Any& any, if (!CORBA::is_nil (this->da_members_[i].in ())) this->da_members_[i]->destroy (env); - this->da_members_[i] = + this->da_members_[i] = TAO_DynAny_i::create_dyn_any (field_any, env); @@ -268,8 +271,8 @@ TAO_DynArray_i::to_any (CORBA::Environment& TAO_IN_ENV) TAO_InputCDR field_cdr (field_mb); - out_cdr.append (field_tc, - &field_cdr, + out_cdr.append (field_tc, + &field_cdr, TAO_IN_ENV); delete field_any; @@ -970,3 +973,4 @@ template class ACE_Array_Base<CORBA_DynAny_var>; #pragma instantiate ACE_Array_Base<CORBA_DynAny_var> #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ +#endif /* TAO_HAS_MINIMUM_CORBA */ diff --git a/TAO/tao/DynArray_i.h b/TAO/tao/DynArray_i.h index 7c7f848ccd4..e3b1d0522c1 100644 --- a/TAO/tao/DynArray_i.h +++ b/TAO/tao/DynArray_i.h @@ -17,6 +17,10 @@ #ifndef TAO_DYNARRAY_I_H #define TAO_DYNARRAY_I_H +#include "tao/orbconf.h" + +#if !defined (TAO_HAS_MINIMUM_CORBA) + #include "ace/Containers.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) @@ -176,4 +180,6 @@ private: TAO_DynArray_i &operator= (const TAO_DynArray_i &src); }; +#endif /* TAO_HAS_MINIMUM_CORBA */ + #endif /* TAO_DYNARRAY_I_H */ diff --git a/TAO/tao/DynEnum_i.cpp b/TAO/tao/DynEnum_i.cpp index 92f4674c9cd..bf4a5bd25dc 100644 --- a/TAO/tao/DynEnum_i.cpp +++ b/TAO/tao/DynEnum_i.cpp @@ -14,6 +14,9 @@ // =================================================================== #include "tao/DynAny_i.h" + +#if !defined (TAO_HAS_MINIMUM_CORBA) + #include "tao/DynEnum_i.h" #include "tao/InconsistentTypeCodeC.h" @@ -441,4 +444,4 @@ TAO_DynEnum_i::get_any (CORBA::Environment& env) return 0; } - +#endif /* TAO_HAS_MINIMUM_CORBA */ diff --git a/TAO/tao/DynEnum_i.h b/TAO/tao/DynEnum_i.h index e270b951d0d..09ec319c65c 100644 --- a/TAO/tao/DynEnum_i.h +++ b/TAO/tao/DynEnum_i.h @@ -17,6 +17,10 @@ #ifndef TAO_DYNENUM_I_H #define TAO_DYNENUM_I_H +#include "tao/orbconf.h" + +#if !defined (TAO_HAS_MINIMUM_CORBA) + #include "ace/Containers.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) @@ -173,4 +177,6 @@ private: TAO_DynEnum_i &operator= (const TAO_DynEnum_i &src); }; +#endif /* TAO_HAS_MINIMUM_CORBA */ + #endif /* TAO_DYNENUM_I_H */ diff --git a/TAO/tao/DynSequence_i.cpp b/TAO/tao/DynSequence_i.cpp index 6795db51afc..083cd3241cd 100644 --- a/TAO/tao/DynSequence_i.cpp +++ b/TAO/tao/DynSequence_i.cpp @@ -14,6 +14,9 @@ // =================================================================== #include "tao/DynAny_i.h" + +#if !defined (TAO_HAS_MINIMUM_CORBA) + #include "tao/DynSequence_i.h" #include "tao/InconsistentTypeCodeC.h" @@ -969,3 +972,4 @@ TAO_DynSequence_i::get_element_type (CORBA::Environment& env) return element_type->content_type (env); } +#endif /* TAO_HAS_MINIMUM_CORBA */ diff --git a/TAO/tao/DynSequence_i.h b/TAO/tao/DynSequence_i.h index 7552a1bee69..d80441d6c25 100644 --- a/TAO/tao/DynSequence_i.h +++ b/TAO/tao/DynSequence_i.h @@ -17,6 +17,10 @@ #ifndef TAO_DYNSEQUENCE_I_H #define TAO_DYNSEQUENCE_I_H +#include "tao/orbconf.h" + +#if !defined (TAO_HAS_MINIMUM_CORBA) + #include "ace/Containers.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) @@ -179,4 +183,6 @@ private: TAO_DynSequence_i &operator= (const TAO_DynSequence_i &src); }; +#endif /* TAO_HAS_MINIMUM_CORBA */ + #endif /* TAO_DYNSEQUENCE_I_H */ diff --git a/TAO/tao/DynStruct_i.cpp b/TAO/tao/DynStruct_i.cpp index 4d6f334571a..626dbd3a4ce 100644 --- a/TAO/tao/DynStruct_i.cpp +++ b/TAO/tao/DynStruct_i.cpp @@ -14,6 +14,9 @@ // ==================================================================== #include "tao/DynAny_i.h" + +#if !defined (TAO_HAS_MINIMUM_CORBA) + #include "tao/DynStruct_i.h" #include "tao/InconsistentTypeCodeC.h" @@ -999,4 +1002,4 @@ TAO_DynStruct_i::get_any (CORBA::Environment &env) return val; } -//********************************************************** +#endif /* TAO_HAS_MINIMUM_CORBA */ diff --git a/TAO/tao/DynStruct_i.h b/TAO/tao/DynStruct_i.h index 23cb0fa4e0e..90f5150588c 100644 --- a/TAO/tao/DynStruct_i.h +++ b/TAO/tao/DynStruct_i.h @@ -17,6 +17,10 @@ #ifndef TAO_DYNSTRUCT_I_H #define TAO_DYNSTRUCT_I_H +#include "tao/orbconf.h" + +#if !defined (TAO_HAS_MINIMUM_CORBA) + #include "ace/Containers.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) @@ -174,4 +178,6 @@ private: TAO_DynStruct_i &operator= (const TAO_DynStruct_i &src); }; +#endif /* TAO_HAS_MINIMUM_CORBA */ + #endif /* TAO_DYNSTRUCT_I_H */ diff --git a/TAO/tao/DynUnion_i.cpp b/TAO/tao/DynUnion_i.cpp index 6f84aa1e02f..c7cff33b668 100644 --- a/TAO/tao/DynUnion_i.cpp +++ b/TAO/tao/DynUnion_i.cpp @@ -14,6 +14,9 @@ // ==================================================================== #include "tao/DynAny_i.h" + +#if !defined (TAO_HAS_MINIMUM_CORBA) + #include "tao/DynUnion_i.h" #include "tao/InconsistentTypeCodeC.h" @@ -1448,3 +1451,5 @@ template class DU_Extractor<CORBA::ULongLong>; #pragma instantiate DU_Extractor<CORBA::ULongLong> #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + +#endif /* TAO_HAS_MINIMUM_CORBA */ diff --git a/TAO/tao/DynUnion_i.h b/TAO/tao/DynUnion_i.h index 7edde848a9a..0dd2ff6c4ec 100644 --- a/TAO/tao/DynUnion_i.h +++ b/TAO/tao/DynUnion_i.h @@ -17,6 +17,10 @@ #ifndef TAO_DYNUNION_I_H #define TAO_DYNUNION_I_H +#include "tao/orbconf.h" + +#if !defined (TAO_HAS_MINIMUM_CORBA) + #include "tao/DynUnion_i_T.h" class TAO_Export TAO_DynUnion_i : public POA_CORBA::DynUnion @@ -217,4 +221,6 @@ private: // function from_any(). }; +#endif /* TAO_HAS_MINIMUM_CORBA */ + #endif /* TAO_DYNUNION_I_H */ diff --git a/TAO/tao/Exception.cpp b/TAO/tao/Exception.cpp index 051ad19e32c..90f54150d1b 100644 --- a/TAO/tao/Exception.cpp +++ b/TAO/tao/Exception.cpp @@ -13,7 +13,6 @@ #include "tao/Environment.h" #include "tao/Any.h" #include "tao/CDR.h" -#include "tao/POAC.h" #if !defined (__ACE_INLINE__) # include "tao/Exception.i" @@ -443,19 +442,6 @@ CORBA::TypeCode_ptr CORBA::_tc_UnknownUserException = 0; // static CORBA::TypeCode tc_std_ ## name (CORBA::tk_except); // CORBA::TypeCode_ptr CORBA::_tc_ ## name = &tc_std_ ## name; -#define POA_EXCEPTION_LIST \ - POA_EXCEPTION (AdapterAlreadyExists) \ - POA_EXCEPTION (AdapterInactive) \ - POA_EXCEPTION (AdapterNonExistent) \ - POA_EXCEPTION (InvalidPolicy) \ - POA_EXCEPTION (NoServant) \ - POA_EXCEPTION (ObjectAlreadyActive) \ - POA_EXCEPTION (ObjectNotActive) \ - POA_EXCEPTION (ServantAlreadyActive) \ - POA_EXCEPTION (ServantNotActive) \ - POA_EXCEPTION (WrongAdapter) \ - POA_EXCEPTION (WrongPolicy ) \ - void TAO_Exceptions::init (CORBA::Environment &env) { @@ -470,16 +456,6 @@ TAO_Exceptions::init (CORBA::Environment &env) STANDARD_EXCEPTION_LIST #undef TAO_SYSTEM_EXCEPTION - // Register POA exceptions as system exceptions - TAO_Exceptions::system_exceptions->add (PortableServer::_tc_ForwardRequest); - TAO_Exceptions::system_exceptions->add (PortableServer::POAManager::_tc_AdapterInactive); - TAO_Exceptions::system_exceptions->add (PortableServer::Current::_tc_NoContext); - -#define POA_EXCEPTION(name) \ - TAO_Exceptions::system_exceptions->add (PortableServer::POA::_tc_ ## name); -POA_EXCEPTION_LIST -#undef POA_EXCEPTION - if (env.exception () == 0) TAO_Exceptions::make_unknown_user_typecode (CORBA::_tc_UnknownUserException, env); @@ -497,34 +473,6 @@ TAO_Exceptions::create_system_exception (const char* id, } STANDARD_EXCEPTION_LIST #undef TAO_SYSTEM_EXCEPTION -#define POA_EXCEPTION(name) \ - { \ - env.clear (); \ - const char* xid = PortableServer::POA::_tc_ ## name ->id (env); \ - if (env.exception () == 0 && ACE_OS::strcmp (id, xid) == 0) \ - return new PortableServer::POA:: name; \ - } -POA_EXCEPTION_LIST -#undef POA_EXCEPTION - - { - env.clear (); - const char* xid = PortableServer::_tc_ForwardRequest->id (env); - if (env.exception () == 0 && ACE_OS::strcmp (id, xid) == 0) - return new PortableServer::ForwardRequest; - } - { - env.clear (); - const char* xid = PortableServer::POAManager::_tc_AdapterInactive->id (env); - if (env.exception () == 0 && ACE_OS::strcmp (id, xid) == 0) - return new PortableServer::POAManager::AdapterInactive; - } - { - env.clear (); - const char* xid = PortableServer::Current::_tc_NoContext->id (env); - if (env.exception () == 0 && ACE_OS::strcmp (id, xid) == 0) - return new PortableServer::Current::NoContext; - } return 0; } @@ -582,7 +530,6 @@ CORBA_##name :: CORBA_##name (void) \ STANDARD_EXCEPTION_LIST #undef TAO_SYSTEM_EXCEPTION -#undef POA_EXCEPTION_LIST #undef STANDARD_EXCEPTION_LIST CORBA_ExceptionList::CORBA_ExceptionList (CORBA::ULong len, diff --git a/TAO/tao/Forwarding_Servant.cpp b/TAO/tao/Forwarding_Servant.cpp index 86faf571e38..e5596398765 100644 --- a/TAO/tao/Forwarding_Servant.cpp +++ b/TAO/tao/Forwarding_Servant.cpp @@ -1,6 +1,9 @@ // $Id$ #include "tao/Forwarding_Servant.h" + +#if !defined (TAO_HAS_MINIMUM_CORBA) + #include "tao/Object.h" #include "tao/POAC.h" #include "tao/Any.h" @@ -43,3 +46,5 @@ TAO_Forwarding_Servant::_primary_interface (const PortableServer::ObjectId &oid, return CORBA::string_dup (this->interface_repository_id_.in ()); } + +#endif /* TAO_HAS_MINIMUM_CORBA */ diff --git a/TAO/tao/Forwarding_Servant.h b/TAO/tao/Forwarding_Servant.h index e3ad6b1fbd8..df49b095c36 100644 --- a/TAO/tao/Forwarding_Servant.h +++ b/TAO/tao/Forwarding_Servant.h @@ -21,6 +21,10 @@ #ifndef TAO_FORWARDING_SERVANT_H #define TAO_FORWARDING_SERVANT_H +#include "tao/orbconf.h" + +#if !defined (TAO_HAS_MINIMUM_CORBA) + #include "tao/Servant_Base.h" #include "tao/ORB.h" @@ -54,4 +58,6 @@ protected: // Here is the interface we support }; +#endif /* TAO_HAS_MINIMUM_CORBA */ + #endif /* TAO_FORWARDING_SERVANT_H */ diff --git a/TAO/tao/InconsistentTypeCodeC.cpp b/TAO/tao/InconsistentTypeCodeC.cpp index 54a189c1cf8..87da690eaca 100644 --- a/TAO/tao/InconsistentTypeCodeC.cpp +++ b/TAO/tao/InconsistentTypeCodeC.cpp @@ -23,6 +23,9 @@ // ====================================================================== #include "tao/InconsistentTypeCodeC.h" + +#if !defined (TAO_HAS_MINIMUM_CORBA) + #include "tao/ORB.h" // default constructor @@ -55,12 +58,12 @@ CORBA_ORB_InconsistentTypeCode::operator= ( } // narrow -CORBA_ORB_InconsistentTypeCode* +CORBA_ORB_InconsistentTypeCode* CORBA_ORB_InconsistentTypeCode::_narrow (CORBA::Exception *exc) { - if (!ACE_OS::strcmp ("IDL:omg.org/CORBA/ORB/InconsistentTypeCode:1.0", + if (!ACE_OS::strcmp ("IDL:omg.org/CORBA/ORB/InconsistentTypeCode:1.0", exc->_id ())) // same type - return ACE_dynamic_cast (CORBA_ORB_InconsistentTypeCode*, + return ACE_dynamic_cast (CORBA_ORB_InconsistentTypeCode*, exc); else return 0; @@ -78,3 +81,4 @@ CORBA::Exception *CORBA_ORB_InconsistentTypeCode::_alloc (void) return new CORBA_ORB_InconsistentTypeCode; } +#endif /* TAO_HAS_MINIMUM_CORBA */ diff --git a/TAO/tao/InconsistentTypeCodeC.h b/TAO/tao/InconsistentTypeCodeC.h index 1603e7fb9ef..b826fd382eb 100644 --- a/TAO/tao/InconsistentTypeCodeC.h +++ b/TAO/tao/InconsistentTypeCodeC.h @@ -25,6 +25,10 @@ #ifndef TAO_IDL_INCONSISTENTTYPECODEC_H #define TAO_IDL_INCONSISTENTTYPECODEC_H +#include "tao/orbconf.h" + +#if !defined (TAO_HAS_MINIMUM_CORBA) + #include "tao/Exception.h" #if defined (TAO_EXPORT_MACRO) @@ -48,11 +52,11 @@ class TAO_Export CORBA_ORB_InconsistentTypeCode : public CORBA::UserException // function if the typecode argument is neither a basic type nor a // sequence, enum, array, struct or union. public: - CORBA_ORB_InconsistentTypeCode (void); + CORBA_ORB_InconsistentTypeCode (void); // default ctor - CORBA_ORB_InconsistentTypeCode (const CORBA_ORB_InconsistentTypeCode &); + CORBA_ORB_InconsistentTypeCode (const CORBA_ORB_InconsistentTypeCode &); // copy ctor - ~CORBA_ORB_InconsistentTypeCode (void); + ~CORBA_ORB_InconsistentTypeCode (void); // dtor CORBA_ORB_InconsistentTypeCode &operator= (const CORBA_ORB_InconsistentTypeCode &); @@ -72,4 +76,6 @@ public: #pragma warning(default:4250) #endif /* _MSC_VER */ +#endif /* TAO_HAS_MINIMUM_CORBA */ + #endif /* TAO_IDL_INCONSISTENTTYPECODEC_H */ diff --git a/TAO/tao/Invocation.h b/TAO/tao/Invocation.h index 712717a0d48..4b59ebaa9d0 100644 --- a/TAO/tao/Invocation.h +++ b/TAO/tao/Invocation.h @@ -30,6 +30,7 @@ #include "tao/CDR.h" #include "tao/ORB_Core.h" #include "tao/GIOP.h" +#include "tao/Any.h" struct TAO_Exception_Data; class TAO_Profile; diff --git a/TAO/tao/Makefile b/TAO/tao/Makefile index 54600c7d0bd..d02293003b4 100644 --- a/TAO/tao/Makefile +++ b/TAO/tao/Makefile @@ -17,74 +17,107 @@ PUB_HDRS = Pluggable MProfile IIOP_Profile IIOP_Transport IIOP_Connector \ Default_Client Default_Server \ Server_Strategy_Factory Client_Strategy_Factory ORB_Core -ORBCORE_SRCS = \ - Any \ - CurrentC \ - CurrentS \ - Context \ - DynAnyC \ - DynAnyS \ - DynAny_i \ - DynArray_i \ - DynEnum_i \ - DynSequence_i \ - DynStruct_i \ - DynUnion_i \ - Exception \ - Environment \ - Forwarding_Servant \ - InconsistentTypeCodeC \ - Managed_Types \ - NVList \ - Object \ - ORB \ - POA \ - POAC \ - POAS \ - POAManager \ - PolicyC \ - PolicyS \ - Principal \ - Request \ - Sequence \ - Server_Request \ - Pluggable \ - MProfile \ - IIOP_Profile \ - IIOP_Transport \ - IIOP_Connector \ - IIOP_Acceptor \ - Stub \ - Typecode \ - Union \ - CDR \ - Client_Strategy_Factory \ - Connect \ - append \ - debug \ - decode \ - deep_free \ - default_client \ - default_server \ - Object_KeyC \ - encode \ - GIOP \ - Invocation \ - IIOP_ORB \ - CDR_Interpreter \ - Marshal \ - Active_Object_Map \ - Operation_Table \ - ORB_Core \ - params \ - Server_Strategy_Factory \ - Servant_Base \ - skip \ - TAO_Internal \ - Typecode_Constants \ - TAO +ifndef minimum_corba +minimum_corba = 0 +endif # minimum_corba -FILES = $(ORBCORE_SRCS) +POA_FILES = \ + POA \ + POAC \ + POAS \ + POAManager \ + Active_Object_Map \ + Servant_Base + +PLUGGABLE_PROTOCOLS_FILES = \ + Pluggable \ + IIOP_Profile \ + IIOP_Transport \ + IIOP_Connector \ + IIOP_Acceptor + +DEFAULT_RESOURCES_FILES = \ + default_client \ + default_server + +INTERPRETIVE_MARSHALING_FILES = \ + append \ + decode \ + deep_free \ + encode \ + CDR_Interpreter \ + Marshal \ + skip + +IDL_COMPILER_FILES = \ + Managed_Types \ + Union \ + Operation_Table + +ORB_CORE_FILES = \ + Any \ + CurrentC \ + CurrentS \ + Context \ + Exception \ + Environment \ + Object \ + ORB \ + PolicyC \ + PolicyS \ + Principal \ + Sequence \ + Server_Request \ + MProfile \ + Stub \ + Typecode \ + CDR \ + Client_Strategy_Factory \ + Connect \ + debug \ + Object_KeyC \ + GIOP \ + Invocation \ + IIOP_ORB \ + ORB_Core \ + params \ + Server_Strategy_Factory \ + TAO_Internal \ + Typecode_Constants \ + TAO + +ifeq ($(minimum_corba),0) + +POA_FILES += \ + Forwarding_Servant + +ORB_CORE_FILES += \ + Request \ + NVList + +DYNAMIC_ANY_FILES += \ + DynAnyC \ + DynAnyS \ + DynAny_i \ + DynArray_i \ + DynEnum_i \ + DynSequence_i \ + DynStruct_i \ + DynUnion_i \ + InconsistentTypeCodeC + +CPP_FLAGS += -DTAO_HAS_MINIMUM_CORBA + +endif # minimum_corba + +FILES += \ + $(POA_FILES) \ + $(PLUGGABLE_PROTOCOLS_FILES) \ + $(DEFAULT_RESOURCES_FILES) \ + $(INTERPRETIVE_MARSHALING_FILES) \ + $(IDL_COMPILER_FILES) \ + $(ORB_CORE_FILES) \ + $(DYNAMIC_ANY_FILES) ifndef TAO_ROOT TAO_ROOT = $(ACE_ROOT)/TAO @@ -104,6 +137,52 @@ VLDLIBS = $(LDLIBS:%=%$(VAR)) #---------------------------------------------------------------------------- include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU + +#### +#### Build customization. +#### +ifndef TAO_COMPONENTS + TAO_COMPONENTS = \ + POA \ + Pluggable_Protocols \ + Default_Resources \ + Interpretive_Marshaling \ + IDL_Compiler \ + ORB_Core \ + Dynamic_Any +endif # TAO_COMPONENTS + +#### +#### TAO_COMPONENTS support. +#### +ifneq (,$(findstring POA,$(ACE_COMPONENTS))) + FILES += $(POA_FILES) +endif # POA + +ifneq (,$(findstring Pluggable_Protocols,$(ACE_COMPONENTS))) + FILES += $(PLUGGABLE_PROTOCOLS_FILES) +endif # Pluggable_Protocols + +ifneq (,$(findstring Default_Resources,$(ACE_COMPONENTS))) + FILES += $(DEFAULT_RESOURCES_FILES) +endif # Default_Resources + +ifneq (,$(findstring Interpretive_Marshaling,$(ACE_COMPONENTS))) + FILES += $(INTERPRETIVE_MARSHALING_FILES) +endif # Interpretive_Marshaling + +ifneq (,$(findstring IDL_Compiler,$(ACE_COMPONENTS))) + FILES += $(IDL_COMPILER_FILES) +endif # IDL_Compiler + +ifneq (,$(findstring ORB_Core,$(ACE_COMPONENTS))) + FILES += $(ORB_CORE_FILES) +endif # ORB_Core + +ifneq (,$(findstring Dynamic_Any,$(ACE_COMPONENTS))) + FILES += $(DYNAMIC_ANY_FILES) +endif # Dynamic_Any + include $(ACE_ROOT)/include/makeinclude/macros.GNU include $(TAO_ROOT)/rules.tao.GNU include $(ACE_ROOT)/include/makeinclude/rules.common.GNU diff --git a/TAO/tao/NVList.cpp b/TAO/tao/NVList.cpp index 861b3942212..39356702387 100644 --- a/TAO/tao/NVList.cpp +++ b/TAO/tao/NVList.cpp @@ -3,6 +3,9 @@ // Implementation of Named Value List and NamedValue classes #include "tao/NVList.h" + +#if !defined (TAO_HAS_MINIMUM_CORBA) + #include "tao/Exception.h" #include "tao/Environment.h" #include "tao/ORB.h" @@ -271,3 +274,5 @@ template class ACE_Unbounded_Queue_Iterator<CORBA::NamedValue_ptr>; #pragma instantiate ACE_Unbounded_Queue<CORBA::NamedValue_ptr> #pragma instantiate ACE_Unbounded_Queue_Iterator<CORBA::NamedValue_ptr> #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + +#endif /* TAO_HAS_MINIMUM_CORBA */ diff --git a/TAO/tao/NVList.h b/TAO/tao/NVList.h index 25dc19a966d..69ba4e38e75 100644 --- a/TAO/tao/NVList.h +++ b/TAO/tao/NVList.h @@ -19,6 +19,10 @@ #ifndef TAO_NVLIST_H #define TAO_NVLIST_H +#include "tao/orbconf.h" + +#if !defined (TAO_HAS_MINIMUM_CORBA) + #include "ace/Containers_T.h" #include "tao/Any.h" @@ -312,4 +316,6 @@ private: # include "tao/NVList.i" #endif /* __ACE_INLINE__ */ +#endif /* TAO_HAS_MINIMUM_CORBA */ + #endif /* TAO_NVLIST_H */ diff --git a/TAO/tao/ORB.cpp b/TAO/tao/ORB.cpp index 4634001bac0..ae81f91b4bc 100644 --- a/TAO/tao/ORB.cpp +++ b/TAO/tao/ORB.cpp @@ -26,6 +26,7 @@ #include "tao/CDR_Interpreter.h" #include "tao/debug.h" #include "tao/TAO_Internal.h" +#include "tao/CDR.h" #if !defined (__ACE_INLINE__) # include "tao/ORB.i" @@ -56,6 +57,8 @@ ACE_TIMEPROBE_EVENT_DESCRIPTIONS (TAO_ORB_Timeprobe_Description, #endif /* ACE_ENABLE_TIMEPROBES */ +#if !defined (TAO_HAS_MINIMUM_CORBA) + // Typecode stuff for the InconsistentTypeCode exception static const CORBA::Long _oc_CORBA_ORB_InconsistentTypeCode[] = { @@ -91,6 +94,12 @@ static CORBA::TypeCode _tc_TAO_tc_CORBA_ORB_InconsistentTypeCode ( 0, sizeof (CORBA_ORB_InconsistentTypeCode)); +// ORB exception typecode initialization. +CORBA::TypeCode_ptr CORBA_ORB::_tc_InconsistentTypeCode = + &_tc_TAO_tc_CORBA_ORB_InconsistentTypeCode; + +#endif /* TAO_HAS_MINIMUM_CORBA */ + // = Static initialization. // Count of the number of ORBs. @@ -99,10 +108,6 @@ int CORBA_ORB::orb_init_count_ = 0; // Pointer to the "default ORB." CORBA::ORB_ptr CORBA::instance_ = 0; -// ORB exception typecode initialization. -CORBA::TypeCode_ptr CORBA_ORB::_tc_InconsistentTypeCode = - &_tc_TAO_tc_CORBA_ORB_InconsistentTypeCode; - CORBA_String_var::CORBA_String_var (char *p) : ptr_ (p) { @@ -280,6 +285,8 @@ CORBA_ORB::shutdown (CORBA::Boolean wait_for_completion) return; } +#if !defined (TAO_HAS_MINIMUM_CORBA) + void CORBA_ORB::create_list (CORBA::Long count, CORBA::NVList_ptr &retval) @@ -316,6 +323,15 @@ CORBA_ORB::perform_work (const ACE_Time_Value &tv) return r->handle_events (tmp_tv); } +CORBA::Boolean +CORBA_ORB::work_pending (void) +{ + // There's ALWAYS work to do ;-) + return 1; +} + +#endif /* TAO_HAS_MINIMUM_CORBA */ + int CORBA_ORB::run (ACE_Time_Value *tv, int break_on_timeouts) @@ -624,9 +640,9 @@ CORBA_ORB::multicast_query (char *buf, ACE_SOCK_Dgram response; ACE_INET_Addr response_addr; - // Dgram for multicasting to ORB service locator. + // Dgram for multicasting to ORB service locator. ACE_SOCK_Dgram_Mcast multicast; - ACE_INET_Addr multicast_addr (port, + ACE_INET_Addr multicast_addr (port, ACE_DEFAULT_MULTICAST_ADDR); // Subscribe to multicast address. @@ -700,7 +716,7 @@ CORBA_ORB::multicast_query (char *buf, "# of bytes sent is %d.\n", response_addr.get_port_number (), result)); - + // Receive response message. result = response.recv (buf, ACE_MAX_DGRAM_SIZE, @@ -918,6 +934,8 @@ CORBA_ORB::leader_follower_info (void) return leader_follower_info_; } +#if !defined (TAO_HAS_MINIMUM_CORBA) + // Dynamic Any factory functions. ACE_INLINE @@ -976,6 +994,8 @@ CORBA_ORB::create_dyn_enum (CORBA_TypeCode_ptr tc, return TAO_DynAny_i::create_dyn_enum (tc, env); } +#endif /* TAO_HAS_MINIMUM_CORBA */ + // String utility support; this needs to be integrated with the ORB's // own memory allocation subsystem. diff --git a/TAO/tao/ORB.h b/TAO/tao/ORB.h index f944fb6f342..13090974d96 100644 --- a/TAO/tao/ORB.h +++ b/TAO/tao/ORB.h @@ -75,14 +75,14 @@ typedef struct TAO_Leader_Follower_Info_Struct { ACE_SYNCH_MUTEX leader_follower_lock_; // do protect the access to the following three members - + ACE_Unbounded_Set<ACE_SYNCH_CONDITION *> follower_set_; // keep a set of followers around (protected) int leaders_; // 0 if no leader is around, 1 if there is a leader // > 1 if we do nested upcalls (protected) - + ACE_thread_t leader_thread_ID_; // thread ID of the leader thread (protected) } TAO_Leader_Follower_Info; @@ -248,6 +248,8 @@ public: // must implement this and determine what is a collocated object // based on information provided in the STUB_Object. +#if !defined (TAO_HAS_MINIMUM_CORBA) + void create_list (CORBA::Long count, CORBA::NVList_ptr &retval); @@ -270,6 +272,8 @@ public: // It is platform-specific how the application and ORB arrange to // use compatible threading primitives. +#endif /* TAO_HAS_MINIMUM_CORBA */ + int run (void); int run (ACE_Time_Value &tv); int run (ACE_Time_Value *tv); @@ -370,6 +374,9 @@ public: int should_shutdown (void); // Get the shutdown flag value + +#if !defined (TAO_HAS_MINIMUM_CORBA) + // Forward declaration and typedefs for the exception thrown by // the ORB Dynamic Any factory functions. class CORBA_ORB_InconsistentTypeCode; @@ -401,6 +408,7 @@ public: CORBA_DynEnum_ptr create_dyn_enum (CORBA_TypeCode_ptr tc, CORBA::Environment &TAO_IN_ENV); +#endif /* TAO_HAS_MINIMUM_CORBA */ protected: // We must be created via the <ORB_init> call. diff --git a/TAO/tao/ORB.i b/TAO/tao/ORB.i index 7ca1a1c74b0..75f99ee6f77 100644 --- a/TAO/tao/ORB.i +++ b/TAO/tao/ORB.i @@ -221,13 +221,6 @@ CORBA::is_nil (CORBA::ORB_ptr obj) } ACE_INLINE CORBA::Boolean -CORBA_ORB::work_pending (void) -{ - // There's ALWAYS work to do ;-) - return 1; -} - -ACE_INLINE CORBA::Boolean CORBA_ORB::orb_free_resources (void) { return !CORBA_ORB::orb_init_count_; @@ -395,4 +388,3 @@ CORBA_ORB_out::operator-> (void) { return this->ptr_; } - diff --git a/TAO/tao/Object.cpp b/TAO/tao/Object.cpp index f3c37f89cf6..f56cb8ce1ef 100644 --- a/TAO/tao/Object.cpp +++ b/TAO/tao/Object.cpp @@ -47,104 +47,6 @@ CORBA_Object::CORBA_Object (STUB_Object *protocol_proxy, // implicitly takes a reference. } -CORBA::InterfaceDef_ptr -CORBA_Object::_get_interface (CORBA::Environment &ACE_TRY_ENV) -{ - // @@ TODO this method will require some modifications once the - // interface repository is implemented. The modifications are - // documented with @@ comments. - - // @@ this should use the _nil() method... - CORBA::InterfaceDef_ptr _tao_retval = 0; - - STUB_Object *istub = this->_stubobj (); - if (istub == 0) - ACE_THROW_RETURN (CORBA::INV_OBJREF (CORBA::COMPLETED_NO), _tao_retval); - - - TAO_GIOP_Twoway_Invocation _tao_call ( - istub, - "_interface", - TAO_ORB_Core_instance () - ); - - - // If we get forwarded we have to return to this point: -_tao_start_again: - - ACE_TRY_EX (_tao_START_FAILED) - { - _tao_call.start (ACE_TRY_ENV); - ACE_TRY_CHECK_EX (_tao_START_FAILED); - } - ACE_CATCH (CORBA_SystemException, ex) - { - if (istub->next_profile_retry ()) - { - ACE_TRY_ENV.clear (); - goto _tao_start_again; - } - ACE_RETHROW; - } - ACE_ENDTRY; - ACE_CHECK_RETURN (_tao_retval); - - TAO_GIOP_ReplyStatusType _invoke_status = TAO_GIOP_NO_EXCEPTION; - ACE_TRY_EX (_tao_INVOKE_FAILED) - { - _invoke_status = - _tao_call.invoke (0, 0, ACE_TRY_ENV); - ACE_TRY_CHECK_EX (_tao_INVOKE_FAILED); - } - ACE_CATCH (CORBA_SystemException, ex) - { - if (istub->next_profile_retry ()) - { - ACE_TRY_ENV.clear (); - goto _tao_start_again; - } - ACE_RETHROW; - } - ACE_ENDTRY; - ACE_CHECK_RETURN (_tao_retval); - - if (_invoke_status == TAO_GIOP_NO_EXCEPTION) - { - istub->set_valid_profile (); -#if 0 - TAO_InputCDR &_tao_in = _tao_call.inp_stream (); - // @@ The extraction operation (>>) for InterfaceDef will be - // defined, and thus this code will work. Right now we raise a - // MARSHAL exception.... - if (!( - (_tao_in >> _tao_retval) - )) - ACE_THROW_RETURN (CORBA::MARSHAL (CORBA::COMPLETED_NO), _tao_retval); -#else - ACE_UNUSED_ARG (_tao_retval); - ACE_THROW_RETURN (CORBA::MARSHAL (CORBA::COMPLETED_NO), _tao_retval); -#endif - - } - else if (_invoke_status == TAO_GIOP_LOCATION_FORWARD) - { - if (istub->next_profile ()) - { - ACE_TRY_ENV.clear (); - goto _tao_start_again; - } - ACE_THROW_RETURN (CORBA::TRANSIENT (CORBA::COMPLETED_NO), _tao_retval); - - } - else - { - ACE_THROW_RETURN (CORBA::UNKNOWN (CORBA::COMPLETED_MAYBE), _tao_retval); - - } - // @@ This statement is not reached due to the #if 0 above... - ACE_NOTREACHED (return _tao_retval); -} - // IS_A ... ask the object if it's an instance of the type whose // logical type ID is passed as a parameter. @@ -281,12 +183,6 @@ CORBA_Object::_is_collocated (void) const return this->is_collocated_; } -CORBA::ImplementationDef_ptr -CORBA_Object::_get_implementation (CORBA::Environment &) -{ - return 0; -} - // NON_EXISTENT ... send a simple call to the object, which will // either elicit a FALSE response or a OBJECT_NOT_EXIST exception. In // the latter case, return FALSE. @@ -426,8 +322,10 @@ CORBA::Object::_use_locate_requests (CORBA::Boolean use_it) return; } +#if !defined (TAO_HAS_MINIMUM_CORBA) + void -CORBA_Object::_create_request (CORBA::Context_ptr ctx, +CORBA_Object::_create_request (CORBA::Context_ptr ctx, const CORBA::Char *operation, CORBA::NVList_ptr arg_list, CORBA::NamedValue_ptr result, @@ -437,7 +335,7 @@ CORBA_Object::_create_request (CORBA::Context_ptr ctx, { // Since we don't really support Context, anything but a null pointer // is a no-no. - if (ctx) + if (ctx) { TAO_THROW(CORBA::NO_IMPLEMENT (CORBA::COMPLETED_NO)); } @@ -452,6 +350,104 @@ CORBA_Object::_request (const CORBA::Char *operation, return new CORBA::Request (this, operation); } +CORBA::InterfaceDef_ptr +CORBA_Object::_get_interface (CORBA::Environment &ACE_TRY_ENV) +{ + // @@ TODO this method will require some modifications once the + // interface repository is implemented. The modifications are + // documented with @@ comments. + + // @@ this should use the _nil() method... + CORBA::InterfaceDef_ptr _tao_retval = 0; + + STUB_Object *istub = this->_stubobj (); + if (istub == 0) + ACE_THROW_RETURN (CORBA::INV_OBJREF (CORBA::COMPLETED_NO), _tao_retval); + + + TAO_GIOP_Twoway_Invocation _tao_call ( + istub, + "_interface", + TAO_ORB_Core_instance () + ); + + + // If we get forwarded we have to return to this point: +_tao_start_again: + + ACE_TRY_EX (_tao_START_FAILED) + { + _tao_call.start (ACE_TRY_ENV); + ACE_TRY_CHECK_EX (_tao_START_FAILED); + } + ACE_CATCH (CORBA_SystemException, ex) + { + if (istub->next_profile_retry ()) + { + ACE_TRY_ENV.clear (); + goto _tao_start_again; + } + ACE_RETHROW; + } + ACE_ENDTRY; + ACE_CHECK_RETURN (_tao_retval); + + TAO_GIOP_ReplyStatusType _invoke_status; + ACE_TRY_EX (_tao_INVOKE_FAILED) + { + _invoke_status = + _tao_call.invoke (0, 0, ACE_TRY_ENV); + ACE_TRY_CHECK_EX (_tao_INVOKE_FAILED); + } + ACE_CATCH (CORBA_SystemException, ex) + { + if (istub->next_profile_retry ()) + { + ACE_TRY_ENV.clear (); + goto _tao_start_again; + } + ACE_RETHROW; + } + ACE_ENDTRY; + ACE_CHECK_RETURN (_tao_retval); + + if (_invoke_status == TAO_GIOP_NO_EXCEPTION) + { + istub->set_valid_profile (); +#if 0 + TAO_InputCDR &_tao_in = _tao_call.inp_stream (); + // @@ The extraction operation (>>) for InterfaceDef will be + // defined, and thus this code will work. Right now we raise a + // MARSHAL exception.... + if (!( + (_tao_in >> _tao_retval) + )) + ACE_THROW_RETURN (CORBA::MARSHAL (CORBA::COMPLETED_NO), _tao_retval); +#else + ACE_UNUSED_ARG (_tao_retval); + ACE_THROW_RETURN (CORBA::MARSHAL (CORBA::COMPLETED_NO), _tao_retval); +#endif + + } + else if (_invoke_status == TAO_GIOP_LOCATION_FORWARD) + { + if (istub->next_profile ()) + { + ACE_TRY_ENV.clear (); + goto _tao_start_again; + } + ACE_THROW_RETURN (CORBA::TRANSIENT (CORBA::COMPLETED_NO), _tao_retval); + + } + else + { + ACE_THROW_RETURN (CORBA::UNKNOWN (CORBA::COMPLETED_MAYBE), _tao_retval); + + } + // @@ This statement is not reached due to the #if 0 above... + ACE_NOTREACHED (return _tao_retval); +} + // **************************************************************** CORBA::Boolean @@ -636,6 +632,14 @@ operator>> (TAO_InputCDR& cdr, CORBA_Object*& x) return cdr.good_bit (); } +CORBA::ImplementationDef_ptr +CORBA_Object::_get_implementation (CORBA::Environment &) +{ + return 0; +} + +#endif /* TAO_HAS_MINIMUM_CORBA */ + // **************************************************************** TAO_Object_Field::~TAO_Object_Field (void) diff --git a/TAO/tao/Object.h b/TAO/tao/Object.h index 2f2e1da3410..2f7036c58a6 100644 --- a/TAO/tao/Object.h +++ b/TAO/tao/Object.h @@ -51,9 +51,6 @@ public: // making such calls, but may be overridden when it appears // appropriate. - virtual CORBA::InterfaceDef_ptr _get_interface (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - // Interface repository related operation - virtual CORBA::Boolean _is_a (const CORBA::Char *logical_type_id, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); // determine if we are of the type specified by the "logical_type_id" @@ -68,12 +65,17 @@ public: virtual CORBA::Boolean _is_collocated (void) const; // are we collocated with the servant? + virtual CORBA::Boolean _non_existent (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); + +#if !defined (TAO_HAS_MINIMUM_CORBA) + virtual CORBA::ImplementationDef_ptr _get_implementation (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); // This method is deprecated in the CORBA 2.2 spec, we just return 0 // every time. - virtual CORBA::Boolean _non_existent (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); + virtual CORBA::InterfaceDef_ptr _get_interface (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); + // Interface repository related operation virtual void _create_request (CORBA::Context_ptr ctx, const CORBA::Char *operation, @@ -96,6 +98,8 @@ public: CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); // DII operation to create a request. +#endif /* TAO_HAS_MINIMUM_CORBA */ + virtual CORBA::ULong _hash (CORBA::ULong maximum, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); // Return a (potentially non-unique) hash value for this object. diff --git a/TAO/tao/POA.cpp b/TAO/tao/POA.cpp index 9d3d6d32003..867a87ef9b7 100644 --- a/TAO/tao/POA.cpp +++ b/TAO/tao/POA.cpp @@ -7,6 +7,7 @@ #include "tao/ORB_Core.h" #include "tao/Server_Request.h" #include "tao/Server_Strategy_Factory.h" +#include "tao/Environment.h" // Forwarding Servant class #include "tao/Forwarding_Servant.h" @@ -71,6 +72,8 @@ ACE_TIMEPROBE_EVENT_DESCRIPTIONS (TAO_POA_Timeprobe_Description, #endif /* ACE_ENABLE_TIMEPROBES */ +#if !defined (TAO_HAS_MINIMUM_CORBA) + TAO_Thread_Policy::TAO_Thread_Policy (PortableServer::ThreadPolicyValue value, PortableServer::POA_ptr poa) : value_ (value), @@ -136,13 +139,13 @@ TAO_Thread_Policy::policy_type (CORBA::Environment &env) return 0; } -/* PortableServer::POA_ptr TAO_Thread_Policy::_default_POA (CORBA::Environment &env) { return PortableServer::POA::_duplicate (this->poa_.in ()); } -*/ + +#endif /* TAO_HAS_MINIMUM_CORBA */ TAO_Lifespan_Policy::TAO_Lifespan_Policy (PortableServer::LifespanPolicyValue value, PortableServer::POA_ptr poa) @@ -208,13 +211,11 @@ TAO_Lifespan_Policy::policy_type (CORBA::Environment &env) return 0; } -/* PortableServer::POA_ptr TAO_Lifespan_Policy::_default_POA (CORBA::Environment &env) { return PortableServer::POA::_duplicate (this->poa_.in ()); } -*/ TAO_Id_Uniqueness_Policy::TAO_Id_Uniqueness_Policy (PortableServer::IdUniquenessPolicyValue value, PortableServer::POA_ptr poa) @@ -280,13 +281,11 @@ TAO_Id_Uniqueness_Policy::policy_type (CORBA::Environment &env) return 0; } -/* PortableServer::POA_ptr TAO_Id_Uniqueness_Policy::_default_POA (CORBA::Environment &env) { return PortableServer::POA::_duplicate (this->poa_.in ()); } -*/ TAO_Id_Assignment_Policy::TAO_Id_Assignment_Policy (PortableServer::IdAssignmentPolicyValue value, PortableServer::POA_ptr poa) @@ -352,13 +351,13 @@ TAO_Id_Assignment_Policy::policy_type (CORBA::Environment &env) return 0; } -/* PortableServer::POA_ptr TAO_Id_Assignment_Policy::_default_POA (CORBA::Environment &env) { return PortableServer::POA::_duplicate (this->poa_.in ()); } -*/ + +#if !defined (TAO_HAS_MINIMUM_CORBA) TAO_Implicit_Activation_Policy::TAO_Implicit_Activation_Policy (PortableServer::ImplicitActivationPolicyValue value, PortableServer::POA_ptr poa) @@ -424,13 +423,11 @@ TAO_Implicit_Activation_Policy::policy_type (CORBA::Environment &env) return 0; } -/* PortableServer::POA_ptr TAO_Implicit_Activation_Policy::_default_POA (CORBA::Environment &env) { return PortableServer::POA::_duplicate (this->poa_.in ()); } -*/ TAO_Servant_Retention_Policy::TAO_Servant_Retention_Policy (PortableServer::ServantRetentionPolicyValue value, PortableServer::POA_ptr poa) @@ -496,13 +493,11 @@ TAO_Servant_Retention_Policy::policy_type (CORBA::Environment &env) return 0; } -/* PortableServer::POA_ptr TAO_Servant_Retention_Policy::_default_POA (CORBA::Environment &env) { return PortableServer::POA::_duplicate (this->poa_.in ()); } -*/ TAO_Request_Processing_Policy::TAO_Request_Processing_Policy (PortableServer::RequestProcessingPolicyValue value, PortableServer::POA_ptr poa) @@ -568,91 +563,13 @@ TAO_Request_Processing_Policy::policy_type (CORBA::Environment &env) return 0; } -/* PortableServer::POA_ptr TAO_Request_Processing_Policy::_default_POA (CORBA::Environment &env) { return PortableServer::POA::_duplicate (this->poa_.in ()); } -*/ - -// ************************************************** -// -// TAO spcific POA locking policy (non-standard) -// -// ************************************************** - -TAO_Synchronization_Policy::TAO_Synchronization_Policy (PortableServer::SynchronizationPolicyValue value, - PortableServer::POA_ptr poa) - : value_ (value), - poa_ (PortableServer::POA::_duplicate (poa)) -{ -} - -TAO_Synchronization_Policy::TAO_Synchronization_Policy (const TAO_Synchronization_Policy &rhs) - : value_ (rhs.value_), - poa_ (PortableServer::POA::_duplicate (rhs.poa_.in ())) -{ -} - -PortableServer::SynchronizationPolicyValue -TAO_Synchronization_Policy::value (CORBA::Environment &env) -{ - ACE_UNUSED_ARG (env); - return this->value_; -} - -CORBA::Policy_ptr -TAO_Synchronization_Policy::copy (CORBA::Environment &env) -{ - auto_ptr<TAO_Synchronization_Policy> new_policy (new TAO_Synchronization_Policy (*this)); - - CORBA::Policy_var result = new_policy->_this (env); - if (env.exception () != 0) - return CORBA::Policy::_nil (); - else - { - // Make sure that the auto_ptr does not delete the - // implementation object - new_policy.release (); - return result._retn (); - } -} -void -TAO_Synchronization_Policy::destroy (CORBA::Environment &env) -{ - // Remove self from POA - // - // Note that there is no real error checking here as we can't do - // much about errors here anyway - // - PortableServer::POA_var poa = this->_default_POA (env); - if (env.exception () == 0) - { - PortableServer::ObjectId_var id = poa->servant_to_id (this, env); - if (env.exception () == 0) - poa->deactivate_object (id.in (), env); - } - - // Commit suicide: must have been dynamically allocated - delete this; -} - -CORBA::PolicyType -TAO_Synchronization_Policy::policy_type (CORBA::Environment &env) -{ - ACE_UNUSED_ARG (env); - return 0; -} - -/* -PortableServer::POA_ptr -TAO_Synchronization_Policy::_default_POA (CORBA::Environment &env) -{ - return PortableServer::POA::_duplicate (this->poa_.in ()); -} -*/ +#endif /* TAO_HAS_MINIMUM_CORBA */ TAO_POA_Policies::TAO_POA_Policies (void) : thread_ (PortableServer::ORB_CTRL_MODEL), @@ -661,8 +578,7 @@ TAO_POA_Policies::TAO_POA_Policies (void) id_assignment_ (PortableServer::SYSTEM_ID), implicit_activation_ (PortableServer::NO_IMPLICIT_ACTIVATION), servant_retention_ (PortableServer::RETAIN), - request_processing_ (PortableServer::USE_ACTIVE_OBJECT_MAP_ONLY), - synchronization_ (PortableServer::DEFAULT_LOCK) + request_processing_ (PortableServer::USE_ACTIVE_OBJECT_MAP_ONLY) { } @@ -718,6 +634,9 @@ void TAO_POA_Policies::parse_policy (const CORBA::Policy_ptr policy, CORBA::Environment &env) { + +#if !defined (TAO_HAS_MINIMUM_CORBA) + PortableServer::ThreadPolicy_var thread = PortableServer::ThreadPolicy::_narrow (policy, env); if (!CORBA::is_nil (thread.in ())) @@ -730,6 +649,8 @@ TAO_POA_Policies::parse_policy (const CORBA::Policy_ptr policy, env.clear (); } +#endif /* TAO_HAS_MINIMUM_CORBA */ + PortableServer::LifespanPolicy_var lifespan = PortableServer::LifespanPolicy::_narrow (policy, env); if (!CORBA::is_nil (lifespan.in ())) @@ -766,6 +687,8 @@ TAO_POA_Policies::parse_policy (const CORBA::Policy_ptr policy, env.clear (); } +#if !defined (TAO_HAS_MINIMUM_CORBA) + PortableServer::ImplicitActivationPolicy_var implicit_activation = PortableServer::ImplicitActivationPolicy::_narrow (policy, env); if (!CORBA::is_nil (implicit_activation.in ())) @@ -802,17 +725,7 @@ TAO_POA_Policies::parse_policy (const CORBA::Policy_ptr policy, env.clear (); } - PortableServer::SynchronizationPolicy_var synchronization - = PortableServer::SynchronizationPolicy::_narrow (policy, env); - if (!CORBA::is_nil (synchronization.in ())) - { - this->synchronization_ = synchronization->value (env); - return; - } - else - { - env.clear (); - } +#endif /* TAO_HAS_MINIMUM_CORBA */ CORBA::Exception *exception = new PortableServer::POA::InvalidPolicy; env.exception (exception); @@ -829,10 +742,16 @@ TAO_POA::TAO_POA (const TAO_POA::String &adapter_name, policies_ (policies), parent_ (parent), active_object_map_ (0), + +#if !defined (TAO_HAS_MINIMUM_CORBA) + adapter_activator_ (), servant_activator_ (), servant_locator_ (), default_servant_ (0), + +#endif /* TAO_HAS_MINIMUM_CORBA */ + children_ (), lock_ (0), closing_down_ (0), @@ -856,41 +775,20 @@ TAO_POA::TAO_POA (const TAO_POA::String &adapter_name, void TAO_POA::create_active_object_map (void) { - int user_id_policy = !this->system_id (); - int unique_id_policy = this->policies ().id_uniqueness () == PortableServer::UNIQUE_ID; - - // Create the active_object_map ACE_NEW (this->active_object_map_, - TAO_Active_Object_Map (user_id_policy, - unique_id_policy)); + TAO_Active_Object_Map (!this->system_id (), + this->policies ().id_uniqueness () == PortableServer::UNIQUE_ID, + this->policies ().lifespan () == PortableServer::PERSISTENT, + TAO_ORB_Core_instance ()->server_factory ()->active_object_map_creation_parameters ())); } void TAO_POA::create_internal_lock (void) { - switch (this->policies ().synchronization ()) - { - case PortableServer::DEFAULT_LOCK: - // Ask the server factory to create the lock. svc.conf will be - // consulted. If the user did not specify any preference in - // svc.conf, THREAD_LOCK will be the default. - this->lock_ = TAO_ORB_Core_instance ()->server_factory ()->create_poa_lock (); - break; - - case PortableServer::THREAD_LOCK: -#if defined (ACE_HAS_THREADS) - // Thread lock - ACE_NEW (this->lock_, ACE_Lock_Adapter<ACE_Recursive_Thread_Mutex>); - break; -#else - /* FALL THROUGH */ -#endif /* ACE_HAS_THREADS */ - - case PortableServer::NULL_LOCK: - // Null lock - ACE_NEW (this->lock_, ACE_Lock_Adapter<ACE_Null_Mutex>); - break; - } + // Ask the server factory to create the lock. svc.conf will be + // consulted. If the user did not specify any preference in + // svc.conf, THREAD_LOCK will be the default. + this->lock_ = TAO_ORB_Core_instance ()->server_factory ()->create_poa_lock (); } TAO_POA::~TAO_POA (void) @@ -1095,6 +993,8 @@ TAO_POA::find_POA_i_optimized (const TAO_POA::String &adapter_name, if (result != -1) return child_poa; +#if !defined (TAO_HAS_MINIMUM_CORBA) + // // Child was not found // @@ -1133,6 +1033,8 @@ TAO_POA::find_POA_i_optimized (const TAO_POA::String &adapter_name, } } +#endif /* TAO_HAS_MINIMUM_CORBA */ + // Otherwise, the AdapterNonExistent exception is raised. CORBA::Exception *exception = new PortableServer::POA::AdapterNonExistent; env.exception (exception); @@ -1239,6 +1141,9 @@ TAO_POA::destroy_i (CORBA::Boolean etherealize_objects, // Remove the registered objects if (etherealize_objects) { + +#if !defined (TAO_HAS_MINIMUM_CORBA) + if (this->policies ().servant_retention () == PortableServer::RETAIN && this->policies ().request_processing () == PortableServer::USE_SERVANT_MANAGER && !CORBA::is_nil (this->servant_activator_.in ())) @@ -1249,38 +1154,48 @@ TAO_POA::destroy_i (CORBA::Boolean etherealize_objects, while (1) { - TAO_Active_Object_Map::iterator iterator = this->active_object_map ().begin (); - if (iterator == this->active_object_map ().end () - || env.exception () != 0) - break; - + PortableServer::ObjectId object_id; PortableServer::Servant servant = 0; - PortableServer::ObjectId id ((*iterator).id_); + CORBA::Boolean remaining_activations = 0; - // Remove from the active object map - int result = this->active_object_map ().unbind (id, servant); - if (result != 0) + // Remove an entry from the active object map, returning + // the object id, the servant pointer, and remaining + // activations of the servant. + // + // int result = this->active_object_map ().unbind (object_id, + // servant, + // remaining_activations); + + int result = 1; + + // Nothing to unbind. + if (result == 1) + { + break; + } + // Errors. + else if (result != 0) { CORBA::Exception *exception = new CORBA::OBJ_ADAPTER (CORBA::COMPLETED_NO); env.exception (exception); return; } - - CORBA::Boolean remaining_activations = 0; - - // Check for remaining activations - if (this->policies ().id_uniqueness () == PortableServer::MULTIPLE_ID && - this->active_object_map ().find (servant) != -1) - remaining_activations = 1; - - this->servant_activator_->etherealize (id, - self.in (), - servant, - 1, - remaining_activations, - env); + // Successful unbind. + else + { + // Etherealize servant. + this->servant_activator_->etherealize (object_id, + self.in (), + servant, + 1, + remaining_activations, + env); + } } } + +#endif /* TAO_HAS_MINIMUM_CORBA */ + } // If the wait_for_completion parameter is TRUE, the destroy @@ -1324,6 +1239,8 @@ TAO_POA::delete_child_i (const TAO_POA::String &child, } } +#if !defined (TAO_HAS_MINIMUM_CORBA) + PortableServer::ServantManager_ptr TAO_POA::get_servant_manager_i (CORBA::Environment &env) { @@ -1429,6 +1346,8 @@ TAO_POA::set_servant_i (PortableServer::Servant servant, this->default_servant_ = servant; } +#endif /* TAO_HAS_MINIMUM_CORBA */ + PortableServer::ObjectId * TAO_POA::activate_object_i (PortableServer::Servant servant, CORBA::Environment &env) @@ -1447,7 +1366,7 @@ TAO_POA::activate_object_i (PortableServer::Servant servant, // already in the Active Object Map, the ServantAlreadyActive // exception is raised. if (this->policies ().id_uniqueness () == PortableServer::UNIQUE_ID && - this->active_object_map ().find (servant) != -1) + this->active_object_map ().is_servant_in_map (servant)) { CORBA::Exception *exception = new PortableServer::POA::ServantAlreadyActive; env.exception (exception); @@ -1457,12 +1376,9 @@ TAO_POA::activate_object_i (PortableServer::Servant servant, // Otherwise, the activate_object operation generates an Object Id // and enters the Object Id and the specified servant in the Active // Object Map. The Object Id is returned. - PortableServer::ObjectId_var new_id = this->create_object_id (servant, env); - if (env.exception () != 0) - return 0; - - // Add to the active object map - if (this->active_object_map ().bind (new_id.in (), servant) == -1) + PortableServer::ObjectId_var user_id; + if (this->active_object_map ().bind_using_system_id_returning_user_id (servant, + user_id.out ()) == -1) { CORBA::Exception *exception = new CORBA::OBJ_ADAPTER (CORBA::COMPLETED_NO); env.exception (exception); @@ -1470,7 +1386,7 @@ TAO_POA::activate_object_i (PortableServer::Servant servant, } // Everything is finally ok - return new_id._retn (); + return user_id._retn (); } void @@ -1507,7 +1423,7 @@ TAO_POA::activate_object_with_id_i (const PortableServer::ObjectId &id, // If the CORBA object denoted by the Object Id value is already // active in this POA (there is a servant bound to it in the Active // Object Map), the ObjectAlreadyActive exception is raised. - if (this->active_object_map ().find (id) != -1) + if (this->active_object_map ().is_user_id_in_map (id)) { CORBA::Exception *exception = new PortableServer::POA::ObjectAlreadyActive; env.exception (exception); @@ -1518,7 +1434,7 @@ TAO_POA::activate_object_with_id_i (const PortableServer::ObjectId &id, // the Active Object Map, the ServantAlreadyActive exception is // raised. if (this->policies ().id_uniqueness () == PortableServer::UNIQUE_ID && - this->active_object_map ().find (servant) != -1) + this->active_object_map ().is_servant_in_map (servant)) { CORBA::Exception *exception = new PortableServer::POA::ServantAlreadyActive; env.exception (exception); @@ -1528,7 +1444,7 @@ TAO_POA::activate_object_with_id_i (const PortableServer::ObjectId &id, // Otherwise, the activate_object_with_id operation enters an // association between the specified Object Id and the specified // servant in the Active Object Map. - if (this->active_object_map ().bind (id, servant) == -1) + if (this->active_object_map ().bind_using_user_id (servant, id) == -1) { CORBA::Exception *exception = new CORBA::OBJ_ADAPTER (CORBA::COMPLETED_NO); env.exception (exception); @@ -1539,7 +1455,7 @@ TAO_POA::activate_object_with_id_i (const PortableServer::ObjectId &id, } void -TAO_POA::deactivate_object_i (const PortableServer::ObjectId &oid, +TAO_POA::deactivate_object_i (const PortableServer::ObjectId &id, CORBA::Environment &env) { // This operation requires the RETAIN policy; if not present, the @@ -1554,8 +1470,7 @@ TAO_POA::deactivate_object_i (const PortableServer::ObjectId &oid, // This operation causes the association of the Object Id specified // by the oid parameter and its servant to be removed from the // Active Object Map. - PortableServer::Servant servant = 0; - int result = this->active_object_map ().unbind (oid, servant); + int result = this->active_object_map ().unbind_using_user_id (id); // If there is no active object associated with the specified Object // Id, the operation raises an ObjectNotActive exception. @@ -1566,6 +1481,8 @@ TAO_POA::deactivate_object_i (const PortableServer::ObjectId &oid, return; } +#if !defined (TAO_HAS_MINIMUM_CORBA) + // If a servant manager is associated with the POA, // ServantLocator::etherealize will be invoked with the oid and the // servant. (The deactivate_object operation does not wait for the @@ -1584,20 +1501,24 @@ TAO_POA::deactivate_object_i (const PortableServer::ObjectId &oid, if (env.exception () != 0) return; + // Place holders.... + PortableServer::Servant servant = 0; CORBA::Boolean remaining_activations = 0; + int disabled = 1; - // Check for remaining activations - if (this->policies ().id_uniqueness () == PortableServer::MULTIPLE_ID && - this->active_object_map ().find (servant) != -1) - remaining_activations = 1; - - this->servant_activator_->etherealize (oid, - self.in (), - servant, - 0, - remaining_activations, - env); + if (disabled) + { + this->servant_activator_->etherealize (id, + self.in (), + servant, + 0, + remaining_activations, + env); + } } + +#endif /* TAO_HAS_MINIMUM_CORBA */ + } CORBA::Object_ptr @@ -1621,20 +1542,26 @@ TAO_POA::create_reference_i (const char *intf, // appropriate servant manager to be invoked, if one is // available. The generated Object Id value may be obtained by // invoking POA::reference_to_id with the created reference. - PortableServer::ObjectId_var new_id = this->create_object_id (0, env); - if (env.exception () != 0) - return CORBA::Object::_nil (); + PortableServer::ObjectId_var system_id; + if (this->active_object_map ().bind_using_system_id_returning_system_id (0, + system_id.out ()) == -1) + { + CORBA::Exception *exception = new CORBA::OBJ_ADAPTER (CORBA::COMPLETED_NO); + env.exception (exception); + return 0; + } - TAO_ObjectKey_var new_key = this->create_object_key (new_id.in ()); + // Create object key. + TAO_ObjectKey_var key = this->create_object_key (system_id.in ()); // Ask the ORB to create you a reference - return TAO_ORB_Core_instance ()->orb ()->key_to_object (new_key.in (), intf, env); + return TAO_ORB_Core_instance ()->orb ()->key_to_object (key.in (), intf, env); } CORBA::Object_ptr -TAO_POA::create_reference_with_id (const PortableServer::ObjectId &oid, - const char *intf, - CORBA::Environment &env) +TAO_POA::create_reference_with_id_i (const PortableServer::ObjectId &user_id, + const char *intf, + CORBA::Environment &env) { // If the POA has the SYSTEM_ID policy and it detects that the // Object Id value was not generated by the system or for this POA, @@ -1646,7 +1573,7 @@ TAO_POA::create_reference_with_id (const PortableServer::ObjectId &oid, // system for that POA, or, if the POA also has the PERSISTENT // policy, for a previous instantiation of the same POA. if (this->policies ().id_assignment () == PortableServer::SYSTEM_ID && - !this->is_poa_generated_id (oid)) + !this->is_poa_generated_id (user_id)) { CORBA::Exception *exception = new CORBA::BAD_PARAM (CORBA::COMPLETED_NO); env.exception (exception); @@ -1660,10 +1587,20 @@ TAO_POA::create_reference_with_id (const PortableServer::ObjectId &oid, // requests on those references will cause the object to be // activated if necessary, or the default servant used, depending on // the applicable policies. - TAO_ObjectKey_var new_key = this->create_object_key (oid); + PortableServer::ObjectId_var system_id; + if (this->active_object_map ().find_system_id_using_user_id (user_id, + system_id.out ()) == -1) + { + CORBA::Exception *exception = new CORBA::OBJ_ADAPTER (CORBA::COMPLETED_NO); + env.exception (exception); + return 0; + } + + // Create object key. + TAO_ObjectKey_var key = this->create_object_key (system_id.in ()); // Ask the ORB to create you a reference - return TAO_ORB_Core_instance ()->orb ()->key_to_object (new_key.in (), intf, env); + return TAO_ORB_Core_instance ()->orb ()->key_to_object (key.in (), intf, env); } PortableServer::ObjectId * @@ -1686,11 +1623,12 @@ TAO_POA::servant_to_id_i (PortableServer::Servant servant, // If the POA has the UNIQUE_ID policy and the specified servant is // active, the Object Id associated with that servant is returned. - PortableServer::ObjectId id; + PortableServer::ObjectId_var user_id; if (this->policies ().id_uniqueness () == PortableServer::UNIQUE_ID && - this->active_object_map ().find (servant, id) != -1) + this->active_object_map ().find_user_id_using_servant (servant, + user_id.out ()) != -1) { - return new PortableServer::ObjectId (id); + return user_id._retn (); } // If the POA has the IMPLICIT_ACTIVATION policy and either the POA @@ -1701,13 +1639,68 @@ TAO_POA::servant_to_id_i (PortableServer::Servant servant, if (this->policies ().implicit_activation () == PortableServer::IMPLICIT_ACTIVATION) { // If we reach here, then we either have the MULTIPLE_ID policy - // or we have the UNIQUE_ID policy and we are not in the active + // or we xhave the UNIQUE_ID policy and we are not in the active // object map. - PortableServer::ObjectId_var new_id = this->create_object_id (servant, env); - if (env.exception () != 0) - return 0; + PortableServer::ObjectId_var user_id; + if (this->active_object_map ().bind_using_system_id_returning_user_id (servant, + user_id.out ()) == -1) + { + CORBA::Exception *exception = new CORBA::OBJ_ADAPTER (CORBA::COMPLETED_NO); + env.exception (exception); + return 0; + } + + // Everything is finally ok + return user_id._retn (); + } + + // Otherwise, the ServantNotActive exception is raised. + CORBA::Exception *exception = new PortableServer::POA::ServantNotActive; + env.exception (exception); + return 0; +} + +PortableServer::ObjectId * +TAO_POA::servant_to_system_id_i (PortableServer::Servant servant, + CORBA::Environment &env) +{ + // This operation requires the RETAIN and either the UNIQUE_ID or + // IMPLICIT_ACTIVATION policies; if not present, the WrongPolicy + // exception is raised. + if (!(this->policies ().servant_retention () == PortableServer::RETAIN + && (this->policies ().id_uniqueness () == PortableServer::UNIQUE_ID + || this->policies ().implicit_activation () == PortableServer::IMPLICIT_ACTIVATION))) + { + CORBA::Exception *exception = new PortableServer::POA::WrongPolicy; + env.exception (exception); + return 0; + } + + // This operation has three possible behaviors. + + // If the POA has the UNIQUE_ID policy and the specified servant is + // active, the Object Id associated with that servant is returned. + PortableServer::ObjectId_var system_id; + if (this->policies ().id_uniqueness () == PortableServer::UNIQUE_ID && + this->active_object_map ().find_system_id_using_servant (servant, + system_id.out ()) != -1) + { + return system_id._retn (); + } - if (this->active_object_map ().bind (new_id.in (), servant) == -1) + // If the POA has the IMPLICIT_ACTIVATION policy and either the POA + // has the MULTIPLE_ID policy or the specified servant is not + // active, the servant is activated using a POA-generated Object Id + // and the Interface Id associated with the servant, and that Object + // Id is returned. + if (this->policies ().implicit_activation () == PortableServer::IMPLICIT_ACTIVATION) + { + // If we reach here, then we either have the MULTIPLE_ID policy + // or we xhave the UNIQUE_ID policy and we are not in the active + // object map. + PortableServer::ObjectId_var system_id; + if (this->active_object_map ().bind_using_system_id_returning_system_id (servant, + system_id.out ()) == -1) { CORBA::Exception *exception = new CORBA::OBJ_ADAPTER (CORBA::COMPLETED_NO); env.exception (exception); @@ -1715,7 +1708,7 @@ TAO_POA::servant_to_id_i (PortableServer::Servant servant, } // Everything is finally ok - return new_id._retn (); + return system_id._retn (); } // Otherwise, the ServantNotActive exception is raised. @@ -1734,15 +1727,19 @@ TAO_POA::servant_to_reference (PortableServer::Servant servant, // reference. The real requirement here is that a reference is // produced that will behave appropriately (that is, yield a // consistent Object Id value when asked politely). - PortableServer::ObjectId_var oid = this->servant_to_id (servant, - env); + PortableServer::ObjectId_var id = this->servant_to_system_id (servant, + env); if (env.exception () != 0) return CORBA::Object::_nil (); - else - return this->create_reference_with_id (oid.in (), - servant->_interface_repository_id (), - env); + + // Create object key. + TAO_ObjectKey_var key = this->create_object_key (id.in ()); + + // Ask the ORB to create you a reference + return TAO_ORB_Core_instance ()->orb ()->key_to_object (key.in (), + servant->_interface_repository_id (), + env); } PortableServer::Servant @@ -1793,9 +1790,29 @@ TAO_POA::reference_to_servant (CORBA::Object_ptr reference, return 0; } - return this->id_to_servant (id, env); + // Lock access to the POA for the duration of this transaction + TAO_POA_READ_GUARD_RETURN (ACE_Lock, monitor, this->lock (), 0, env); + + // This operation returns the active servant associated with the + // specified system Object Id value. If the Object Id value is + // not active in the POA, an ObjectNotActive exception is + // raised. + PortableServer::Servant servant = 0; + if (this->active_object_map ().find_servant_using_system_id (id, servant) != -1) + { + return servant; + } + else + // Otherwise, the ObjectNotActive exception is raised. + { + CORBA::Exception *exception = new PortableServer::POA::ObjectNotActive; + env.exception (exception); + return 0; + } } +#if !defined (TAO_HAS_MINIMUM_CORBA) + // Otherwise, if the POA has the USE_DEFAULT_SERVANT policy and a // default servant has been registered with the POA, this operation // returns the default servant. @@ -1817,6 +1834,8 @@ TAO_POA::reference_to_servant (CORBA::Object_ptr reference, } } +#endif /* TAO_HAS_MINIMUM_CORBA */ + // Not reached return 0; } @@ -1858,13 +1877,25 @@ TAO_POA::reference_to_id (CORBA::Object_ptr reference, return 0; } + // Lock access to the POA for the duration of this transaction + TAO_POA_READ_GUARD_RETURN (ACE_Lock, monitor, this->lock (), 0, env); + // The object denoted by the reference does not have to be active // for this operation to succeed. - return new PortableServer::ObjectId (id); + PortableServer::ObjectId_var user_id; + if (this->active_object_map ().find_user_id_using_system_id (id, + user_id) == -1) + { + CORBA::Exception *exception = new CORBA::OBJ_ADAPTER (CORBA::COMPLETED_NO); + env.exception (exception); + return 0; + } + + return user_id._retn (); } PortableServer::Servant -TAO_POA::id_to_servant_i (const PortableServer::ObjectId &oid, +TAO_POA::id_to_servant_i (const PortableServer::ObjectId &id, CORBA::Environment &env) { // This operation requires the RETAIN policy; if not present, the @@ -1880,7 +1911,7 @@ TAO_POA::id_to_servant_i (const PortableServer::ObjectId &oid, // specified Object Id value. If the Object Id value is not active // in the POA, an ObjectNotActive exception is raised. PortableServer::Servant servant = 0; - if (this->active_object_map ().find (oid, servant) != -1) + if (this->active_object_map ().find_servant_using_user_id (id, servant) != -1) { return servant; } @@ -1894,7 +1925,7 @@ TAO_POA::id_to_servant_i (const PortableServer::ObjectId &oid, } CORBA::Object_ptr -TAO_POA::id_to_reference_i (const PortableServer::ObjectId &oid, +TAO_POA::id_to_reference_i (const PortableServer::ObjectId &id, CORBA::Environment &env) { // This operation requires the RETAIN policy; if not present, the @@ -1909,11 +1940,20 @@ TAO_POA::id_to_reference_i (const PortableServer::ObjectId &oid, // If an object with the specified Object Id value is currently // active, a reference encapsulating the information used to // activate the object is returned. - PortableServer::Servant servant = 0; - if (this->active_object_map ().find (oid, servant) != -1) - return this->create_reference_with_id (oid, - servant->_interface_repository_id (), - env); + PortableServer::ObjectId_var system_id; + PortableServer::Servant servant; + if (this->active_object_map ().find_servant_and_system_id_using_user_id (id, + servant, + system_id.out ()) == 0) + { + // Create object key. + TAO_ObjectKey_var key = this->create_object_key (system_id.in ()); + + // Ask the ORB to create you a reference + return TAO_ORB_Core_instance ()->orb ()->key_to_object (key.in (), + servant->_interface_repository_id (), + env); + } else // If the Object Id value is not active in the POA, an // ObjectNotActive exception is raised. @@ -1924,6 +1964,8 @@ TAO_POA::id_to_reference_i (const PortableServer::ObjectId &oid, } } +#if !defined (TAO_HAS_MINIMUM_CORBA) + void TAO_POA::forward_object_i (const PortableServer::ObjectId &oid, CORBA::Object_ptr forward_to, @@ -1947,6 +1989,8 @@ TAO_POA::forward_object_i (const PortableServer::ObjectId &oid, env); } +#endif /* TAO_HAS_MINIMUM_CORBA */ + TAO_POA * TAO_POA::locate_poa_i (const TAO_ObjectKey &key, PortableServer::ObjectId &id, @@ -2057,7 +2101,7 @@ TAO_POA::locate_servant_i (const TAO_ObjectKey &key, // Object Id value from the request. If such a servant exists, // return TAO_POA::FOUND. if (poa->policies ().servant_retention () == PortableServer::RETAIN && - poa->active_object_map ().find (id, servant) != -1) + poa->active_object_map ().find_servant_using_system_id (id, servant) != -1) // Success return TAO_POA::FOUND; @@ -2070,6 +2114,8 @@ TAO_POA::locate_servant_i (const TAO_ObjectKey &key, if (poa->policies ().request_processing () == PortableServer::USE_ACTIVE_OBJECT_MAP_ONLY) return TAO_POA::NOT_FOUND; +#if !defined (TAO_HAS_MINIMUM_CORBA) + // If the POA has the USE_DEFAULT_SERVANT policy, a default servant // has been associated with the POA, return // TAO_POA::DEFAULT_SERVANT. If no servant has been associated with @@ -2097,6 +2143,8 @@ TAO_POA::locate_servant_i (const TAO_ObjectKey &key, return TAO_POA::SERVANT_MANAGER; } +#endif /* TAO_HAS_MINIMUM_CORBA */ + // Failure return TAO_POA::NOT_FOUND; } @@ -2104,7 +2152,7 @@ TAO_POA::locate_servant_i (const TAO_ObjectKey &key, PortableServer::Servant TAO_POA::locate_poa_and_servant_i (const TAO_ObjectKey &key, const char *operation, - PortableServer::ObjectId &id, + PortableServer::ObjectId &system_id, TAO_POA *&poa_impl, TAO_ORB_Core *orb_core, CORBA::Environment &env) @@ -2112,7 +2160,7 @@ TAO_POA::locate_poa_and_servant_i (const TAO_ObjectKey &key, ACE_FUNCTION_TIMEPROBE (TAO_POA_LOCATE_POA_AND_SERVANT_I_START); poa_impl = this->locate_poa_i (key, - id, + system_id, env); if (env.exception () != 0) return 0; @@ -2128,7 +2176,7 @@ TAO_POA::locate_poa_and_servant_i (const TAO_ObjectKey &key, { ACE_FUNCTION_TIMEPROBE (TAO_POA_FIND_SERVANT_START); - if (poa_impl->active_object_map ().find (id, servant) != -1) + if (poa_impl->active_object_map ().find_servant_using_system_id (system_id, servant) != -1) // Success return servant; } @@ -2147,6 +2195,8 @@ TAO_POA::locate_poa_and_servant_i (const TAO_ObjectKey &key, return 0; } +#if !defined (TAO_HAS_MINIMUM_CORBA) + // If the POA has the USE_DEFAULT_SERVANT policy, a default servant // has been associated with the POA so the POA will invoke the // appropriate method on that servant. If no servant has been @@ -2199,13 +2249,22 @@ TAO_POA::locate_poa_and_servant_i (const TAO_ObjectKey &key, if (env.exception () != 0) return 0; + PortableServer::ObjectId_var user_id; + if (this->active_object_map ().find_user_id_using_system_id (system_id, + user_id.out ()) == -1) + { + CORBA::Exception *exception = new CORBA::OBJ_ADAPTER (CORBA::COMPLETED_NO); + env.exception (exception); + return 0; + } + if (poa_impl->policies ().servant_retention () == PortableServer::RETAIN) { // @@ // Invocations of incarnate on the servant manager are serialized. // Invocations of etherealize on the servant manager are serialized. // Invocations of incarnate and etherealize on the servant manager are mutually exclusive. - PortableServer::Servant servant = poa_impl->servant_activator_->incarnate (id, + PortableServer::Servant servant = poa_impl->servant_activator_->incarnate (user_id.in (), poa.in (), env); if (env.exception () != 0 || servant == 0) @@ -2218,7 +2277,7 @@ TAO_POA::locate_poa_and_servant_i (const TAO_ObjectKey &key, // will raise an OBJ_ADAPTER system exception for the // request. if (poa_impl->policies ().id_uniqueness () == PortableServer::UNIQUE_ID && - poa_impl->active_object_map ().find (servant) != -1) + poa_impl->active_object_map ().is_servant_in_map (servant)) { CORBA::Exception *exception = new CORBA::OBJ_ADAPTER (CORBA::COMPLETED_NO); env.exception (exception); @@ -2229,7 +2288,9 @@ TAO_POA::locate_poa_and_servant_i (const TAO_ObjectKey &key, // Object Map so that subsequent requests with the same // ObjectId value will be delivered directly to that servant // without invoking the servant manager. - if (poa_impl->active_object_map ().bind (id, servant) == -1) + if (this->active_object_map ().rebind_using_user_id_and_system_id (servant, + user_id.in (), + system_id) == -1) { CORBA::Exception *exception = new CORBA::OBJ_ADAPTER (CORBA::COMPLETED_NO); env.exception (exception); @@ -2253,7 +2314,7 @@ TAO_POA::locate_poa_and_servant_i (const TAO_ObjectKey &key, // process the request, and postinvoke the object. // PortableServer::ServantLocator::Cookie cookie; - PortableServer::Servant servant = poa_impl->servant_locator_->preinvoke (id, + PortableServer::Servant servant = poa_impl->servant_locator_->preinvoke (user_id.in (), poa.in (), operation, cookie, @@ -2270,6 +2331,8 @@ TAO_POA::locate_poa_and_servant_i (const TAO_ObjectKey &key, } } +#endif /* TAO_HAS_MINIMUM_CORBA */ + // Failure CORBA::Exception *exception = new CORBA::OBJ_ADAPTER (CORBA::COMPLETED_NO); env.exception (exception); @@ -2382,6 +2445,9 @@ TAO_POA::post_invoke (PortableServer::Servant servant, TAO_POA_Current *poa_current, CORBA::Environment &env) { + +#if !defined (TAO_HAS_MINIMUM_CORBA) + PortableServer::ServantLocator::Cookie cookie = poa_current->locator_cookie (); if (cookie != 0) @@ -2396,6 +2462,8 @@ TAO_POA::post_invoke (PortableServer::Servant servant, env); } +#endif /* TAO_HAS_MINIMUM_CORBA */ + // poa_current->clear (); } @@ -2430,7 +2498,7 @@ TAO_POA::parse_key (const TAO_ObjectKey &key, if (system_id) // The minus one is because we want <last_token_position> to point // to the separator - last_token_position = key.length () - this->system_id_size () - 1; + last_token_position = key.length () - this->active_object_map ().system_id_size () - 1; else last_token_position = this->rfind (key, TAO_POA::name_separator ()); @@ -2452,11 +2520,14 @@ TAO_POA::parse_key (const TAO_ObjectKey &key, // Skip past the persistent indicator starting_at += TAO_POA::persistent_key_type_length (); - // Take the creation time for the timestamp - poa_creation_time.creation_time (&key[starting_at]); + if (!persistent) + { + // Take the creation time for the timestamp + poa_creation_time.creation_time (&key[starting_at]); - // Skip past the timestamp - starting_at += TAO_Creation_Time::creation_time_length (); + // Skip past the timestamp + starting_at += TAO_Creation_Time::creation_time_length (); + } #endif /* POA_NO_TIMESTAMP */ @@ -2485,12 +2556,16 @@ TAO_POA::parse_key (const TAO_ObjectKey &key, TAO_ObjectKey * TAO_POA::create_object_key (const PortableServer::ObjectId &id) { + int creation_time_length = 0; + if (!this->persistent ()) + creation_time_length = TAO_Creation_Time::creation_time_length (); + // Calculate the space required for the key int buffer_size = this->system_id_key_type_length () + #if !defined (POA_NO_TIMESTAMP) this->persistent_key_type_length () + - TAO_Creation_Time::creation_time_length () + + creation_time_length + #endif /* POA_NO_TIMESTAMP */ this->complete_name_.length () + TAO_POA::name_separator_length () + @@ -2511,11 +2586,14 @@ TAO_POA::create_object_key (const PortableServer::ObjectId &id) buffer[starting_at] = (CORBA::Octet) this->persistent_key_type (); starting_at += this->persistent_key_type_length (); - // Then copy the timestamp - ACE_OS::memcpy (&buffer[starting_at], - this->creation_time_.creation_time (), - TAO_Creation_Time::creation_time_length ()); - starting_at += TAO_Creation_Time::creation_time_length (); + if (!this->persistent ()) + { + // Then copy the timestamp + ACE_OS::memcpy (&buffer[starting_at], + this->creation_time_.creation_time (), + TAO_Creation_Time::creation_time_length ()); + starting_at += TAO_Creation_Time::creation_time_length (); + } #endif /* POA_NO_TIMESTAMP */ // Put the POA name into the buffer @@ -2739,16 +2817,18 @@ TAO_POA::ObjectId_to_wstring (const PortableServer::ObjectId &id) return string; } +#if !defined (TAO_HAS_MINIMUM_CORBA) + PortableServer::ThreadPolicy_ptr TAO_POA::create_thread_policy (PortableServer::ThreadPolicyValue value, CORBA::Environment &env) { - PortableServer::POA_var self = this->_this (env); + PortableServer::POA_var rootPOA = TAO_ORB_Core_instance ()->root_poa_reference (env); // Check for exceptions if (env.exception () != 0) return PortableServer::ThreadPolicy::_nil (); - auto_ptr<TAO_Thread_Policy> new_policy (new TAO_Thread_Policy (value, self.in ())); + auto_ptr<TAO_Thread_Policy> new_policy (new TAO_Thread_Policy (value, rootPOA.in ())); PortableServer::ThreadPolicy_var result = new_policy->_this (env); if (env.exception () != 0) return PortableServer::ThreadPolicy::_nil (); @@ -2761,16 +2841,18 @@ TAO_POA::create_thread_policy (PortableServer::ThreadPolicyValue value, } } +#endif /* TAO_HAS_MINIMUM_CORBA */ + PortableServer::LifespanPolicy_ptr TAO_POA::create_lifespan_policy (PortableServer::LifespanPolicyValue value, CORBA::Environment &env) { - PortableServer::POA_var self = this->_this (env); + PortableServer::POA_var rootPOA = TAO_ORB_Core_instance ()->root_poa_reference (env); // Check for exceptions if (env.exception () != 0) return PortableServer::LifespanPolicy::_nil (); - auto_ptr<TAO_Lifespan_Policy> new_policy (new TAO_Lifespan_Policy (value, self.in ())); + auto_ptr<TAO_Lifespan_Policy> new_policy (new TAO_Lifespan_Policy (value, rootPOA.in ())); PortableServer::LifespanPolicy_var result = new_policy->_this (env); if (env.exception () != 0) return PortableServer::LifespanPolicy::_nil (); @@ -2787,12 +2869,12 @@ PortableServer::IdUniquenessPolicy_ptr TAO_POA::create_id_uniqueness_policy (PortableServer::IdUniquenessPolicyValue value, CORBA::Environment &env) { - PortableServer::POA_var self = this->_this (env); + PortableServer::POA_var rootPOA = TAO_ORB_Core_instance ()->root_poa_reference (env); // Check for exceptions if (env.exception () != 0) return PortableServer::IdUniquenessPolicy::_nil (); - auto_ptr<TAO_Id_Uniqueness_Policy> new_policy (new TAO_Id_Uniqueness_Policy (value, self.in ())); + auto_ptr<TAO_Id_Uniqueness_Policy> new_policy (new TAO_Id_Uniqueness_Policy (value, rootPOA.in ())); PortableServer::IdUniquenessPolicy_var result = new_policy->_this (env); if (env.exception () != 0) return PortableServer::IdUniquenessPolicy::_nil (); @@ -2809,12 +2891,12 @@ PortableServer::IdAssignmentPolicy_ptr TAO_POA::create_id_assignment_policy (PortableServer::IdAssignmentPolicyValue value, CORBA::Environment &env) { - PortableServer::POA_var self = this->_this (env); + PortableServer::POA_var rootPOA = TAO_ORB_Core_instance ()->root_poa_reference (env); // Check for exceptions if (env.exception () != 0) return PortableServer::IdAssignmentPolicy::_nil (); - auto_ptr<TAO_Id_Assignment_Policy> new_policy (new TAO_Id_Assignment_Policy (value, self.in ())); + auto_ptr<TAO_Id_Assignment_Policy> new_policy (new TAO_Id_Assignment_Policy (value, rootPOA.in ())); PortableServer::IdAssignmentPolicy_var result = new_policy->_this (env); if (env.exception () != 0) return PortableServer::IdAssignmentPolicy::_nil (); @@ -2827,16 +2909,18 @@ TAO_POA::create_id_assignment_policy (PortableServer::IdAssignmentPolicyValue va } } +#if !defined (TAO_HAS_MINIMUM_CORBA) + PortableServer::ImplicitActivationPolicy_ptr TAO_POA::create_implicit_activation_policy (PortableServer::ImplicitActivationPolicyValue value, CORBA::Environment &env) { - PortableServer::POA_var self = this->_this (env); + PortableServer::POA_var rootPOA = TAO_ORB_Core_instance ()->root_poa_reference (env); // Check for exceptions if (env.exception () != 0) return PortableServer::ImplicitActivationPolicy::_nil (); - auto_ptr<TAO_Implicit_Activation_Policy> new_policy (new TAO_Implicit_Activation_Policy (value, self.in ())); + auto_ptr<TAO_Implicit_Activation_Policy> new_policy (new TAO_Implicit_Activation_Policy (value, rootPOA.in ())); PortableServer::ImplicitActivationPolicy_var result = new_policy->_this (env); if (env.exception () != 0) return PortableServer::ImplicitActivationPolicy::_nil (); @@ -2853,12 +2937,12 @@ PortableServer::ServantRetentionPolicy_ptr TAO_POA::create_servant_retention_policy (PortableServer::ServantRetentionPolicyValue value, CORBA::Environment &env) { - PortableServer::POA_var self = this->_this (env); + PortableServer::POA_var rootPOA = TAO_ORB_Core_instance ()->root_poa_reference (env); // Check for exceptions if (env.exception () != 0) return PortableServer::ServantRetentionPolicy::_nil (); - auto_ptr<TAO_Servant_Retention_Policy> new_policy (new TAO_Servant_Retention_Policy (value, self.in ())); + auto_ptr<TAO_Servant_Retention_Policy> new_policy (new TAO_Servant_Retention_Policy (value, rootPOA.in ())); PortableServer::ServantRetentionPolicy_var result = new_policy->_this (env); if (env.exception () != 0) return PortableServer::ServantRetentionPolicy::_nil (); @@ -2875,12 +2959,12 @@ PortableServer::RequestProcessingPolicy_ptr TAO_POA::create_request_processing_policy (PortableServer::RequestProcessingPolicyValue value, CORBA::Environment &env) { - PortableServer::POA_var self = this->_this (env); + PortableServer::POA_var rootPOA = TAO_ORB_Core_instance ()->root_poa_reference (env); // Check for exceptions if (env.exception () != 0) return PortableServer::RequestProcessingPolicy::_nil (); - auto_ptr<TAO_Request_Processing_Policy> new_policy (new TAO_Request_Processing_Policy (value, self.in ())); + auto_ptr<TAO_Request_Processing_Policy> new_policy (new TAO_Request_Processing_Policy (value, rootPOA.in ())); PortableServer::RequestProcessingPolicy_var result = new_policy->_this (env); if (env.exception () != 0) return PortableServer::RequestProcessingPolicy::_nil (); @@ -2893,33 +2977,7 @@ TAO_POA::create_request_processing_policy (PortableServer::RequestProcessingPoli } } -// ************************************************** -// -// TAO spcific POA locking policy (non-standard) -// -// ************************************************** - -PortableServer::SynchronizationPolicy_ptr -TAO_POA::create_synchronization_policy (PortableServer::SynchronizationPolicyValue value, - CORBA::Environment &env) -{ - PortableServer::POA_var self = this->_this (env); - // Check for exceptions - if (env.exception () != 0) - return PortableServer::SynchronizationPolicy::_nil (); - - auto_ptr<TAO_Synchronization_Policy> new_policy (new TAO_Synchronization_Policy (value, self.in ())); - PortableServer::SynchronizationPolicy_var result = new_policy->_this (env); - if (env.exception () != 0) - return PortableServer::SynchronizationPolicy::_nil (); - else - { - // Make sure that the auto_ptr does not delete the - // implementation - new_policy.release (); - return result._retn (); - } -} +#endif /* TAO_HAS_MINIMUM_CORBA */ void TAO_POA::encode_sequence_to_string (CORBA::String &str, @@ -3000,6 +3058,8 @@ TAO_POA::decode_string_to_sequence (TAO_Unbounded_Sequence<CORBA::Octet> &seq, seq.length (i); } +#if !defined (TAO_HAS_MINIMUM_CORBA) + CORBA::Boolean TAO_Adapter_Activator::unknown_adapter (PortableServer::POA_ptr parent, const char *name, @@ -3042,11 +3102,19 @@ TAO_Adapter_Activator::unknown_adapter (PortableServer::POA_ptr parent, } } +#endif /* TAO_HAS_MINIMUM_CORBA */ + TAO_POA_Current::TAO_POA_Current (void) : poa_impl_ (0), object_id_ (0), object_key_ (0), + +#if !defined (TAO_HAS_MINIMUM_CORBA) + cookie_ (0), + +#endif /* TAO_HAS_MINIMUM_CORBA */ + servant_ (0) { } @@ -3058,7 +3126,13 @@ TAO_POA_Current::TAO_POA_Current (TAO_POA *impl, : poa_impl_ (impl), object_id_ (&id), object_key_ (&key), + +#if !defined (TAO_HAS_MINIMUM_CORBA) + cookie_ (0), + +#endif /* TAO_HAS_MINIMUM_CORBA */ + servant_ (servant) {} @@ -3105,7 +3179,6 @@ template class ACE_Auto_Basic_Ptr<TAO_Lifespan_Policy>; template class ACE_Auto_Basic_Ptr<TAO_Active_Object_Map_Iterator_Impl>; template class ACE_Auto_Basic_Ptr<TAO_POA>; template class ACE_Auto_Basic_Ptr<TAO_Request_Processing_Policy>; -template class ACE_Auto_Basic_Ptr<TAO_Synchronization_Policy>; template class ACE_Auto_Basic_Ptr<TAO_Servant_Retention_Policy>; template class ACE_Auto_Basic_Ptr<TAO_Thread_Policy>; template class ACE_Lock_Adapter<ACE_Null_Mutex>; @@ -3137,7 +3210,6 @@ template class auto_ptr<TAO_Lifespan_Policy>; template class auto_ptr<TAO_Active_Object_Map_Iterator_Impl>; template class auto_ptr<TAO_POA>; template class auto_ptr<TAO_Request_Processing_Policy>; -template class auto_ptr<TAO_Synchronization_Policy>; template class auto_ptr<TAO_Servant_Retention_Policy>; template class auto_ptr<TAO_Thread_Policy>; template class ACE_Node<TAO_POA *>; @@ -3150,7 +3222,6 @@ template class ACE_Node<TAO_POA *>; #pragma instantiate ACE_Auto_Basic_Ptr<TAO_Active_Object_Map_Iterator_Impl> #pragma instantiate ACE_Auto_Basic_Ptr<TAO_POA> #pragma instantiate ACE_Auto_Basic_Ptr<TAO_Request_Processing_Policy> -#pragma instantiate ACE_Auto_Basic_Ptr<TAO_Synchronization_Policy> #pragma instantiate ACE_Auto_Basic_Ptr<TAO_Servant_Retention_Policy> #pragma instantiate ACE_Auto_Basic_Ptr<TAO_Thread_Policy> #pragma instantiate ACE_Lock_Adapter<ACE_Null_Mutex> @@ -3181,7 +3252,6 @@ template class ACE_Node<TAO_POA *>; #pragma instantiate auto_ptr<TAO_Active_Object_Map_Iterator_Impl> #pragma instantiate auto_ptr<TAO_POA> #pragma instantiate auto_ptr<TAO_Request_Processing_Policy> -#pragma instantiate auto_ptr<TAO_Synchronization_Policy> #pragma instantiate auto_ptr<TAO_Servant_Retention_Policy> #pragma instantiate auto_ptr<TAO_Thread_Policy> #pragma instantiate ACE_Node<TAO_POA *> diff --git a/TAO/tao/POA.h b/TAO/tao/POA.h index 7443fc4f717..be3e6eecba4 100644 --- a/TAO/tao/POA.h +++ b/TAO/tao/POA.h @@ -56,6 +56,8 @@ class TAO_POA; +#if !defined (TAO_HAS_MINIMUM_CORBA) + class TAO_Export TAO_Thread_Policy : public POA_PortableServer::ThreadPolicy { public: @@ -72,7 +74,7 @@ public: virtual CORBA::PolicyType policy_type (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - // virtual PortableServer::POA_ptr _default_POA (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); + virtual PortableServer::POA_ptr _default_POA (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); protected: PortableServer::ThreadPolicyValue value_; @@ -80,6 +82,8 @@ protected: PortableServer::POA_var poa_; }; +#endif /* TAO_HAS_MINIMUM_CORBA */ + class TAO_Export TAO_Lifespan_Policy : public POA_PortableServer::LifespanPolicy { public: @@ -96,7 +100,7 @@ public: virtual CORBA::PolicyType policy_type (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - // virtual PortableServer::POA_ptr _default_POA (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); + virtual PortableServer::POA_ptr _default_POA (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); protected: PortableServer::LifespanPolicyValue value_; @@ -120,7 +124,7 @@ public: virtual CORBA::PolicyType policy_type (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - // virtual PortableServer::POA_ptr _default_POA (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); + virtual PortableServer::POA_ptr _default_POA (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); protected: PortableServer::IdUniquenessPolicyValue value_; @@ -144,7 +148,7 @@ public: virtual CORBA::PolicyType policy_type (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - // virtual PortableServer::POA_ptr _default_POA (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); + virtual PortableServer::POA_ptr _default_POA (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); protected: PortableServer::IdAssignmentPolicyValue value_; @@ -152,6 +156,8 @@ protected: PortableServer::POA_var poa_; }; +#if !defined (TAO_HAS_MINIMUM_CORBA) + class TAO_Export TAO_Implicit_Activation_Policy : public POA_PortableServer::ImplicitActivationPolicy { public: @@ -168,7 +174,7 @@ public: virtual CORBA::PolicyType policy_type (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - // virtual PortableServer::POA_ptr _default_POA (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); + virtual PortableServer::POA_ptr _default_POA (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); protected: PortableServer::ImplicitActivationPolicyValue value_; @@ -192,7 +198,7 @@ public: virtual CORBA::PolicyType policy_type (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - // virtual PortableServer::POA_ptr _default_POA (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); + virtual PortableServer::POA_ptr _default_POA (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); protected: PortableServer::ServantRetentionPolicyValue value_; @@ -216,7 +222,7 @@ public: virtual CORBA::PolicyType policy_type (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - // virtual PortableServer::POA_ptr _default_POA (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); + virtual PortableServer::POA_ptr _default_POA (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); protected: PortableServer::RequestProcessingPolicyValue value_; @@ -224,35 +230,7 @@ protected: PortableServer::POA_var poa_; }; -// ************************************************** -// -// TAO spcific POA locking policy (non-standard) -// -// ************************************************** - -class TAO_Export TAO_Synchronization_Policy : public POA_PortableServer::SynchronizationPolicy -{ -public: - TAO_Synchronization_Policy (PortableServer::SynchronizationPolicyValue value, - PortableServer::POA_ptr poa); - - TAO_Synchronization_Policy (const TAO_Synchronization_Policy &rhs); - - virtual PortableServer::SynchronizationPolicyValue value (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - - virtual CORBA::Policy_ptr copy (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - - virtual void destroy (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - - virtual CORBA::PolicyType policy_type (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - - // virtual PortableServer::POA_ptr _default_POA (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - -protected: - PortableServer::SynchronizationPolicyValue value_; - - PortableServer::POA_var poa_; -}; +#endif /* TAO_HAS_MINIMUM_CORBA */ class TAO_Export TAO_POA_Policies { @@ -260,9 +238,13 @@ public: TAO_POA_Policies (void); +#if !defined (TAO_HAS_MINIMUM_CORBA) + virtual PortableServer::ThreadPolicyValue thread (void) const; virtual void thread (PortableServer::ThreadPolicyValue value); +#endif /* TAO_HAS_MINIMUM_CORBA */ + virtual PortableServer::LifespanPolicyValue lifespan (void) const; virtual void lifespan (PortableServer::LifespanPolicyValue value); @@ -281,15 +263,6 @@ public: virtual PortableServer::RequestProcessingPolicyValue request_processing (void) const; virtual void request_processing (PortableServer::RequestProcessingPolicyValue value); - // ************************************************** - // - // TAO spcific POA locking policy (non-standard) - // - // ************************************************** - - virtual PortableServer::SynchronizationPolicyValue synchronization (void) const; - virtual void synchronization (PortableServer::SynchronizationPolicyValue value); - virtual void parse_policies (const CORBA::PolicyList &policies, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); @@ -313,14 +286,6 @@ protected: PortableServer::ServantRetentionPolicyValue servant_retention_; PortableServer::RequestProcessingPolicyValue request_processing_; - - // ************************************************** - // - // TAO spcific POA locking policy (non-standard) - // - // ************************************************** - - PortableServer::SynchronizationPolicyValue synchronization_; }; class TAO_Temporary_Creation_Time; @@ -399,9 +364,13 @@ public: CORBA::Boolean wait_for_completion, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); +#if !defined (TAO_HAS_MINIMUM_CORBA) + virtual PortableServer::ThreadPolicy_ptr create_thread_policy (PortableServer::ThreadPolicyValue value, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); +#endif /* TAO_HAS_MINIMUM_CORBA */ + virtual PortableServer::LifespanPolicy_ptr create_lifespan_policy (PortableServer::LifespanPolicyValue value, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); @@ -411,6 +380,8 @@ public: virtual PortableServer::IdAssignmentPolicy_ptr create_id_assignment_policy (PortableServer::IdAssignmentPolicyValue value, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); +#if !defined (TAO_HAS_MINIMUM_CORBA) + virtual PortableServer::ImplicitActivationPolicy_ptr create_implicit_activation_policy (PortableServer::ImplicitActivationPolicyValue value, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); @@ -420,14 +391,7 @@ public: virtual PortableServer::RequestProcessingPolicy_ptr create_request_processing_policy (PortableServer::RequestProcessingPolicyValue value, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - // ************************************************** - // - // TAO spcific POA locking policy (non-standard) - // - // ************************************************** - - virtual PortableServer::SynchronizationPolicy_ptr create_synchronization_policy (PortableServer::SynchronizationPolicyValue value, - CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); +#endif /* TAO_HAS_MINIMUM_CORBA */ virtual CORBA::String the_name (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); @@ -435,6 +399,8 @@ public: virtual PortableServer::POAManager_ptr the_POAManager (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); +#if !defined (TAO_HAS_MINIMUM_CORBA) + virtual PortableServer::AdapterActivator_ptr the_activator (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); virtual void the_activator (PortableServer::AdapterActivator_ptr adapter_activator, @@ -450,6 +416,8 @@ public: virtual void set_servant (PortableServer::Servant servant, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); +#endif /* TAO_HAS_MINIMUM_CORBA */ + virtual PortableServer::ObjectId *activate_object (PortableServer::Servant p_servant, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); @@ -484,10 +452,14 @@ public: virtual CORBA::Object_ptr id_to_reference (const PortableServer::ObjectId &oid, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); +#if !defined (TAO_HAS_MINIMUM_CORBA) + virtual void forward_object (const PortableServer::ObjectId &oid, CORBA::Object_ptr forward_to, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); +#endif /* TAO_HAS_MINIMUM_CORBA */ + // Utility functions for the other static void encode_sequence_to_string (CORBA::String &str, const TAO_Unbounded_Sequence<CORBA::Octet> &seq); @@ -567,6 +539,8 @@ protected: CORBA::Boolean wait_for_completion, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); +#if !defined (TAO_HAS_MINIMUM_CORBA) + virtual PortableServer::ServantManager_ptr get_servant_manager_i (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); virtual void set_servant_manager_i (PortableServer::ServantManager_ptr imgr, @@ -577,6 +551,8 @@ protected: virtual void set_servant_i (PortableServer::Servant servant, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); +#endif /* TAO_HAS_MINIMUM_CORBA */ + virtual PortableServer::ObjectId *activate_object_i (PortableServer::Servant p_servant, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); @@ -590,19 +566,32 @@ protected: virtual CORBA::Object_ptr create_reference_i (const char *intf, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); + virtual CORBA::Object_ptr create_reference_with_id_i (const PortableServer::ObjectId &oid, + const char *intf, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); virtual PortableServer::ObjectId *servant_to_id_i (PortableServer::Servant servant, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); + virtual PortableServer::ObjectId *servant_to_system_id (PortableServer::Servant p_servant, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); + + virtual PortableServer::ObjectId *servant_to_system_id_i (PortableServer::Servant p_servant, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); + virtual PortableServer::Servant id_to_servant_i (const PortableServer::ObjectId &oid, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); virtual CORBA::Object_ptr id_to_reference_i (const PortableServer::ObjectId &oid, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); +#if !defined (TAO_HAS_MINIMUM_CORBA) + virtual void forward_object_i (const PortableServer::ObjectId &oid, CORBA::Object_ptr forward_to, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); +#endif /* TAO_HAS_MINIMUM_CORBA */ + virtual ACE_Lock &lock (void); virtual TAO_POA_Policies &policies (void); @@ -627,13 +616,8 @@ protected: TAO_POA::String &tail_poa_name, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - virtual PortableServer::ObjectId *create_object_id (PortableServer::Servant servant, - CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - virtual TAO_ObjectKey *create_object_key (const PortableServer::ObjectId &id); - virtual CORBA::ULong system_id_size (void) const; - virtual int is_poa_generated_id (const PortableServer::ObjectId &id); virtual int is_poa_generated_key (const TAO_ObjectKey &key); @@ -732,6 +716,8 @@ protected: int delete_active_object_map_; +#if !defined (TAO_HAS_MINIMUM_CORBA) + PortableServer::AdapterActivator_var adapter_activator_; PortableServer::ServantActivator_var servant_activator_; @@ -740,6 +726,8 @@ protected: PortableServer::Servant default_servant_; +#endif /* TAO_HAS_MINIMUM_CORBA */ + typedef ACE_Hash_Map_Manager<ACE_CString, TAO_POA *, ACE_Null_Mutex> CHILDREN; @@ -756,6 +744,8 @@ protected: TAO_Creation_Time creation_time_; }; +#if !defined (TAO_HAS_MINIMUM_CORBA) + class TAO_Export TAO_Adapter_Activator : public POA_PortableServer::AdapterActivator { public: @@ -765,6 +755,8 @@ public: CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); }; +#endif /* TAO_HAS_MINIMUM_CORBA */ + class TAO_Export TAO_POA_Current : public POA_PortableServer::Current { // = TITLE @@ -837,12 +829,16 @@ public: virtual int in_upcall (void) const; // Get whether we're in an upcall (non-zero is yes). +#if !defined (TAO_HAS_MINIMUM_CORBA) + virtual PortableServer::ServantLocator::Cookie locator_cookie (void) const; // Get the Servant Locator's cookie virtual void locator_cookie (PortableServer::ServantLocator::Cookie cookie); // Set the Servant Locator's cookie +#endif /* TAO_HAS_MINIMUM_CORBA */ + TAO_POA_Current (void); // Constructor @@ -865,9 +861,13 @@ protected: const TAO_ObjectKey *object_key_; // The object key of the current context. +#if !defined (TAO_HAS_MINIMUM_CORBA) + PortableServer::ServantLocator::Cookie cookie_; // Servant Locator's cookie +#endif /* TAO_HAS_MINIMUM_CORBA */ + PortableServer::Servant servant_; // The servant for the current upcall. diff --git a/TAO/tao/POA.i b/TAO/tao/POA.i index 8147ca045f0..fb949a31870 100644 --- a/TAO/tao/POA.i +++ b/TAO/tao/POA.i @@ -2,6 +2,9 @@ // Exception macros #include "tao/poa_macros.h" +#include "tao/Environment.h" + +#if !defined (TAO_HAS_MINIMUM_CORBA) ACE_INLINE PortableServer::ThreadPolicyValue TAO_POA_Policies::thread (void) const @@ -15,6 +18,8 @@ TAO_POA_Policies::thread (PortableServer::ThreadPolicyValue value) this->thread_ = value; } +#endif /* TAO_HAS_MINIMUM_CORBA */ + ACE_INLINE PortableServer::LifespanPolicyValue TAO_POA_Policies::lifespan (void) const { @@ -87,24 +92,6 @@ TAO_POA_Policies::request_processing (PortableServer::RequestProcessingPolicyVal this->request_processing_ = value; } -// ************************************************** -// -// TAO spcific POA locking policy (non-standard) -// -// ************************************************** - -ACE_INLINE PortableServer::SynchronizationPolicyValue -TAO_POA_Policies::synchronization (void) const -{ - return this->synchronization_; -} - -ACE_INLINE void -TAO_POA_Policies::synchronization (PortableServer::SynchronizationPolicyValue value) -{ - this->synchronization_ = value; -} - ACE_INLINE int TAO_Creation_Time::creation_time_length (void) { @@ -330,6 +317,8 @@ TAO_POA::active_object_map (void) const return *this->active_object_map_; } +#if !defined (TAO_HAS_MINIMUM_CORBA) + ACE_INLINE PortableServer::ServantManager_ptr TAO_POA::get_servant_manager (CORBA::Environment &env) { @@ -370,6 +359,8 @@ TAO_POA::set_servant (PortableServer::Servant servant, env); } +#endif /* TAO_HAS_MINIMUM_CORBA */ + ACE_INLINE PortableServer::ObjectId * TAO_POA::activate_object (PortableServer::Servant servant, CORBA::Environment &env) @@ -416,6 +407,19 @@ TAO_POA::create_reference (const char *intf, env); } +ACE_INLINE CORBA::Object_ptr +TAO_POA::create_reference_with_id (const PortableServer::ObjectId &id, + const char *intf, + CORBA::Environment &env) +{ + // Lock access to the POA for the duration of this transaction + TAO_POA_WRITE_GUARD_RETURN (ACE_Lock, monitor, this->lock (), CORBA::Object::_nil (), env); + + return this->create_reference_with_id_i (id, + intf, + env); +} + ACE_INLINE PortableServer::ObjectId * TAO_POA::servant_to_id (PortableServer::Servant servant, CORBA::Environment &env) @@ -429,6 +433,17 @@ TAO_POA::servant_to_id (PortableServer::Servant servant, env); } +ACE_INLINE PortableServer::ObjectId * +TAO_POA::servant_to_system_id (PortableServer::Servant servant, + CORBA::Environment &env) +{ + // Lock access to the POA for the duration of this transaction + TAO_POA_WRITE_GUARD_RETURN (ACE_Lock, monitor, this->lock (), 0, env); + + return this->servant_to_system_id_i (servant, + env); +} + ACE_INLINE PortableServer::Servant TAO_POA::id_to_servant (const PortableServer::ObjectId &oid, CORBA::Environment &env) @@ -450,6 +465,8 @@ TAO_POA::id_to_reference (const PortableServer::ObjectId &oid, return this->id_to_reference_i (oid, env); } +#if !defined (TAO_HAS_MINIMUM_CORBA) + ACE_INLINE void TAO_POA::forward_object (const PortableServer::ObjectId &oid, CORBA::Object_ptr forward_to, @@ -463,6 +480,8 @@ TAO_POA::forward_object (const PortableServer::ObjectId &oid, env); } +#endif /* TAO_HAS_MINIMUM_CORBA */ + ACE_INLINE PortableServer::POA_ptr TAO_POA::the_parent (CORBA::Environment &env) { @@ -478,6 +497,8 @@ TAO_POA::the_POAManager (CORBA::Environment &env) return this->poa_manager_._this (env); } +#if !defined (TAO_HAS_MINIMUM_CORBA) + ACE_INLINE PortableServer::AdapterActivator_ptr TAO_POA::the_activator (CORBA::Environment &env) { @@ -495,6 +516,8 @@ TAO_POA::the_activator (PortableServer::AdapterActivator_ptr adapter_activator, this->adapter_activator_ = PortableServer::AdapterActivator::_duplicate (adapter_activator); } +#endif /* TAO_HAS_MINIMUM_CORBA */ + ACE_INLINE const TAO_Creation_Time & TAO_POA::creation_time (void) { @@ -621,19 +644,6 @@ TAO_POA::rfind (const TAO_ObjectKey &key, return TAO_POA::String::npos; } -ACE_INLINE PortableServer::ObjectId * -TAO_POA::create_object_id (PortableServer::Servant servant, - CORBA::Environment &env) -{ - return this->active_object_map ().create_object_id (servant, env); -} - -ACE_INLINE CORBA::ULong -TAO_POA::system_id_size (void) const -{ - return this->active_object_map ().system_id_size (); -} - ACE_INLINE void TAO_POA_Current::clear (void) { @@ -641,7 +651,13 @@ TAO_POA_Current::clear (void) this->object_id_ = 0; this->servant_ = 0; this->object_key_ = 0; + +#if !defined (TAO_HAS_MINIMUM_CORBA) + this->cookie_ = 0; + +#endif /* TAO_HAS_MINIMUM_CORBA */ + } ACE_INLINE int @@ -708,6 +724,8 @@ TAO_POA_Current::in_upcall (void) const return (this->servant_ != 0); } +#if !defined (TAO_HAS_MINIMUM_CORBA) + ACE_INLINE PortableServer::ServantLocator::Cookie TAO_POA_Current::locator_cookie (void) const { @@ -719,3 +737,5 @@ TAO_POA_Current::locator_cookie (PortableServer::ServantLocator::Cookie cookie) { this->cookie_ = cookie; } + +#endif /* TAO_HAS_MINIMUM_CORBA */ diff --git a/TAO/tao/POA.pidl b/TAO/tao/POA.pidl index 5c9b8799086..e36b440803d 100644 --- a/TAO/tao/POA.pidl +++ b/TAO/tao/POA.pidl @@ -50,16 +50,19 @@ module PortableServer native Servant; typedef sequence<octet> ObjectId; +#if !defined (TAO_HAS_MINIMUM_CORBA) exception ForwardRequest { Object forward_reference; }; +#endif /* TAO_HAS_MINIMUM_CORBA */ // ********************************************** // // Policy interfaces // // ********************************************** +#if !defined (TAO_HAS_MINIMUM_CORBA) enum ThreadPolicyValue { ORB_CTRL_MODEL, SINGLE_THREAD_MODEL @@ -68,6 +71,7 @@ module PortableServer { readonly attribute ThreadPolicyValue value; }; +#endif /* TAO_HAS_MINIMUM_CORBA */ enum LifespanPolicyValue { TRANSIENT, @@ -96,6 +100,7 @@ module PortableServer readonly attribute IdAssignmentPolicyValue value; }; +#if !defined (TAO_HAS_MINIMUM_CORBA) enum ImplicitActivationPolicyValue { IMPLICIT_ACTIVATION, NO_IMPLICIT_ACTIVATION @@ -123,22 +128,7 @@ module PortableServer { readonly attribute RequestProcessingPolicyValue value; }; - - // ************************************************** - // - // TAO spcific POA locking policy (non-standard) - // - // ************************************************** - - enum SynchronizationPolicyValue { - DEFAULT_LOCK, - NULL_LOCK, - THREAD_LOCK - }; - interface SynchronizationPolicy : CORBA::Policy - { - readonly attribute SynchronizationPolicyValue value; - }; +#endif /* TAO_HAS_MINIMUM_CORBA */ // ************************************************** // @@ -152,15 +142,15 @@ module PortableServer void activate() raises(AdapterInactive); +#if !defined (TAO_HAS_MINIMUM_CORBA) void hold_requests(in boolean wait_for_completion) raises(AdapterInactive); void discard_requests(in boolean wait_for_completion) raises(AdapterInactive); - // ****change**** begin take out semi-colon after parameter list in 97-04-14 void deactivate( in boolean etherealize_objects, in boolean wait_for_completion) raises(AdapterInactive); - // ****change**** end take out semi-colon after parameter list in 97-04-14 +#endif /* TAO_HAS_MINIMUM_CORBA */ }; // ************************************************** @@ -169,6 +159,7 @@ module PortableServer // // ************************************************** +#if !defined (TAO_HAS_MINIMUM_CORBA) interface AdapterActivator { boolean unknown_adapter(in POA parent, in string name); @@ -214,6 +205,7 @@ module PortableServer in Cookie the_cookie, in Servant the_servant ); }; +#endif /* TAO_HAS_MINIMUM_CORBA */ // ************************************************** @@ -225,10 +217,14 @@ module PortableServer interface POA { exception AdapterAlreadyExists {}; +#if !defined (TAO_HAS_MINIMUM_CORBA) exception AdapterInactive {}; +#endif /* TAO_HAS_MINIMUM_CORBA */ exception AdapterNonExistent {}; exception InvalidPolicy { unsigned short index; }; +#if !defined (TAO_HAS_MINIMUM_CORBA) exception NoServant {}; +#endif /* TAO_HAS_MINIMUM_CORBA */ exception ObjectAlreadyActive {}; exception ObjectNotActive {}; exception ServantAlreadyActive {}; @@ -258,8 +254,10 @@ module PortableServer // Factories for Policy objects // // ************************************************** +#if !defined (TAO_HAS_MINIMUM_CORBA) ThreadPolicy create_thread_policy(in ThreadPolicyValue value); +#endif /* TAO_HAS_MINIMUM_CORBA */ LifespanPolicy create_lifespan_policy(in LifespanPolicyValue value); IdUniquenessPolicy @@ -268,6 +266,7 @@ module PortableServer IdAssignmentPolicy create_id_assignment_policy (in IdAssignmentPolicyValue value); +#if !defined (TAO_HAS_MINIMUM_CORBA) ImplicitActivationPolicy create_implicit_activation_policy (in ImplicitActivationPolicyValue value); @@ -277,16 +276,7 @@ module PortableServer RequestProcessingPolicy create_request_processing_policy (in RequestProcessingPolicyValue value); - - // ************************************************** - // - // TAO spcific POA locking policy (non-standard) - // - // ************************************************** - - SynchronizationPolicy - create_synchronization_policy - (in SynchronizationPolicyValue value); +#endif /* TAO_HAS_MINIMUM_CORBA */ //-------------------------------------------------- // @@ -297,7 +287,9 @@ module PortableServer readonly attribute string the_name; readonly attribute POA the_parent; readonly attribute POAManager the_POAManager; +#if !defined (TAO_HAS_MINIMUM_CORBA) attribute AdapterActivator the_activator; +#endif /* TAO_HAS_MINIMUM_CORBA */ //-------------------------------------------------- @@ -306,6 +298,7 @@ module PortableServer // //-------------------------------------------------- +#if !defined (TAO_HAS_MINIMUM_CORBA) ServantManager get_servant_manager() raises (WrongPolicy); @@ -323,6 +316,7 @@ module PortableServer void set_servant( in Servant p_servant) raises (WrongPolicy); +#endif /* TAO_HAS_MINIMUM_CORBA */ // ************************************************** // diff --git a/TAO/tao/POAC.cpp b/TAO/tao/POAC.cpp index 8eb38eadca0..839a1fd6693 100644 --- a/TAO/tao/POAC.cpp +++ b/TAO/tao/POAC.cpp @@ -62,7 +62,7 @@ CORBA::TypeCode_ptr PortableServer::_tc_ObjectId = &_tc_TAO_tc_PortableServer_Ob // default constructor PortableServer::ForwardRequest::ForwardRequest (void) - : CORBA_SystemException (PortableServer::_tc_ForwardRequest, 0xffff0000L, CORBA::COMPLETED_NO) + : CORBA_UserException (PortableServer::_tc_ForwardRequest) { } @@ -73,7 +73,7 @@ PortableServer::ForwardRequest::~ForwardRequest (void) // copy constructor PortableServer::ForwardRequest::ForwardRequest (const PortableServer::ForwardRequest &_tao_excp) - : CORBA_SystemException (_tao_excp._type (), _tao_excp.minor (), _tao_excp.completed ()) + : CORBA_UserException (_tao_excp._type ()) { this->forward_reference = CORBA::Object::_duplicate (_tao_excp.forward_reference.in ()); } @@ -82,14 +82,14 @@ PortableServer::ForwardRequest::ForwardRequest (const PortableServer::ForwardReq PortableServer::ForwardRequest& PortableServer::ForwardRequest::operator= (const PortableServer::ForwardRequest &_tao_excp) { - this->CORBA_SystemException::operator= (_tao_excp); + this->CORBA_UserException::operator= (_tao_excp); this->forward_reference = CORBA::Object::_duplicate (_tao_excp.forward_reference.in ()); return *this; } PortableServer::ForwardRequest::ForwardRequest( const CORBA::Object_ptr _tao_forward_reference) - : CORBA_SystemException (PortableServer::_tc_ForwardRequest, 0xffff0000L, CORBA::COMPLETED_NO) + : CORBA_UserException (PortableServer::_tc_ForwardRequest) { this->forward_reference = CORBA::Object::_duplicate (_tao_forward_reference); } @@ -202,6 +202,8 @@ static CORBA::TypeCode _tc_TAO_tc_PortableServer_ForwardRequest (CORBA::tk_excep CORBA::TypeCode_ptr PortableServer::_tc_ForwardRequest = &_tc_TAO_tc_PortableServer_ForwardRequest; +#if !defined (TAO_HAS_MINIMUM_CORBA) + static const CORBA::Long _oc_PortableServer_ThreadPolicyValue[] = { TAO_ENCAP_BYTE_ORDER, // byte order @@ -294,6 +296,7 @@ static CORBA::TypeCode _tc_TAO_tc_PortableServer_ThreadPolicy (CORBA::tk_objref, sizeof (PortableServer::ThreadPolicy)); CORBA::TypeCode_ptr PortableServer::_tc_ThreadPolicy = &_tc_TAO_tc_PortableServer_ThreadPolicy; +#endif /* TAO_HAS_MINIMUM_CORBA */ static const CORBA::Long _oc_PortableServer_LifespanPolicyValue[] = { @@ -571,6 +574,8 @@ static CORBA::TypeCode _tc_TAO_tc_PortableServer_IdAssignmentPolicy CORBA::TypeCode_ptr PortableServer::_tc_IdAssignmentPolicy = &_tc_TAO_tc_PortableServer_IdAssignmentPolicy; +#if !defined (TAO_HAS_MINIMUM_CORBA) + static const CORBA::Long _oc_PortableServer_ImplicitActivationPolicyValue[] = { TAO_ENCAP_BYTE_ORDER, // byte order @@ -841,101 +846,7 @@ static CORBA::TypeCode _tc_TAO_tc_PortableServer_RequestProcessingPolicy (PortableServer::RequestProcessingPolicy)); CORBA::TypeCode_ptr PortableServer::_tc_RequestProcessingPolicy = &_tc_TAO_tc_PortableServer_RequestProcessingPolicy; -// ************************************************** -// -// TAO spcific POA locking policy (non-standard) -// -// ************************************************** - -static const CORBA::Long _oc_PortableServer_SynchronizationPolicyValue[] = -{ - TAO_ENCAP_BYTE_ORDER, // byte order - 50, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x506f7274), ACE_NTOHL (0x61626c65), ACE_NTOHL (0x53657276), ACE_NTOHL (0x65722f53), ACE_NTOHL (0x796e6368), ACE_NTOHL (0x726f6e69), ACE_NTOHL (0x7a617469), ACE_NTOHL (0x6f6e506f), ACE_NTOHL (0x6c696379), ACE_NTOHL (0x56616c75), ACE_NTOHL (0x653a312e), ACE_NTOHL (0x3000fdfd), // repository ID = IDL:PortableServer/SynchronizationPolicyValue:1.0 - 27, ACE_NTOHL (0x53796e63), ACE_NTOHL (0x68726f6e), ACE_NTOHL (0x697a6174), ACE_NTOHL (0x696f6e50), ACE_NTOHL (0x6f6c6963), ACE_NTOHL (0x7956616c), ACE_NTOHL (0x756500fd), // name = SynchronizationPolicyValue - 3, // member count - 13, ACE_NTOHL (0x44454641), ACE_NTOHL (0x554c545f), ACE_NTOHL (0x4c4f434b), ACE_NTOHL (0xfdfdfd), // name = DEFAULT_LOCK - 10, ACE_NTOHL (0x4e554c4c), ACE_NTOHL (0x5f4c4f43), ACE_NTOHL (0x4b00fdfd), // name = NULL_LOCK - 12, ACE_NTOHL (0x54485245), ACE_NTOHL (0x41445f4c), ACE_NTOHL (0x4f434b00), // name = THREAD_LOCK -}; -static CORBA::TypeCode _tc_TAO_tc_PortableServer_SynchronizationPolicyValue -(CORBA::tk_enum, sizeof (_oc_PortableServer_SynchronizationPolicyValue), - (char *) &_oc_PortableServer_SynchronizationPolicyValue, 0, sizeof - (PortableServer::SynchronizationPolicyValue)); -CORBA::TypeCode_ptr PortableServer::_tc_SynchronizationPolicyValue = &_tc_TAO_tc_PortableServer_SynchronizationPolicyValue; - -PortableServer::SynchronizationPolicy_ptr PortableServer::SynchronizationPolicy::_duplicate (PortableServer::SynchronizationPolicy_ptr obj) -{ - if (!CORBA::is_nil (obj)) - obj->_incr_refcnt (); - - return obj; -} // end of _duplicate - -PortableServer::SynchronizationPolicy_ptr PortableServer::SynchronizationPolicy::_narrow ( - CORBA::Object_ptr obj, - CORBA::Environment &env - ) -{ - if (CORBA::is_nil (obj)) - return PortableServer::SynchronizationPolicy::_nil (); - if (!obj->_is_a ("IDL:PortableServer/SynchronizationPolicy:1.0", env)) - return PortableServer::SynchronizationPolicy::_nil (); - STUB_Object *stub = obj->_stubobj (); - stub->_incr_refcnt (); - if (!obj->_is_collocated () || !obj->_servant()) - { - return new PortableServer::SynchronizationPolicy (stub); - } // end of if - - void* servant = obj->_servant ()->_downcast ("IDL:PortableServer/SynchronizationPolicy:1.0"); - return new POA_PortableServer::_tao_collocated_SynchronizationPolicy( - ACE_reinterpret_cast(POA_PortableServer::SynchronizationPolicy_ptr, servant), - stub - ); -} - -PortableServer::SynchronizationPolicyValue PortableServer::SynchronizationPolicy::value(CORBA::Environment &env) -{ - static const TAO_Param_Data _get_PortableServer_SynchronizationPolicy_value_paramdata [] = - { - {PortableServer::_tc_SynchronizationPolicyValue, PARAM_RETURN, 0}}; - - static const TAO_Call_Data _get_PortableServer_SynchronizationPolicy_value_calldata = - {"_get_value", 1, 1, _get_PortableServer_SynchronizationPolicy_value_paramdata, 0, 0}; - - PortableServer::SynchronizationPolicyValue retval = - ACE_static_cast (PortableServer::SynchronizationPolicyValue, -1); - - void* _tao_arguments[1]; - void** _tao_current_arg = _tao_arguments; - *_tao_current_arg = &retval; _tao_current_arg++; - this->_stubobj ()->do_static_call (env, &_get_PortableServer_SynchronizationPolicy_value_calldata, _tao_arguments); - return retval; - -} - -CORBA::Boolean PortableServer::SynchronizationPolicy::_is_a (const CORBA::Char *value, CORBA::Environment &_tao_environment) -{ - if ( - (!ACE_OS::strcmp ((char *)value, "IDL:PortableServer/SynchronizationPolicy:1.0")) || - (!ACE_OS::strcmp ((char *)value, "IDL:PortableServer/Policy:1.0")) || - (!ACE_OS::strcmp ((char *)value, CORBA::_tc_Object->id (_tao_environment)))) - return 1; // success using local knowledge - else - return this->CORBA_Object::_is_a (value, _tao_environment); // remote call -} - -static const CORBA::Long _oc_PortableServer_SynchronizationPolicy[] = -{ - TAO_ENCAP_BYTE_ORDER, // byte order - 45, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x506f7274), ACE_NTOHL (0x61626c65), ACE_NTOHL (0x53657276), ACE_NTOHL (0x65722f53), ACE_NTOHL (0x796e6368), ACE_NTOHL (0x726f6e69), ACE_NTOHL (0x7a617469), ACE_NTOHL (0x6f6e506f), ACE_NTOHL (0x6c696379), ACE_NTOHL (0x3a312e30), ACE_NTOHL (0xfdfdfd), // repository ID = IDL:PortableServer/SynchronizationPolicy:1.0 - 22, ACE_NTOHL (0x53796e63), ACE_NTOHL (0x68726f6e), ACE_NTOHL (0x697a6174), ACE_NTOHL (0x696f6e50), ACE_NTOHL (0x6f6c6963), ACE_NTOHL (0x7900fdfd), // name = SynchronizationPolicy, -}; -static CORBA::TypeCode _tc_TAO_tc_PortableServer_SynchronizationPolicy -(CORBA::tk_objref, sizeof (_oc_PortableServer_SynchronizationPolicy), (char *) - &_oc_PortableServer_SynchronizationPolicy, 0, sizeof - (PortableServer::SynchronizationPolicy)); -CORBA::TypeCode_ptr PortableServer::_tc_SynchronizationPolicy = &_tc_TAO_tc_PortableServer_SynchronizationPolicy; +#endif /* TAO_HAS_MINIMUM_CORBA */ PortableServer::POAManager_ptr PortableServer::POAManager::_duplicate (PortableServer::POAManager_ptr obj) { @@ -972,7 +883,7 @@ PortableServer::POAManager_ptr PortableServer::POAManager::_narrow ( // default constructor PortableServer::POAManager::AdapterInactive::AdapterInactive (void) - : CORBA_SystemException (PortableServer::POAManager::_tc_AdapterInactive, 0xffff0000L, CORBA::COMPLETED_NO) + : CORBA_UserException (PortableServer::POAManager::_tc_AdapterInactive) { } @@ -983,7 +894,7 @@ PortableServer::POAManager::AdapterInactive::~AdapterInactive (void) // copy constructor PortableServer::POAManager::AdapterInactive::AdapterInactive (const PortableServer::POAManager::AdapterInactive &_tao_excp) - : CORBA_SystemException (_tao_excp._type (), _tao_excp.minor (), _tao_excp.completed ()) + : CORBA_UserException (_tao_excp._type ()) { } @@ -991,7 +902,7 @@ PortableServer::POAManager::AdapterInactive::AdapterInactive (const PortableServ PortableServer::POAManager::AdapterInactive& PortableServer::POAManager::AdapterInactive::operator= (const PortableServer::POAManager::AdapterInactive &_tao_excp) { - this->CORBA_SystemException::operator= (_tao_excp); + this->CORBA_UserException::operator= (_tao_excp); return *this; } @@ -1118,6 +1029,8 @@ static CORBA::TypeCode _tc_TAO_tc_PortableServer_POAManager (CORBA::tk_objref, sizeof (PortableServer::POAManager)); CORBA::TypeCode_ptr PortableServer::_tc_POAManager = &_tc_TAO_tc_PortableServer_POAManager; +#if !defined (TAO_HAS_MINIMUM_CORBA) + PortableServer::AdapterActivator_ptr PortableServer::AdapterActivator::_duplicate (PortableServer::AdapterActivator_ptr obj) { if (!CORBA::is_nil (obj)) @@ -1346,6 +1259,8 @@ static CORBA::TypeCode _tc_TAO_tc_PortableServer_ServantLocator (CORBA::tk_objre sizeof (PortableServer::ServantLocator)); CORBA::TypeCode_ptr PortableServer::_tc_ServantLocator = &_tc_TAO_tc_PortableServer_ServantLocator; +#endif /* TAO_HAS_MINIMUM_CORBA */ + PortableServer::POA_ptr PortableServer::POA::_duplicate (PortableServer::POA_ptr obj) { if (!CORBA::is_nil (obj)) @@ -1381,7 +1296,7 @@ PortableServer::POA_ptr PortableServer::POA::_narrow ( // default constructor PortableServer::POA::AdapterAlreadyExists::AdapterAlreadyExists (void) - : CORBA_SystemException (PortableServer::POA::_tc_AdapterAlreadyExists, 0xffff0000L, CORBA::COMPLETED_NO) + : CORBA_UserException (PortableServer::POA::_tc_AdapterAlreadyExists) { } @@ -1392,7 +1307,7 @@ PortableServer::POA::AdapterAlreadyExists::~AdapterAlreadyExists (void) // copy constructor PortableServer::POA::AdapterAlreadyExists::AdapterAlreadyExists (const PortableServer::POA::AdapterAlreadyExists &_tao_excp) - : CORBA_SystemException (_tao_excp._type (), _tao_excp.minor (), _tao_excp.completed ()) + : CORBA_UserException (_tao_excp._type ()) { } @@ -1400,7 +1315,7 @@ PortableServer::POA::AdapterAlreadyExists::AdapterAlreadyExists (const PortableS PortableServer::POA::AdapterAlreadyExists& PortableServer::POA::AdapterAlreadyExists::operator= (const PortableServer::POA::AdapterAlreadyExists &_tao_excp) { - this->CORBA_SystemException::operator= (_tao_excp); + this->CORBA_UserException::operator= (_tao_excp); return *this; } @@ -1502,9 +1417,11 @@ static CORBA::TypeCode _tc_TAO_tc_PortableServer_POA_AdapterAlreadyExists (PortableServer::POA::AdapterAlreadyExists)); CORBA::TypeCode_ptr PortableServer::POA::_tc_AdapterAlreadyExists = &_tc_TAO_tc_PortableServer_POA_AdapterAlreadyExists; +#if !defined (TAO_HAS_MINIMUM_CORBA) + // default constructor PortableServer::POA::AdapterInactive::AdapterInactive (void) - : CORBA_SystemException (PortableServer::POA::_tc_AdapterInactive, 0xffff0000L, CORBA::COMPLETED_NO) + : CORBA_UserException (PortableServer::POA::_tc_AdapterInactive) { } @@ -1515,7 +1432,7 @@ PortableServer::POA::AdapterInactive::~AdapterInactive (void) // copy constructor PortableServer::POA::AdapterInactive::AdapterInactive (const PortableServer::POA::AdapterInactive &_tao_excp) - : CORBA_SystemException (_tao_excp._type (), _tao_excp.minor (), _tao_excp.completed ()) + : CORBA_UserException (_tao_excp._type ()) { } @@ -1523,7 +1440,7 @@ PortableServer::POA::AdapterInactive::AdapterInactive (const PortableServer::POA PortableServer::POA::AdapterInactive& PortableServer::POA::AdapterInactive::operator= (const PortableServer::POA::AdapterInactive &_tao_excp) { - this->CORBA_SystemException::operator= (_tao_excp); + this->CORBA_UserException::operator= (_tao_excp); return *this; } @@ -1625,9 +1542,11 @@ static CORBA::TypeCode _tc_TAO_tc_PortableServer_POA_AdapterInactive (PortableServer::POA::AdapterInactive)); CORBA::TypeCode_ptr PortableServer::POA::_tc_AdapterInactive = &_tc_TAO_tc_PortableServer_POA_AdapterInactive; +#endif /* TAO_HAS_MINIMUM_CORBA */ + // default constructor PortableServer::POA::AdapterNonExistent::AdapterNonExistent (void) - : CORBA_SystemException (PortableServer::POA::_tc_AdapterNonExistent, 0xffff0000L, CORBA::COMPLETED_NO) + : CORBA_UserException (PortableServer::POA::_tc_AdapterNonExistent) { } @@ -1638,7 +1557,7 @@ PortableServer::POA::AdapterNonExistent::~AdapterNonExistent (void) // copy constructor PortableServer::POA::AdapterNonExistent::AdapterNonExistent (const PortableServer::POA::AdapterNonExistent &_tao_excp) - : CORBA_SystemException (_tao_excp._type (), _tao_excp.minor (), _tao_excp.completed ()) + : CORBA_UserException (_tao_excp._type ()) { } @@ -1646,7 +1565,7 @@ PortableServer::POA::AdapterNonExistent::AdapterNonExistent (const PortableServe PortableServer::POA::AdapterNonExistent& PortableServer::POA::AdapterNonExistent::operator= (const PortableServer::POA::AdapterNonExistent &_tao_excp) { - this->CORBA_SystemException::operator= (_tao_excp); + this->CORBA_UserException::operator= (_tao_excp); return *this; } @@ -1751,7 +1670,7 @@ CORBA::TypeCode_ptr PortableServer::POA::_tc_AdapterNonExistent = &_tc_TAO_tc_Po // default constructor PortableServer::POA::InvalidPolicy::InvalidPolicy (void) - : CORBA_SystemException (PortableServer::POA::_tc_InvalidPolicy, 0xffff0000L, CORBA::COMPLETED_NO) + : CORBA_UserException (PortableServer::POA::_tc_InvalidPolicy) { } @@ -1762,7 +1681,7 @@ PortableServer::POA::InvalidPolicy::~InvalidPolicy (void) // copy constructor PortableServer::POA::InvalidPolicy::InvalidPolicy (const PortableServer::POA::InvalidPolicy &_tao_excp) - : CORBA_SystemException (_tao_excp._type (), _tao_excp.minor (), _tao_excp.completed ()) + : CORBA_UserException (_tao_excp._type ()) { this->index = _tao_excp.index; } @@ -1771,14 +1690,14 @@ PortableServer::POA::InvalidPolicy::InvalidPolicy (const PortableServer::POA::In PortableServer::POA::InvalidPolicy& PortableServer::POA::InvalidPolicy::operator= (const PortableServer::POA::InvalidPolicy &_tao_excp) { - this->CORBA_SystemException::operator= (_tao_excp); + this->CORBA_UserException::operator= (_tao_excp); this->index = _tao_excp.index; return *this; } PortableServer::POA::InvalidPolicy::InvalidPolicy( CORBA::UShort _tao_index) - : CORBA_SystemException (PortableServer::POA::_tc_InvalidPolicy, 0xffff0000L, CORBA::COMPLETED_NO) + : CORBA_UserException (PortableServer::POA::_tc_InvalidPolicy) { this->index = _tao_index; } @@ -1884,9 +1803,11 @@ static CORBA::TypeCode _tc_TAO_tc_PortableServer_POA_InvalidPolicy (PortableServer::POA::InvalidPolicy)); CORBA::TypeCode_ptr PortableServer::POA::_tc_InvalidPolicy = &_tc_TAO_tc_PortableServer_POA_InvalidPolicy; +#if !defined (TAO_HAS_MINIMUM_CORBA) + // default constructor PortableServer::POA::NoServant::NoServant (void) - : CORBA_SystemException (PortableServer::POA::_tc_NoServant, 0xffff0000L, CORBA::COMPLETED_NO) + : CORBA_UserException (PortableServer::POA::_tc_NoServant) { } @@ -1897,7 +1818,7 @@ PortableServer::POA::NoServant::~NoServant (void) // copy constructor PortableServer::POA::NoServant::NoServant (const PortableServer::POA::NoServant &_tao_excp) - : CORBA_SystemException (_tao_excp._type (), _tao_excp.minor (), _tao_excp.completed ()) + : CORBA_UserException (_tao_excp._type ()) { } @@ -1905,7 +1826,7 @@ PortableServer::POA::NoServant::NoServant (const PortableServer::POA::NoServant PortableServer::POA::NoServant& PortableServer::POA::NoServant::operator= (const PortableServer::POA::NoServant &_tao_excp) { - this->CORBA_SystemException::operator= (_tao_excp); + this->CORBA_UserException::operator= (_tao_excp); return *this; } @@ -2010,9 +1931,11 @@ static CORBA::TypeCode _tc_TAO_tc_PortableServer_POA_NoServant (CORBA::tk_except sizeof (PortableServer::POA::NoServant)); CORBA::TypeCode_ptr PortableServer::POA::_tc_NoServant = &_tc_TAO_tc_PortableServer_POA_NoServant; +#endif /* TAO_HAS_MINIMUM_CORBA */ + // default constructor PortableServer::POA::ObjectAlreadyActive::ObjectAlreadyActive (void) - : CORBA_SystemException (PortableServer::POA::_tc_ObjectAlreadyActive, 0xffff0000L, CORBA::COMPLETED_NO) + : CORBA_UserException (PortableServer::POA::_tc_ObjectAlreadyActive) { } @@ -2023,7 +1946,7 @@ PortableServer::POA::ObjectAlreadyActive::~ObjectAlreadyActive (void) // copy constructor PortableServer::POA::ObjectAlreadyActive::ObjectAlreadyActive (const PortableServer::POA::ObjectAlreadyActive &_tao_excp) - : CORBA_SystemException (_tao_excp._type (), _tao_excp.minor (), _tao_excp.completed ()) + : CORBA_UserException (_tao_excp._type ()) { } @@ -2031,7 +1954,7 @@ PortableServer::POA::ObjectAlreadyActive::ObjectAlreadyActive (const PortableSer PortableServer::POA::ObjectAlreadyActive& PortableServer::POA::ObjectAlreadyActive::operator= (const PortableServer::POA::ObjectAlreadyActive &_tao_excp) { - this->CORBA_SystemException::operator= (_tao_excp); + this->CORBA_UserException::operator= (_tao_excp); return *this; } @@ -2136,7 +2059,7 @@ CORBA::TypeCode_ptr PortableServer::POA::_tc_ObjectAlreadyActive = &_tc_TAO_tc_P // default constructor PortableServer::POA::ObjectNotActive::ObjectNotActive (void) - : CORBA_SystemException (PortableServer::POA::_tc_ObjectNotActive, 0xffff0000L, CORBA::COMPLETED_NO) + : CORBA_UserException (PortableServer::POA::_tc_ObjectNotActive) { } @@ -2147,7 +2070,7 @@ PortableServer::POA::ObjectNotActive::~ObjectNotActive (void) // copy constructor PortableServer::POA::ObjectNotActive::ObjectNotActive (const PortableServer::POA::ObjectNotActive &_tao_excp) - : CORBA_SystemException (_tao_excp._type (), _tao_excp.minor (), _tao_excp.completed ()) + : CORBA_UserException (_tao_excp._type ()) { } @@ -2155,7 +2078,7 @@ PortableServer::POA::ObjectNotActive::ObjectNotActive (const PortableServer::POA PortableServer::POA::ObjectNotActive& PortableServer::POA::ObjectNotActive::operator= (const PortableServer::POA::ObjectNotActive &_tao_excp) { - this->CORBA_SystemException::operator= (_tao_excp); + this->CORBA_UserException::operator= (_tao_excp); return *this; } @@ -2260,7 +2183,7 @@ CORBA::TypeCode_ptr PortableServer::POA::_tc_ObjectNotActive = &_tc_TAO_tc_Porta // default constructor PortableServer::POA::ServantAlreadyActive::ServantAlreadyActive (void) - : CORBA_SystemException (PortableServer::POA::_tc_ServantAlreadyActive, 0xffff0000L, CORBA::COMPLETED_NO) + : CORBA_UserException (PortableServer::POA::_tc_ServantAlreadyActive) { } @@ -2271,7 +2194,7 @@ PortableServer::POA::ServantAlreadyActive::~ServantAlreadyActive (void) // copy constructor PortableServer::POA::ServantAlreadyActive::ServantAlreadyActive (const PortableServer::POA::ServantAlreadyActive &_tao_excp) - : CORBA_SystemException (_tao_excp._type (), _tao_excp.minor (), _tao_excp.completed ()) + : CORBA_UserException (_tao_excp._type ()) { } @@ -2279,7 +2202,7 @@ PortableServer::POA::ServantAlreadyActive::ServantAlreadyActive (const PortableS PortableServer::POA::ServantAlreadyActive& PortableServer::POA::ServantAlreadyActive::operator= (const PortableServer::POA::ServantAlreadyActive &_tao_excp) { - this->CORBA_SystemException::operator= (_tao_excp); + this->CORBA_UserException::operator= (_tao_excp); return *this; } @@ -2384,7 +2307,7 @@ CORBA::TypeCode_ptr PortableServer::POA::_tc_ServantAlreadyActive = &_tc_TAO_tc_ // default constructor PortableServer::POA::ServantNotActive::ServantNotActive (void) - : CORBA_SystemException (PortableServer::POA::_tc_ServantNotActive, 0xffff0000L, CORBA::COMPLETED_NO) + : CORBA_UserException (PortableServer::POA::_tc_ServantNotActive) { } @@ -2395,7 +2318,7 @@ PortableServer::POA::ServantNotActive::~ServantNotActive (void) // copy constructor PortableServer::POA::ServantNotActive::ServantNotActive (const PortableServer::POA::ServantNotActive &_tao_excp) - : CORBA_SystemException (_tao_excp._type (), _tao_excp.minor (), _tao_excp.completed ()) + : CORBA_UserException (_tao_excp._type ()) { } @@ -2403,7 +2326,7 @@ PortableServer::POA::ServantNotActive::ServantNotActive (const PortableServer::P PortableServer::POA::ServantNotActive& PortableServer::POA::ServantNotActive::operator= (const PortableServer::POA::ServantNotActive &_tao_excp) { - this->CORBA_SystemException::operator= (_tao_excp); + this->CORBA_UserException::operator= (_tao_excp); return *this; } @@ -2508,7 +2431,7 @@ CORBA::TypeCode_ptr PortableServer::POA::_tc_ServantNotActive = &_tc_TAO_tc_Port // default constructor PortableServer::POA::WrongAdapter::WrongAdapter (void) - : CORBA_SystemException (PortableServer::POA::_tc_WrongAdapter, 0xffff0000L, CORBA::COMPLETED_NO) + : CORBA_UserException (PortableServer::POA::_tc_WrongAdapter) { } @@ -2519,7 +2442,7 @@ PortableServer::POA::WrongAdapter::~WrongAdapter (void) // copy constructor PortableServer::POA::WrongAdapter::WrongAdapter (const PortableServer::POA::WrongAdapter &_tao_excp) - : CORBA_SystemException (_tao_excp._type (), _tao_excp.minor (), _tao_excp.completed ()) + : CORBA_UserException (_tao_excp._type ()) { } @@ -2527,7 +2450,7 @@ PortableServer::POA::WrongAdapter::WrongAdapter (const PortableServer::POA::Wron PortableServer::POA::WrongAdapter& PortableServer::POA::WrongAdapter::operator= (const PortableServer::POA::WrongAdapter &_tao_excp) { - this->CORBA_SystemException::operator= (_tao_excp); + this->CORBA_UserException::operator= (_tao_excp); return *this; } @@ -2632,7 +2555,7 @@ CORBA::TypeCode_ptr PortableServer::POA::_tc_WrongAdapter = &_tc_TAO_tc_Portable // default constructor PortableServer::POA::WrongPolicy::WrongPolicy (void) - : CORBA_SystemException (PortableServer::POA::_tc_WrongPolicy, 0xffff0000L, CORBA::COMPLETED_NO) + : CORBA_UserException (PortableServer::POA::_tc_WrongPolicy) { } @@ -2643,7 +2566,7 @@ PortableServer::POA::WrongPolicy::~WrongPolicy (void) // copy constructor PortableServer::POA::WrongPolicy::WrongPolicy (const PortableServer::POA::WrongPolicy &_tao_excp) - : CORBA_SystemException (_tao_excp._type (), _tao_excp.minor (), _tao_excp.completed ()) + : CORBA_UserException (_tao_excp._type ()) { } @@ -2651,7 +2574,7 @@ PortableServer::POA::WrongPolicy::WrongPolicy (const PortableServer::POA::WrongP PortableServer::POA::WrongPolicy& PortableServer::POA::WrongPolicy::operator= (const PortableServer::POA::WrongPolicy &_tao_excp) { - this->CORBA_SystemException::operator= (_tao_excp); + this->CORBA_UserException::operator= (_tao_excp); return *this; } @@ -2813,7 +2736,7 @@ PortableServer::Current_ptr PortableServer::Current::_narrow ( // default constructor PortableServer::Current::NoContext::NoContext (void) - : CORBA_SystemException (PortableServer::Current::_tc_NoContext, 0xffff0000L, CORBA::COMPLETED_NO) + : CORBA_UserException (PortableServer::Current::_tc_NoContext) { } @@ -2824,7 +2747,7 @@ PortableServer::Current::NoContext::~NoContext (void) // copy constructor PortableServer::Current::NoContext::NoContext (const PortableServer::Current::NoContext &_tao_excp) - : CORBA_SystemException (_tao_excp._type (), _tao_excp.minor (), _tao_excp.completed ()) + : CORBA_UserException (_tao_excp._type ()) { } @@ -2832,7 +2755,7 @@ PortableServer::Current::NoContext::NoContext (const PortableServer::Current::No PortableServer::Current::NoContext& PortableServer::Current::NoContext::operator= (const PortableServer::Current::NoContext &_tao_excp) { - this->CORBA_SystemException::operator= (_tao_excp); + this->CORBA_UserException::operator= (_tao_excp); return *this; } diff --git a/TAO/tao/POAC.h b/TAO/tao/POAC.h index deb5cbd3ff1..54b0f1f4f8d 100644 --- a/TAO/tao/POAC.h +++ b/TAO/tao/POAC.h @@ -192,7 +192,7 @@ public: #if !defined (_PORTABLESERVER_FORWARDREQUEST_CH_) #define _PORTABLESERVER_FORWARDREQUEST_CH_ - class TAO_Export ForwardRequest : public CORBA_SystemException + class TAO_Export ForwardRequest : public CORBA_UserException { public: ForwardRequest (void); // default ctor @@ -226,6 +226,9 @@ public: ORB_CTRL_MODEL, SINGLE_THREAD_MODEL }; + +#if !defined (TAO_HAS_MINIMUM_CORBA) + typedef ThreadPolicyValue &ThreadPolicyValue_out; static CORBA::TypeCode_ptr _tc_ThreadPolicyValue; @@ -318,6 +321,8 @@ public: static CORBA::TypeCode_ptr _tc_ThreadPolicy; +#endif /* TAO_HAS_MINIMUM_CORBA */ + enum LifespanPolicyValue { TRANSIENT, @@ -620,6 +625,9 @@ public: IMPLICIT_ACTIVATION, NO_IMPLICIT_ACTIVATION }; + +#if !defined (TAO_HAS_MINIMUM_CORBA) + typedef ImplicitActivationPolicyValue &ImplicitActivationPolicyValue_out; static CORBA::TypeCode_ptr _tc_ImplicitActivationPolicyValue; @@ -714,11 +722,16 @@ public: static CORBA::TypeCode_ptr _tc_ImplicitActivationPolicy; +#endif /* TAO_HAS_MINIMUM_CORBA */ + enum ServantRetentionPolicyValue { RETAIN, NON_RETAIN }; + +#if !defined (TAO_HAS_MINIMUM_CORBA) + typedef ServantRetentionPolicyValue &ServantRetentionPolicyValue_out; static CORBA::TypeCode_ptr _tc_ServantRetentionPolicyValue; @@ -813,12 +826,17 @@ public: static CORBA::TypeCode_ptr _tc_ServantRetentionPolicy; +#endif /* TAO_HAS_MINIMUM_CORBA */ + enum RequestProcessingPolicyValue { USE_ACTIVE_OBJECT_MAP_ONLY, USE_DEFAULT_SERVANT, USE_SERVANT_MANAGER }; + +#if !defined (TAO_HAS_MINIMUM_CORBA) + typedef RequestProcessingPolicyValue &RequestProcessingPolicyValue_out; static CORBA::TypeCode_ptr _tc_RequestProcessingPolicyValue; @@ -913,112 +931,7 @@ public: static CORBA::TypeCode_ptr _tc_RequestProcessingPolicy; - // ************************************************** - // - // TAO spcific POA locking policy (non-standard) - // - // ************************************************** - - enum SynchronizationPolicyValue - { - DEFAULT_LOCK, - NULL_LOCK, - THREAD_LOCK - }; - typedef SynchronizationPolicyValue &SynchronizationPolicyValue_out; - static CORBA::TypeCode_ptr _tc_SynchronizationPolicyValue; - - -#if !defined (_PORTABLESERVER_SYNCHRONIZATIONPOLICY___PTR_CH_) -#define _PORTABLESERVER_SYNCHRONIZATIONPOLICY___PTR_CH_ - - class SynchronizationPolicy; - typedef SynchronizationPolicy *SynchronizationPolicy_ptr; - -#endif /* end #if !defined */ - -#if !defined (_PORTABLESERVER_SYNCHRONIZATIONPOLICY___VAR_CH_) -#define _PORTABLESERVER_SYNCHRONIZATIONPOLICY___VAR_CH_ - - class TAO_Export SynchronizationPolicy_var - { - public: - SynchronizationPolicy_var (void); // default constructor - SynchronizationPolicy_var (SynchronizationPolicy_ptr); - SynchronizationPolicy_var (const SynchronizationPolicy_var &); // copy constructor - ~SynchronizationPolicy_var (void); // destructor - - SynchronizationPolicy_var &operator= (SynchronizationPolicy_ptr); - SynchronizationPolicy_var &operator= (const SynchronizationPolicy_var &); - SynchronizationPolicy_ptr operator-> (void) const; - - operator const SynchronizationPolicy_ptr &() const; - operator SynchronizationPolicy_ptr &(); - // in, inout, out, _retn - SynchronizationPolicy_ptr in (void) const; - SynchronizationPolicy_ptr &inout (void); - SynchronizationPolicy_ptr &out (void); - SynchronizationPolicy_ptr _retn (void); - SynchronizationPolicy_ptr ptr (void) const; - - private: - SynchronizationPolicy_ptr ptr_; - }; - -#endif /* end #if !defined */ - -#if !defined (_PORTABLESERVER_SYNCHRONIZATIONPOLICY___OUT_CH_) -#define _PORTABLESERVER_SYNCHRONIZATIONPOLICY___OUT_CH_ - - class TAO_Export SynchronizationPolicy_out - { - public: - SynchronizationPolicy_out (SynchronizationPolicy_ptr &); - SynchronizationPolicy_out (SynchronizationPolicy_var &); - SynchronizationPolicy_out (SynchronizationPolicy_out &); - SynchronizationPolicy_out &operator= (SynchronizationPolicy_out &); - SynchronizationPolicy_out &operator= (const SynchronizationPolicy_var &); - SynchronizationPolicy_out &operator= (SynchronizationPolicy_ptr); - operator SynchronizationPolicy_ptr &(); - SynchronizationPolicy_ptr &ptr (void); - SynchronizationPolicy_ptr operator-> (void); - - private: - SynchronizationPolicy_ptr &ptr_; - }; - -#endif /* end #if !defined */ - -#if !defined (_PORTABLESERVER_SYNCHRONIZATIONPOLICY_CH_) -#define _PORTABLESERVER_SYNCHRONIZATIONPOLICY_CH_ - - class TAO_Export SynchronizationPolicy: public virtual ACE_CORBA_1 (Policy) - { - public: - // the static operations - static SynchronizationPolicy_ptr _duplicate (SynchronizationPolicy_ptr obj); - static SynchronizationPolicy_ptr _narrow (CORBA::Object_ptr obj, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - static SynchronizationPolicy_ptr _nil (void); - - virtual SynchronizationPolicyValue value (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - virtual CORBA::Boolean _is_a (const CORBA::Char *type_id, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - protected: - SynchronizationPolicy ( - STUB_Object *objref = 0, - TAO_ServantBase *servant = 0, - CORBA::Boolean collocated = 0 - ); - public: - virtual ~SynchronizationPolicy (void); - private: - SynchronizationPolicy (const SynchronizationPolicy&); - void operator= (const SynchronizationPolicy&); - }; - -#endif /* end #if !defined */ - - static CORBA::TypeCode_ptr _tc_SynchronizationPolicy; - +#endif /* TAO_HAS_MINIMUM_CORBA */ #if !defined (_PORTABLESERVER_POAMANAGER___PTR_CH_) #define _PORTABLESERVER_POAMANAGER___PTR_CH_ @@ -1103,7 +1016,7 @@ public: #if !defined (_PORTABLESERVER_POAMANAGER_ADAPTERINACTIVE_CH_) #define _PORTABLESERVER_POAMANAGER_ADAPTERINACTIVE_CH_ - class TAO_Export AdapterInactive : public CORBA_SystemException + class TAO_Export AdapterInactive : public CORBA_UserException { public: AdapterInactive (void); // default ctor @@ -1125,9 +1038,15 @@ public: #endif /* end #if !defined */ virtual void activate (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; + +#if !defined (TAO_HAS_MINIMUM_CORBA) + virtual void hold_requests (CORBA::Boolean wait_for_completion, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; virtual void discard_requests (CORBA::Boolean wait_for_completion, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; virtual void deactivate (CORBA::Boolean etherealize_objects, CORBA::Boolean wait_for_completion, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; + +#endif /* TAO_HAS_MINIMUM_CORBA */ + virtual CORBA::Boolean _is_a (const CORBA::Char *type_id, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); protected: POAManager ( @@ -1146,6 +1065,7 @@ public: static CORBA::TypeCode_ptr _tc_POAManager; +#if !defined (TAO_HAS_MINIMUM_CORBA) #if !defined (_PORTABLESERVER_ADAPTERACTIVATOR___PTR_CH_) #define _PORTABLESERVER_ADAPTERACTIVATOR___PTR_CH_ @@ -1515,6 +1435,7 @@ public: static CORBA::TypeCode_ptr _tc_ServantLocator; +#endif /* TAO_HAS_MINIMUM_CORBA */ #if !defined (_PORTABLESERVER_POA___PTR_CH_) #define _PORTABLESERVER_POA___PTR_CH_ @@ -1599,7 +1520,7 @@ public: #if !defined (_PORTABLESERVER_POA_ADAPTERALREADYEXISTS_CH_) #define _PORTABLESERVER_POA_ADAPTERALREADYEXISTS_CH_ - class TAO_Export AdapterAlreadyExists : public CORBA_SystemException + class TAO_Export AdapterAlreadyExists : public CORBA_UserException { public: AdapterAlreadyExists (void); // default ctor @@ -1620,6 +1541,8 @@ public: #endif /* end #if !defined */ +#if !defined (TAO_HAS_MINIMUM_CORBA) + #if !defined (_PORTABLESERVER_POA_ADAPTERINACTIVE___PTR_CH_) #define _PORTABLESERVER_POA_ADAPTERINACTIVE___PTR_CH_ @@ -1631,7 +1554,7 @@ public: #if !defined (_PORTABLESERVER_POA_ADAPTERINACTIVE_CH_) #define _PORTABLESERVER_POA_ADAPTERINACTIVE_CH_ - class TAO_Export AdapterInactive : public CORBA_SystemException + class TAO_Export AdapterInactive : public CORBA_UserException { public: AdapterInactive (void); // default ctor @@ -1652,6 +1575,8 @@ public: #endif /* end #if !defined */ +#endif /* TAO_HAS_MINIMUM_CORBA */ + #if !defined (_PORTABLESERVER_POA_ADAPTERNONEXISTENT___PTR_CH_) #define _PORTABLESERVER_POA_ADAPTERNONEXISTENT___PTR_CH_ @@ -1663,7 +1588,7 @@ public: #if !defined (_PORTABLESERVER_POA_ADAPTERNONEXISTENT_CH_) #define _PORTABLESERVER_POA_ADAPTERNONEXISTENT_CH_ - class TAO_Export AdapterNonExistent : public CORBA_SystemException + class TAO_Export AdapterNonExistent : public CORBA_UserException { public: AdapterNonExistent (void); // default ctor @@ -1695,7 +1620,7 @@ public: #if !defined (_PORTABLESERVER_POA_INVALIDPOLICY_CH_) #define _PORTABLESERVER_POA_INVALIDPOLICY_CH_ - class TAO_Export InvalidPolicy : public CORBA_SystemException + class TAO_Export InvalidPolicy : public CORBA_UserException { public: InvalidPolicy (void); // default ctor @@ -1722,6 +1647,8 @@ public: #endif /* end #if !defined */ +#if !defined (TAO_HAS_MINIMUM_CORBA) + #if !defined (_PORTABLESERVER_POA_NOSERVANT___PTR_CH_) #define _PORTABLESERVER_POA_NOSERVANT___PTR_CH_ @@ -1733,7 +1660,7 @@ public: #if !defined (_PORTABLESERVER_POA_NOSERVANT_CH_) #define _PORTABLESERVER_POA_NOSERVANT_CH_ - class TAO_Export NoServant : public CORBA_SystemException + class TAO_Export NoServant : public CORBA_UserException { public: NoServant (void); // default ctor @@ -1754,6 +1681,8 @@ public: #endif /* end #if !defined */ +#endif /* TAO_HAS_MINIMUM_CORBA */ + #if !defined (_PORTABLESERVER_POA_OBJECTALREADYACTIVE___PTR_CH_) #define _PORTABLESERVER_POA_OBJECTALREADYACTIVE___PTR_CH_ @@ -1765,7 +1694,7 @@ public: #if !defined (_PORTABLESERVER_POA_OBJECTALREADYACTIVE_CH_) #define _PORTABLESERVER_POA_OBJECTALREADYACTIVE_CH_ - class TAO_Export ObjectAlreadyActive : public CORBA_SystemException + class TAO_Export ObjectAlreadyActive : public CORBA_UserException { public: ObjectAlreadyActive (void); // default ctor @@ -1797,7 +1726,7 @@ public: #if !defined (_PORTABLESERVER_POA_OBJECTNOTACTIVE_CH_) #define _PORTABLESERVER_POA_OBJECTNOTACTIVE_CH_ - class TAO_Export ObjectNotActive : public CORBA_SystemException + class TAO_Export ObjectNotActive : public CORBA_UserException { public: ObjectNotActive (void); // default ctor @@ -1829,7 +1758,7 @@ public: #if !defined (_PORTABLESERVER_POA_SERVANTALREADYACTIVE_CH_) #define _PORTABLESERVER_POA_SERVANTALREADYACTIVE_CH_ - class TAO_Export ServantAlreadyActive : public CORBA_SystemException + class TAO_Export ServantAlreadyActive : public CORBA_UserException { public: ServantAlreadyActive (void); // default ctor @@ -1861,7 +1790,7 @@ public: #if !defined (_PORTABLESERVER_POA_SERVANTNOTACTIVE_CH_) #define _PORTABLESERVER_POA_SERVANTNOTACTIVE_CH_ - class TAO_Export ServantNotActive : public CORBA_SystemException + class TAO_Export ServantNotActive : public CORBA_UserException { public: ServantNotActive (void); // default ctor @@ -1893,7 +1822,7 @@ public: #if !defined (_PORTABLESERVER_POA_WRONGADAPTER_CH_) #define _PORTABLESERVER_POA_WRONGADAPTER_CH_ - class TAO_Export WrongAdapter : public CORBA_SystemException + class TAO_Export WrongAdapter : public CORBA_UserException { public: WrongAdapter (void); // default ctor @@ -1925,7 +1854,7 @@ public: #if !defined (_PORTABLESERVER_POA_WRONGPOLICY_CH_) #define _PORTABLESERVER_POA_WRONGPOLICY_CH_ - class TAO_Export WrongPolicy : public CORBA_SystemException + class TAO_Export WrongPolicy : public CORBA_UserException { public: WrongPolicy (void); // default ctor @@ -1949,31 +1878,40 @@ public: virtual POA_ptr create_POA (const char *adapter_name, POAManager_ptr a_POAManager, const CORBA::PolicyList &policies, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; virtual POA_ptr find_POA (const char *adapter_name, CORBA::Boolean activate_it, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; virtual void destroy (CORBA::Boolean etherealize_objects, CORBA::Boolean wait_for_completion, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; + +#if !defined (TAO_HAS_MINIMUM_CORBA) + virtual ThreadPolicy_ptr create_thread_policy (ThreadPolicyValue value, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; + +#endif /* TAO_HAS_MINIMUM_CORBA */ + virtual LifespanPolicy_ptr create_lifespan_policy (LifespanPolicyValue value, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; virtual IdUniquenessPolicy_ptr create_id_uniqueness_policy (IdUniquenessPolicyValue value, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; virtual IdAssignmentPolicy_ptr create_id_assignment_policy (IdAssignmentPolicyValue value, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; + +#if !defined (TAO_HAS_MINIMUM_CORBA) + virtual ImplicitActivationPolicy_ptr create_implicit_activation_policy (ImplicitActivationPolicyValue value, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; virtual ServantRetentionPolicy_ptr create_servant_retention_policy (ServantRetentionPolicyValue value, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; virtual RequestProcessingPolicy_ptr create_request_processing_policy (RequestProcessingPolicyValue value, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; - // ************************************************** - // - // TAO spcific POA locking policy (non-standard) - // - // ************************************************** - - virtual SynchronizationPolicy_ptr create_synchronization_policy (SynchronizationPolicyValue value, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; +#endif /* TAO_HAS_MINIMUM_CORBA */ virtual char * the_name (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; virtual POA_ptr the_parent (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; virtual POAManager_ptr the_POAManager (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; + +#if !defined (TAO_HAS_MINIMUM_CORBA) + virtual AdapterActivator_ptr the_activator (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; virtual void the_activator(AdapterActivator_ptr the_activator, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; virtual ServantManager_ptr get_servant_manager (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; virtual void set_servant_manager (ServantManager_ptr imgr, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; virtual Servant get_servant (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; virtual void set_servant (Servant p_servant, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; + +#endif /* TAO_HAS_MINIMUM_CORBA */ + virtual ObjectId * activate_object (Servant p_servant, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; virtual void activate_object_with_id (const ObjectId &id, Servant p_servant, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; virtual void deactivate_object (const ObjectId &oid, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; @@ -2087,7 +2025,7 @@ public: #if !defined (_PORTABLESERVER_CURRENT_NOCONTEXT_CH_) #define _PORTABLESERVER_CURRENT_NOCONTEXT_CH_ - class TAO_Export NoContext : public CORBA_SystemException + class TAO_Export NoContext : public CORBA_UserException { public: NoContext (void); // default ctor diff --git a/TAO/tao/POAC.i b/TAO/tao/POAC.i index 58b8246b725..55604f8e096 100644 --- a/TAO/tao/POAC.i +++ b/TAO/tao/POAC.i @@ -382,6 +382,8 @@ PortableServer::_tao_seq_Octet_out::operator[] (CORBA::ULong index) #endif // end #if !defined +#if !defined (TAO_HAS_MINIMUM_CORBA) + ACE_INLINE PortableServer::ThreadPolicy::ThreadPolicy( STUB_Object *objref, @@ -505,7 +507,6 @@ PortableServer::ThreadPolicy_var::_retn (void) #endif // end #if !defined - #if !defined (_PORTABLESERVER_THREADPOLICY___OUT_CI_) #define _PORTABLESERVER_THREADPOLICY___OUT_CI_ @@ -575,6 +576,8 @@ PortableServer::ThreadPolicy_out::operator-> (void) #endif // end #if !defined +#endif /* TAO_HAS_MINIMUM_CORBA */ + ACE_INLINE PortableServer::LifespanPolicy::LifespanPolicy( STUB_Object *objref, @@ -1154,6 +1157,8 @@ PortableServer::IdAssignmentPolicy_out::operator-> (void) #endif // end #if !defined +#if !defined (TAO_HAS_MINIMUM_CORBA) + ACE_INLINE PortableServer::ImplicitActivationPolicy::ImplicitActivationPolicy( STUB_Object *objref, @@ -1733,204 +1738,7 @@ PortableServer::RequestProcessingPolicy_out::operator-> (void) #endif // end #if !defined -// ************************************************** -// -// TAO spcific POA locking policy (non-standard) -// -// ************************************************** - -ACE_INLINE -PortableServer::SynchronizationPolicy::SynchronizationPolicy( - STUB_Object *objref, - TAO_ServantBase *servant, - CORBA::Boolean collocated - ) - : ACE_CORBA_1 (Object) (objref, servant, collocated) -{} - -ACE_INLINE -PortableServer::SynchronizationPolicy::~SynchronizationPolicy (void) // destructor -{} - -ACE_INLINE PortableServer::SynchronizationPolicy_ptr -PortableServer::SynchronizationPolicy::_nil (void) -{ - return (PortableServer::SynchronizationPolicy_ptr)0; -} - - -#if !defined (_PORTABLESERVER_SYNCHRONIZATIONPOLICY___VAR_CI_) -#define _PORTABLESERVER_SYNCHRONIZATIONPOLICY___VAR_CI_ - -// ************************************************************* -// Inline operations for class PortableServer::SynchronizationPolicy_var -// ************************************************************* - -ACE_INLINE -PortableServer::SynchronizationPolicy_var::SynchronizationPolicy_var (void) // default constructor - : ptr_ (PortableServer::SynchronizationPolicy::_nil ()) -{} - -ACE_INLINE -PortableServer::SynchronizationPolicy_var::SynchronizationPolicy_var (PortableServer::SynchronizationPolicy_ptr p) - : ptr_ (p) -{} - -ACE_INLINE PortableServer::SynchronizationPolicy_ptr -PortableServer::SynchronizationPolicy_var::ptr (void) const -{ - return this->ptr_; -} - -ACE_INLINE -PortableServer::SynchronizationPolicy_var::SynchronizationPolicy_var (const PortableServer::SynchronizationPolicy_var &p) // copy constructor - : ptr_ (PortableServer::SynchronizationPolicy::_duplicate (p.ptr ())) -{} - -ACE_INLINE -PortableServer::SynchronizationPolicy_var::~SynchronizationPolicy_var (void) // destructor -{ - CORBA::release (this->ptr_); -} - -ACE_INLINE PortableServer::SynchronizationPolicy_var & -PortableServer::SynchronizationPolicy_var::operator= (PortableServer::SynchronizationPolicy_ptr p) -{ - CORBA::release (this->ptr_); - this->ptr_ = p; - return *this; -} - -ACE_INLINE PortableServer::SynchronizationPolicy_var & -PortableServer::SynchronizationPolicy_var::operator= (const PortableServer::SynchronizationPolicy_var &p) -{ - if (this != &p) - { - CORBA::release (this->ptr_); - this->ptr_ = PortableServer::SynchronizationPolicy::_duplicate (p.ptr ()); - } - return *this; -} - -ACE_INLINE -PortableServer::SynchronizationPolicy_var::operator const PortableServer::SynchronizationPolicy_ptr &() const // cast -{ - return this->ptr_; -} - -ACE_INLINE -PortableServer::SynchronizationPolicy_var::operator PortableServer::SynchronizationPolicy_ptr &() // cast -{ - return this->ptr_; -} - -ACE_INLINE PortableServer::SynchronizationPolicy_ptr -PortableServer::SynchronizationPolicy_var::operator-> (void) const -{ - return this->ptr_; -} - -ACE_INLINE PortableServer::SynchronizationPolicy_ptr -PortableServer::SynchronizationPolicy_var::in (void) const -{ - return this->ptr_; -} - -ACE_INLINE PortableServer::SynchronizationPolicy_ptr & -PortableServer::SynchronizationPolicy_var::inout (void) -{ - return this->ptr_; -} - -ACE_INLINE PortableServer::SynchronizationPolicy_ptr & -PortableServer::SynchronizationPolicy_var::out (void) -{ - CORBA::release (this->ptr_); - this->ptr_ = PortableServer::SynchronizationPolicy::_nil (); - return this->ptr_; -} - -ACE_INLINE PortableServer::SynchronizationPolicy_ptr -PortableServer::SynchronizationPolicy_var::_retn (void) -{ - // yield ownership of managed obj reference - PortableServer::SynchronizationPolicy_ptr val = this->ptr_; - this->ptr_ = PortableServer::SynchronizationPolicy::_nil (); - return val; -} - - -#endif // end #if !defined - - -#if !defined (_PORTABLESERVER_SYNCHRONIZATIONPOLICY___OUT_CI_) -#define _PORTABLESERVER_SYNCHRONIZATIONPOLICY___OUT_CI_ - -// ************************************************************* -// Inline operations for class PortableServer::SynchronizationPolicy_out -// ************************************************************* - -ACE_INLINE -PortableServer::SynchronizationPolicy_out::SynchronizationPolicy_out (PortableServer::SynchronizationPolicy_ptr &p) - : ptr_ (p) -{ - this->ptr_ = PortableServer::SynchronizationPolicy::_nil (); -} - -ACE_INLINE -PortableServer::SynchronizationPolicy_out::SynchronizationPolicy_out (PortableServer::SynchronizationPolicy_var &p) // constructor from _var - : ptr_ (p.out ()) -{ - CORBA::release (this->ptr_); - this->ptr_ = PortableServer::SynchronizationPolicy::_nil (); -} - -ACE_INLINE -PortableServer::SynchronizationPolicy_out::SynchronizationPolicy_out (PortableServer::SynchronizationPolicy_out &p) // copy constructor - : ptr_ (p.ptr_) -{} - -ACE_INLINE PortableServer::SynchronizationPolicy_out & -PortableServer::SynchronizationPolicy_out::operator= (PortableServer::SynchronizationPolicy_out &p) -{ - this->ptr_ = p.ptr_; - return *this; -} - -ACE_INLINE PortableServer::SynchronizationPolicy_out & -PortableServer::SynchronizationPolicy_out::operator= (const PortableServer::SynchronizationPolicy_var &p) -{ - this->ptr_ = PortableServer::SynchronizationPolicy::_duplicate (p.ptr ()); - return *this; -} - -ACE_INLINE PortableServer::SynchronizationPolicy_out & -PortableServer::SynchronizationPolicy_out::operator= (PortableServer::SynchronizationPolicy_ptr p) -{ - this->ptr_ = p; - return *this; -} - -ACE_INLINE -PortableServer::SynchronizationPolicy_out::operator PortableServer::SynchronizationPolicy_ptr &() // cast -{ - return this->ptr_; -} - -ACE_INLINE PortableServer::SynchronizationPolicy_ptr & -PortableServer::SynchronizationPolicy_out::ptr (void) // ptr -{ - return this->ptr_; -} - -ACE_INLINE PortableServer::SynchronizationPolicy_ptr -PortableServer::SynchronizationPolicy_out::operator-> (void) -{ - return this->ptr_; -} - - -#endif // end #if !defined +#endif /* TAO_HAS_MINIMUM_CORBA */ ACE_INLINE PortableServer::POAManager::POAManager( @@ -2125,6 +1933,8 @@ PortableServer::POAManager_out::operator-> (void) #endif // end #if !defined +#if !defined (TAO_HAS_MINIMUM_CORBA) + ACE_INLINE PortableServer::AdapterActivator::AdapterActivator( STUB_Object *objref, @@ -2897,6 +2707,8 @@ PortableServer::ServantLocator_out::operator-> (void) #endif // end #if !defined +#endif /* TAO_HAS_MINIMUM_CORBA */ + ACE_INLINE PortableServer::POA::POA( STUB_Object *objref, diff --git a/TAO/tao/POAManager.cpp b/TAO/tao/POAManager.cpp index 61cfe5c13e8..2285263ef98 100644 --- a/TAO/tao/POAManager.cpp +++ b/TAO/tao/POAManager.cpp @@ -37,6 +37,8 @@ TAO_POA_Manager::activate_i (CORBA::Environment &ACE_TRY_ENV) this->state_ = TAO_POA_Manager::ACTIVE; } +#if !defined (TAO_HAS_MINIMUM_CORBA) + void TAO_POA_Manager::hold_requests_i (CORBA::Boolean wait_for_completion, CORBA::Environment &ACE_TRY_ENV) @@ -154,6 +156,8 @@ TAO_POA_Manager::deactivate_i (CORBA::Boolean etherealize_objects, // of ORB::shutdown. } +#endif /* TAO_HAS_MINIMUM_CORBA */ + TAO_POA_Manager::Processing_State TAO_POA_Manager::state (CORBA::Environment &ACE_TRY_ENV) { diff --git a/TAO/tao/POAManager.h b/TAO/tao/POAManager.h index deeb0514c69..54f69e721cd 100644 --- a/TAO/tao/POAManager.h +++ b/TAO/tao/POAManager.h @@ -44,6 +44,8 @@ public: virtual void activate (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); +#if !defined (TAO_HAS_MINIMUM_CORBA) + virtual void hold_requests (CORBA::Boolean wait_for_completion, CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); @@ -54,6 +56,8 @@ public: CORBA::Boolean wait_for_completion, CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); +#endif /* TAO_HAS_MINIMUM_CORBA */ + TAO_POA_Manager (void); virtual TAO_POA_Manager *clone (void); @@ -66,6 +70,8 @@ protected: virtual void activate_i (CORBA_Environment &ACE_TRY_ENV); +#if !defined (TAO_HAS_MINIMUM_CORBA) + virtual void hold_requests_i (CORBA::Boolean wait_for_completion, CORBA_Environment &ACE_TRY_ENV); @@ -76,6 +82,8 @@ protected: CORBA::Boolean wait_for_completion, CORBA_Environment &ACE_TRY_ENV); +#endif /* TAO_HAS_MINIMUM_CORBA */ + virtual ACE_Lock &lock (void); virtual void remove_poa (TAO_POA *poa, diff --git a/TAO/tao/POAManager.i b/TAO/tao/POAManager.i index e63eb76656a..971833858b2 100644 --- a/TAO/tao/POAManager.i +++ b/TAO/tao/POAManager.i @@ -15,6 +15,8 @@ TAO_POA_Manager::activate (CORBA_Environment &ACE_TRY_ENV) this->activate_i (ACE_TRY_ENV); } +#if !defined (TAO_HAS_MINIMUM_CORBA) + ACE_INLINE void TAO_POA_Manager::hold_requests (CORBA::Boolean wait_for_completion, CORBA_Environment &ACE_TRY_ENV) @@ -48,6 +50,8 @@ TAO_POA_Manager::deactivate (CORBA::Boolean etherealize_objects, ACE_TRY_ENV); } +#endif /* TAO_HAS_MINIMUM_CORBA */ + ACE_INLINE TAO_POA_Manager * TAO_POA_Manager::clone (void) { diff --git a/TAO/tao/POAS.cpp b/TAO/tao/POAS.cpp index ea7794bdf09..f884bdcb571 100644 --- a/TAO/tao/POAS.cpp +++ b/TAO/tao/POAS.cpp @@ -18,6 +18,8 @@ ACE_RCSID(tao, POAS, "$Id$") +#if !defined (TAO_HAS_MINIMUM_CORBA) + static const TAO_operation_db_entry PortableServer_ThreadPolicy_operations [] = { {"_get_value", &POA_PortableServer::ThreadPolicy::_get_value_skel}, {"copy", &POA_PortableServer::ThreadPolicy::copy_skel}, @@ -224,6 +226,8 @@ POA_PortableServer::ThreadPolicy::_this (CORBA_Environment &TAO_IN_ENV) return new POA_PortableServer::_tao_collocated_ThreadPolicy (this, stub); } +#endif /* TAO_HAS_MINIMUM_CORBA */ + static const TAO_operation_db_entry PortableServer_LifespanPolicy_operations [] = { {"_get_value", &POA_PortableServer::LifespanPolicy::_get_value_skel}, {"copy", &POA_PortableServer::LifespanPolicy::copy_skel}, @@ -839,6 +843,8 @@ POA_PortableServer::IdAssignmentPolicy::_this (CORBA_Environment &TAO_IN_ENV) return new POA_PortableServer::_tao_collocated_IdAssignmentPolicy (this, stub); } +#if !defined (TAO_HAS_MINIMUM_CORBA) + static const TAO_operation_db_entry PortableServer_ImplicitActivationPolicy_operations [] = { {"_get_value", &POA_PortableServer::ImplicitActivationPolicy::_get_value_skel}, {"copy", &POA_PortableServer::ImplicitActivationPolicy::copy_skel}, @@ -1454,216 +1460,7 @@ POA_PortableServer::RequestProcessingPolicy::_this (CORBA_Environment &TAO_IN_EN return new POA_PortableServer::_tao_collocated_RequestProcessingPolicy (this, stub); } -// ************************************************** -// -// TAO spcific POA locking policy (non-standard) -// -// ************************************************** - -static const TAO_operation_db_entry PortableServer_SynchronizationPolicy_operations [] = { - {"_get_value", &POA_PortableServer::SynchronizationPolicy::_get_value_skel}, - {"copy", &POA_PortableServer::SynchronizationPolicy::copy_skel}, - {"destroy", &POA_PortableServer::SynchronizationPolicy::destroy_skel}, - {"_get_policy_type", &POA_PortableServer::SynchronizationPolicy::_get_policy_type_skel}, - {"_is_a", &POA_PortableServer::SynchronizationPolicy::_is_a_skel} -}; - -static const CORBA::Long _tao_PortableServer_SynchronizationPolicy_optable_size = sizeof (ACE_Hash_Map_Entry<const char *, TAO_Skeleton>) * (15); -static char _tao_PortableServer_SynchronizationPolicy_optable_pool [_tao_PortableServer_SynchronizationPolicy_optable_size]; -static ACE_Static_Allocator_Base _tao_PortableServer_SynchronizationPolicy_allocator (_tao_PortableServer_SynchronizationPolicy_optable_pool, _tao_PortableServer_SynchronizationPolicy_optable_size); -static TAO_Dynamic_Hash_OpTable tao_PortableServer_SynchronizationPolicy_optable (PortableServer_SynchronizationPolicy_operations, 5, 10, &_tao_PortableServer_SynchronizationPolicy_allocator); - -// skeleton constructor -POA_PortableServer::SynchronizationPolicy::SynchronizationPolicy (void) -{ - this->optable_ = &tao_PortableServer_SynchronizationPolicy_optable; -} - -void POA_PortableServer::SynchronizationPolicy::_get_value_skel ( - CORBA::ServerRequest &_tao_server_request, - void *_tao_object_reference, - void * /* context */, - CORBA::Environment &_tao_orb_environment - ) -{ - // CORBA::Environment _tao_skel_environment; - static const TAO_Param_Data_Skel _get_PortableServer_SynchronizationPolicy_value_paramdata [] = - { - {PortableServer::_tc_SynchronizationPolicyValue, 0, 0} - }; // PortableServer_SynchronizationPolicy_value_paramdata - - static const TAO_Call_Data_Skel _get_PortableServer_SynchronizationPolicy_value_calldata = - {"_get_value", 1, 1, _get_PortableServer_SynchronizationPolicy_value_paramdata}; - - POA_PortableServer::SynchronizationPolicy *_tao_impl = (POA_PortableServer::SynchronizationPolicy *)_tao_object_reference; - PortableServer::SynchronizationPolicyValue _tao_retval; - _tao_server_request.demarshal ( - _tao_orb_environment, - &_get_PortableServer_SynchronizationPolicy_value_calldata, - &_tao_retval - ); - if (_tao_orb_environment.exception ()) return; - _tao_retval = _tao_impl->value ( - _tao_orb_environment - ); - _tao_server_request.marshal ( - _tao_orb_environment, - // _tao_skel_environment, - &_get_PortableServer_SynchronizationPolicy_value_calldata, - &_tao_retval - ); -} - -void POA_PortableServer::SynchronizationPolicy::_is_a_skel ( - CORBA::ServerRequest &_tao_server_request, - void * _tao_object_reference, - void * /*context*/, - CORBA::Environment &_tao_orb_environment - ) -{ - // CORBA::Environment _tao_skel_environment; - static const TAO_Param_Data_Skel PortableServer_SynchronizationPolicy_is_a_paramdata [] = - { - {CORBA::_tc_boolean, 0, 0}, - {CORBA::_tc_string, CORBA::ARG_IN, 0} - }; - static const TAO_Call_Data_Skel PortableServer_SynchronizationPolicy_is_a_calldata = - {"_is_a", 1, 2, PortableServer_SynchronizationPolicy_is_a_paramdata}; - POA_PortableServer::SynchronizationPolicy_ptr _tao_impl = (POA_PortableServer::SynchronizationPolicy_ptr) _tao_object_reference; - CORBA::Boolean _tao_retval; - char *_tao_value = 0; - _tao_server_request.demarshal ( - _tao_orb_environment, - &PortableServer_SynchronizationPolicy_is_a_calldata, - &_tao_retval, - &_tao_value - ); - if (_tao_orb_environment.exception () != 0) return; - _tao_retval = _tao_impl->_is_a (_tao_value, _tao_orb_environment); - _tao_server_request.marshal ( - _tao_orb_environment, - // _tao_skel_environment, - &PortableServer_SynchronizationPolicy_is_a_calldata, - &_tao_retval, - &_tao_value - ); - CORBA::string_free (_tao_value); -} - -CORBA::Boolean POA_PortableServer::SynchronizationPolicy::_is_a ( - const char* value, - CORBA::Environment &_tao_orb_environment - ) -{ - if ( - (!ACE_OS::strcmp ((char *)value, "IDL:PortableServer/SynchronizationPolicy:1.0")) || - (!ACE_OS::strcmp ((char *)value, "IDL:PortableServer/Policy:1.0")) || - (!ACE_OS::strcmp ((char *)value, CORBA::_tc_Object->id (_tao_orb_environment)))) - return 1; - else - return 0; -} - -void* POA_PortableServer::SynchronizationPolicy::_downcast ( - const char* logical_type_id - ) -{ - if (ACE_OS::strcmp (logical_type_id, "IDL:PortableServer/SynchronizationPolicy:1.0") == 0) - return ACE_static_cast (POA_PortableServer::SynchronizationPolicy_ptr, this); - if (ACE_OS::strcmp (logical_type_id, "IDL:PortableServer/Policy:1.0") == 0) - return ACE_static_cast (POA_CORBA::Policy_ptr, this); - if (ACE_OS::strcmp (logical_type_id, "IDL:omg.org/CORBA/Object:1.0") == 0) - return ACE_static_cast(PortableServer::Servant, this); - return 0; -} - -void POA_PortableServer::SynchronizationPolicy::_dispatch (CORBA::ServerRequest &req, void *context, CORBA::Environment &env) -{ - TAO_Skeleton skel; // pointer to skeleton for operation - const char *opname = req.operation (); // retrieve operation name - // find the skeleton corresponding to this opname - if (this->_find (opname, skel) == -1) - { - env.exception (new CORBA_BAD_OPERATION (CORBA::COMPLETED_NO)); - ACE_ERROR ((LM_ERROR, "Bad operation <%s>\n", opname)); - } - else - skel (req, this, context, env); -} - -const char* POA_PortableServer::SynchronizationPolicy::_interface_repository_id (void) const -{ - return "IDL:PortableServer/SynchronizationPolicy:1.0"; -} - -POA_PortableServer::_tao_collocated_SynchronizationPolicy::_tao_collocated_SynchronizationPolicy ( - POA_PortableServer::SynchronizationPolicy_ptr servant, - STUB_Object *stub - ) - : ACE_NESTED_CLASS (PortableServer, SynchronizationPolicy) (stub, servant, 1), - ACE_NESTED_CLASS (POA_CORBA, _tao_collocated_Policy) (servant, stub), - CORBA_Object (stub, servant, 1), - servant_ (servant) -{ -} - -POA_PortableServer::SynchronizationPolicy_ptr POA_PortableServer::_tao_collocated_SynchronizationPolicy::_get_servant (void) const -{ - return this->servant_; -} - -CORBA::Boolean POA_PortableServer::_tao_collocated_SynchronizationPolicy::_is_a ( - const char* logical_type_id, - CORBA::Environment &_tao_orb_environment - ) -{ - return this->servant_->_is_a ( - logical_type_id, - _tao_orb_environment - ); -} - -CORBA::Policy_ptr POA_PortableServer::_tao_collocated_SynchronizationPolicy::copy ( - CORBA::Environment &_tao_orb_environment - ) -{ - return this->servant_->copy ( - _tao_orb_environment - ); -} - -void POA_PortableServer::_tao_collocated_SynchronizationPolicy::destroy ( - CORBA::Environment &_tao_orb_environment - ) -{ - this->servant_->destroy ( - _tao_orb_environment - ); -} - -CORBA::PolicyType POA_PortableServer::_tao_collocated_SynchronizationPolicy::policy_type ( - CORBA::Environment &_tao_orb_environment - ) -{ - return this->servant_->policy_type (_tao_orb_environment); -} - -PortableServer::SynchronizationPolicyValue -POA_PortableServer::_tao_collocated_SynchronizationPolicy::value ( - CORBA::Environment &_tao_orb_environment - ) -{ - return this->servant_->value(_tao_orb_environment); -} - -PortableServer::SynchronizationPolicy* -POA_PortableServer::SynchronizationPolicy::_this (CORBA_Environment &TAO_IN_ENV) -{ - STUB_Object *stub = this->_create_stub (TAO_IN_ENV); - if (TAO_IN_ENV.exception () != 0) - return 0; - return new POA_PortableServer::_tao_collocated_SynchronizationPolicy (this, stub); -} +#endif /* TAO_HAS_MINIMUM_CORBA */ static const TAO_operation_db_entry PortableServer_POAManager_operations [] = { {"_is_a", &POA_PortableServer::POAManager::_is_a_skel} @@ -1794,6 +1591,8 @@ void POA_PortableServer::_tao_collocated_POAManager::activate ( ); } +#if !defined (TAO_HAS_MINIMUM_CORBA) + void POA_PortableServer::_tao_collocated_POAManager::hold_requests ( CORBA::Boolean wait_for_completion, CORBA::Environment &_tao_orb_environment @@ -1829,6 +1628,7 @@ void POA_PortableServer::_tao_collocated_POAManager::deactivate ( ); } +#endif /* TAO_HAS_MINIMUM_CORBA */ PortableServer::POAManager* POA_PortableServer::POAManager::_this (CORBA_Environment &TAO_IN_ENV) @@ -1839,6 +1639,8 @@ POA_PortableServer::POAManager::_this (CORBA_Environment &TAO_IN_ENV) return new POA_PortableServer::_tao_collocated_POAManager (this, stub); } +#if !defined (TAO_HAS_MINIMUM_CORBA) + static const TAO_operation_db_entry PortableServer_AdapterActivator_operations [] = { {"_is_a", &POA_PortableServer::AdapterActivator::_is_a_skel} }; @@ -2448,6 +2250,8 @@ POA_PortableServer::ServantLocator::_this (CORBA_Environment &TAO_IN_ENV) return new POA_PortableServer::_tao_collocated_ServantLocator (this, stub); } +#endif /* TAO_HAS_MINIMUM_CORBA */ + static const TAO_operation_db_entry PortableServer_POA_operations [] = { {"_is_a", &POA_PortableServer::POA::_is_a_skel} }; @@ -2609,6 +2413,8 @@ void POA_PortableServer::_tao_collocated_POA::destroy ( ); } +#if !defined (TAO_HAS_MINIMUM_CORBA) + PortableServer::ThreadPolicy_ptr POA_PortableServer::_tao_collocated_POA::create_thread_policy ( PortableServer::ThreadPolicyValue value, CORBA::Environment &_tao_orb_environment @@ -2620,6 +2426,8 @@ PortableServer::ThreadPolicy_ptr POA_PortableServer::_tao_collocated_POA::create ); } +#endif /* TAO_HAS_MINIMUM_CORBA */ + PortableServer::LifespanPolicy_ptr POA_PortableServer::_tao_collocated_POA::create_lifespan_policy ( PortableServer::LifespanPolicyValue value, CORBA::Environment &_tao_orb_environment @@ -2653,6 +2461,8 @@ PortableServer::IdAssignmentPolicy_ptr POA_PortableServer::_tao_collocated_POA:: ); } +#if !defined (TAO_HAS_MINIMUM_CORBA) + PortableServer::ImplicitActivationPolicy_ptr POA_PortableServer::_tao_collocated_POA::create_implicit_activation_policy ( PortableServer::ImplicitActivationPolicyValue value, CORBA::Environment &_tao_orb_environment @@ -2686,22 +2496,7 @@ PortableServer::RequestProcessingPolicy_ptr POA_PortableServer::_tao_collocated_ ); } -// ************************************************** -// -// TAO spcific POA locking policy (non-standard) -// -// ************************************************** - -PortableServer::SynchronizationPolicy_ptr POA_PortableServer::_tao_collocated_POA::create_synchronization_policy ( - PortableServer::SynchronizationPolicyValue value, - CORBA::Environment &_tao_orb_environment - ) -{ - return this->servant_->create_synchronization_policy ( - value, - _tao_orb_environment - ); -} +#endif /* TAO_HAS_MINIMUM_CORBA */ char* POA_PortableServer::_tao_collocated_POA::the_name ( @@ -2724,6 +2519,9 @@ POA_PortableServer::_tao_collocated_POA::the_POAManager ( { return this->servant_->the_POAManager(_tao_orb_environment); } + +#if !defined (TAO_HAS_MINIMUM_CORBA) + PortableServer::AdapterActivator_ptr POA_PortableServer::_tao_collocated_POA::the_activator ( CORBA::Environment &_tao_orb_environment @@ -2783,6 +2581,8 @@ void POA_PortableServer::_tao_collocated_POA::set_servant ( ); } +#endif /* TAO_HAS_MINIMUM_CORBA */ + PortableServer::ObjectId * POA_PortableServer::_tao_collocated_POA::activate_object ( PortableServer::Servant p_servant, CORBA::Environment &_tao_orb_environment diff --git a/TAO/tao/POAS.h b/TAO/tao/POAS.h index 1f4e7e41646..3e365737080 100644 --- a/TAO/tao/POAS.h +++ b/TAO/tao/POAS.h @@ -26,6 +26,8 @@ class TAO_Export POA_PortableServer { public: +#if !defined (TAO_HAS_MINIMUM_CORBA) + class ThreadPolicy; typedef ThreadPolicy *ThreadPolicy_ptr; class TAO_Export ThreadPolicy : public virtual POA_CORBA::Policy @@ -98,6 +100,7 @@ public: #endif // end #if !defined +#endif /* TAO_HAS_MINIMUM_CORBA */ class LifespanPolicy; typedef LifespanPolicy *LifespanPolicy_ptr; @@ -324,6 +327,8 @@ public: #endif // end #if !defined +#if !defined (TAO_HAS_MINIMUM_CORBA) + class ImplicitActivationPolicy; typedef ImplicitActivationPolicy *ImplicitActivationPolicy_ptr; class TAO_Export ImplicitActivationPolicy : public virtual POA_CORBA::Policy @@ -548,86 +553,7 @@ public: #endif // end #if !defined - - // ************************************************** - // - // TAO spcific POA locking policy (non-standard) - // - // ************************************************** - - class SynchronizationPolicy; - typedef SynchronizationPolicy *SynchronizationPolicy_ptr; - class TAO_Export SynchronizationPolicy : public virtual POA_CORBA::Policy - { - protected: - SynchronizationPolicy (void); - public: - virtual ~SynchronizationPolicy (void); - virtual CORBA::Boolean _is_a ( - const char* logical_type_id, - CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - virtual void* _downcast ( - const char* logical_type_id - ); - virtual PortableServer::SynchronizationPolicyValue value (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; - static void _get_value_skel (CORBA::ServerRequest &req, void *obj, void *context, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - - static void _is_a_skel (CORBA::ServerRequest &req, void *obj, void *context, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - - static void copy_skel (CORBA::ServerRequest &req, void *obj, void *context, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - - static void destroy_skel (CORBA::ServerRequest &req, void *obj, void *context, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - - virtual void _dispatch (CORBA::ServerRequest &req, void *context, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - - static void _get_policy_type_skel ( - CORBA::ServerRequest &_tao_req, - void *_tao_obj, - void *_tao_context, - CORBA_Environment &TAO_IN_ENV = CORBA::default_environment () - ); - - - PortableServer::SynchronizationPolicy *_this (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - virtual const char* _interface_repository_id (void) const; - }; - - -#if !defined (_PORTABLESERVER_SYNCHRONIZATIONPOLICY___COLLOCATED_SH_) -#define _PORTABLESERVER_SYNCHRONIZATIONPOLICY___COLLOCATED_SH_ - - class TAO_Export _tao_collocated_SynchronizationPolicy : public virtual PortableServer::SynchronizationPolicy, - public virtual POA_CORBA::_tao_collocated_Policy - { - public: - _tao_collocated_SynchronizationPolicy ( - SynchronizationPolicy_ptr servant, - STUB_Object *stub - ); - SynchronizationPolicy_ptr _get_servant (void) const; - virtual CORBA::Boolean _is_a ( - const char *logical_type_id, - CORBA_Environment &TAO_IN_ENV = CORBA::default_environment () - ); - virtual PortableServer::SynchronizationPolicyValue value ( - CORBA_Environment &TAO_IN_ENV = CORBA::default_environment () - ); - virtual CORBA::Policy_ptr copy ( - CORBA_Environment &TAO_IN_ENV = CORBA::default_environment () - ); - virtual void destroy ( - CORBA_Environment &TAO_IN_ENV = CORBA::default_environment () - ); - virtual CORBA::PolicyType policy_type ( - CORBA_Environment &TAO_IN_ENV = CORBA::default_environment () - ); - - private: - SynchronizationPolicy_ptr servant_; - }; - - -#endif // end #if !defined +#endif /* TAO_HAS_MINIMUM_CORBA */ class POAManager; @@ -646,12 +572,16 @@ public: ); virtual void activate ( CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; // pure virtual +#if !defined (TAO_HAS_MINIMUM_CORBA) + virtual void hold_requests (CORBA::Boolean wait_for_completion, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; // pure virtual virtual void discard_requests (CORBA::Boolean wait_for_completion, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; // pure virtual virtual void deactivate (CORBA::Boolean etherealize_objects, CORBA::Boolean wait_for_completion, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; // pure virtual +#endif /* TAO_HAS_MINIMUM_CORBA */ + static void _is_a_skel (CORBA::ServerRequest &req, void *obj, void *context, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); virtual void _dispatch (CORBA::ServerRequest &req, void *context, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); @@ -679,6 +609,9 @@ public: virtual void activate ( CORBA_Environment &TAO_IN_ENV = CORBA::default_environment () ); + +#if !defined (TAO_HAS_MINIMUM_CORBA) + virtual void hold_requests ( CORBA::Boolean wait_for_completion, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment () @@ -693,6 +626,8 @@ public: CORBA_Environment &TAO_IN_ENV = CORBA::default_environment () ); +#endif /* TAO_HAS_MINIMUM_CORBA */ + private: POAManager_ptr servant_; }; @@ -701,6 +636,8 @@ public: #endif // end #if !defined +#if !defined (TAO_HAS_MINIMUM_CORBA) + class AdapterActivator; typedef AdapterActivator *AdapterActivator_ptr; class TAO_Export AdapterActivator : public virtual TAO_Local_ServantBase @@ -937,6 +874,7 @@ public: #endif // end #if !defined +#endif /* TAO_HAS_MINIMUM_CORBA */ class POA; typedef POA *POA_ptr; @@ -958,27 +896,27 @@ public: virtual void destroy (CORBA::Boolean etherealize_objects, CORBA::Boolean wait_for_completion, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; // pure virtual +#if !defined (TAO_HAS_MINIMUM_CORBA) + virtual PortableServer::ThreadPolicy_ptr create_thread_policy (PortableServer::ThreadPolicyValue value, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; // pure virtual +#endif /* TAO_HAS_MINIMUM_CORBA */ + virtual PortableServer::LifespanPolicy_ptr create_lifespan_policy (PortableServer::LifespanPolicyValue value, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; // pure virtual virtual PortableServer::IdUniquenessPolicy_ptr create_id_uniqueness_policy (PortableServer::IdUniquenessPolicyValue value, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; // pure virtual virtual PortableServer::IdAssignmentPolicy_ptr create_id_assignment_policy (PortableServer::IdAssignmentPolicyValue value, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; // pure virtual +#if !defined (TAO_HAS_MINIMUM_CORBA) + virtual PortableServer::ImplicitActivationPolicy_ptr create_implicit_activation_policy (PortableServer::ImplicitActivationPolicyValue value, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; // pure virtual virtual PortableServer::ServantRetentionPolicy_ptr create_servant_retention_policy (PortableServer::ServantRetentionPolicyValue value, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; // pure virtual virtual PortableServer::RequestProcessingPolicy_ptr create_request_processing_policy (PortableServer::RequestProcessingPolicyValue value, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; // pure virtual - // ************************************************** - // - // TAO spcific POA locking policy (non-standard) - // - // ************************************************** - - virtual PortableServer::SynchronizationPolicy_ptr create_synchronization_policy (PortableServer::SynchronizationPolicyValue value, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; // pure virtual +#endif /* TAO_HAS_MINIMUM_CORBA */ virtual char * the_name (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; @@ -986,6 +924,8 @@ public: virtual PortableServer::POAManager_ptr the_POAManager (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; +#if !defined (TAO_HAS_MINIMUM_CORBA) + virtual PortableServer::AdapterActivator_ptr the_activator (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; virtual void the_activator(PortableServer::AdapterActivator_ptr the_activator, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; @@ -998,6 +938,8 @@ public: virtual void set_servant (PortableServer::Servant p_servant, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; // pure virtual +#endif /* TAO_HAS_MINIMUM_CORBA */ + virtual PortableServer::ObjectId * activate_object (PortableServer::Servant p_servant, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; // pure virtual virtual void activate_object_with_id (const PortableServer::ObjectId &id, PortableServer::Servant p_servant, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; // pure virtual @@ -1060,10 +1002,16 @@ public: CORBA::Boolean wait_for_completion, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment () ); + +#if !defined (TAO_HAS_MINIMUM_CORBA) + virtual PortableServer::ThreadPolicy_ptr create_thread_policy ( PortableServer::ThreadPolicyValue value, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment () ); + +#endif /* TAO_HAS_MINIMUM_CORBA */ + virtual PortableServer::LifespanPolicy_ptr create_lifespan_policy ( PortableServer::LifespanPolicyValue value, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment () @@ -1076,6 +1024,8 @@ public: PortableServer::IdAssignmentPolicyValue value, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment () ); +#if !defined (TAO_HAS_MINIMUM_CORBA) + virtual PortableServer::ImplicitActivationPolicy_ptr create_implicit_activation_policy ( PortableServer::ImplicitActivationPolicyValue value, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment () @@ -1088,17 +1038,8 @@ public: PortableServer::RequestProcessingPolicyValue value, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment () ); +#endif /* TAO_HAS_MINIMUM_CORBA */ - // ************************************************** - // - // TAO spcific POA locking policy (non-standard) - // - // ************************************************** - - virtual PortableServer::SynchronizationPolicy_ptr create_synchronization_policy ( - PortableServer::SynchronizationPolicyValue value, - CORBA_Environment &TAO_IN_ENV = CORBA::default_environment () - ); virtual char* the_name ( CORBA_Environment &TAO_IN_ENV = CORBA::default_environment () @@ -1109,6 +1050,8 @@ public: virtual PortableServer::POAManager_ptr the_POAManager ( CORBA_Environment &TAO_IN_ENV = CORBA::default_environment () ); +#if !defined (TAO_HAS_MINIMUM_CORBA) + virtual PortableServer::AdapterActivator_ptr the_activator ( CORBA_Environment &TAO_IN_ENV = CORBA::default_environment () ); @@ -1129,6 +1072,9 @@ public: PortableServer::Servant p_servant, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment () ); + +#endif /* TAO_HAS_MINIMUM_CORBA */ + virtual PortableServer::ObjectId * activate_object ( PortableServer::Servant p_servant, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment () diff --git a/TAO/tao/POAS.i b/TAO/tao/POAS.i index c94824088b9..11737821b4b 100644 --- a/TAO/tao/POAS.i +++ b/TAO/tao/POAS.i @@ -7,6 +7,8 @@ // Information on TAO is available at // http://www.cs.wustl.edu/~schmidt/TAO.html +#if !defined (TAO_HAS_MINIMUM_CORBA) + // skeleton destructor ACE_INLINE POA_PortableServer::ThreadPolicy::~ThreadPolicy (void) @@ -27,6 +29,9 @@ ACE_INLINE void POA_PortableServer::ThreadPolicy::_get_policy_type_skel (CORBA:: POA_CORBA::Policy_ptr impl = (POA_PortableServer::ThreadPolicy_ptr) obj; POA_CORBA::Policy::_get_policy_type_skel (req, (POA_CORBA::Policy_ptr) impl, context, env); } + +#endif /* TAO_HAS_MINIMUM_CORBA */ + // skeleton destructor ACE_INLINE POA_PortableServer::LifespanPolicy::~LifespanPolicy (void) @@ -87,6 +92,9 @@ ACE_INLINE void POA_PortableServer::IdAssignmentPolicy::_get_policy_type_skel (C POA_CORBA::Policy_ptr impl = (POA_PortableServer::IdAssignmentPolicy_ptr) obj; POA_CORBA::Policy::_get_policy_type_skel (req, (POA_CORBA::Policy_ptr) impl, context, env); } + +#if !defined (TAO_HAS_MINIMUM_CORBA) + // skeleton destructor ACE_INLINE POA_PortableServer::ImplicitActivationPolicy::~ImplicitActivationPolicy (void) @@ -148,38 +156,16 @@ ACE_INLINE void POA_PortableServer::RequestProcessingPolicy::_get_policy_type_sk POA_CORBA::Policy::_get_policy_type_skel (req, (POA_CORBA::Policy_ptr) impl, context, env); } -// ************************************************** -// -// TAO spcific POA locking policy (non-standard) -// -// ************************************************** - -// skeleton destructor -ACE_INLINE -POA_PortableServer::SynchronizationPolicy::~SynchronizationPolicy (void) -{ -} -ACE_INLINE void POA_PortableServer::SynchronizationPolicy::copy_skel (CORBA::ServerRequest &req, void *obj, void *context, CORBA::Environment &env) -{ - POA_CORBA::Policy_ptr impl = (POA_PortableServer::SynchronizationPolicy_ptr) obj; - POA_CORBA::Policy::copy_skel (req, (POA_CORBA::Policy_ptr) impl, context, env); -} -ACE_INLINE void POA_PortableServer::SynchronizationPolicy::destroy_skel (CORBA::ServerRequest &req, void *obj, void *context, CORBA::Environment &env) -{ - POA_CORBA::Policy_ptr impl = (POA_PortableServer::SynchronizationPolicy_ptr) obj; - POA_CORBA::Policy::destroy_skel (req, (POA_CORBA::Policy_ptr) impl, context, env); -} -ACE_INLINE void POA_PortableServer::SynchronizationPolicy::_get_policy_type_skel (CORBA::ServerRequest &req, void *obj, void *context, CORBA::Environment &env) -{ - POA_CORBA::Policy_ptr impl = (POA_PortableServer::SynchronizationPolicy_ptr) obj; - POA_CORBA::Policy::_get_policy_type_skel (req, (POA_CORBA::Policy_ptr) impl, context, env); -} +#endif /* TAO_HAS_MINIMUM_CORBA */ // skeleton destructor ACE_INLINE POA_PortableServer::POAManager::~POAManager (void) { } + +#if !defined (TAO_HAS_MINIMUM_CORBA) + // skeleton destructor ACE_INLINE POA_PortableServer::AdapterActivator::~AdapterActivator (void) @@ -200,6 +186,9 @@ ACE_INLINE POA_PortableServer::ServantLocator::~ServantLocator (void) { } + +#endif /* TAO_HAS_MINIMUM_CORBA */ + // skeleton destructor ACE_INLINE POA_PortableServer::POA::~POA (void) diff --git a/TAO/tao/POA_CORBA.h b/TAO/tao/POA_CORBA.h index df50b4317b2..0801dc79a5d 100644 --- a/TAO/tao/POA_CORBA.h +++ b/TAO/tao/POA_CORBA.h @@ -175,6 +175,8 @@ public: #endif /* end #if !defined */ +#if !defined (TAO_HAS_MINIMUM_CORBA) + class DynAny; typedef DynAny *DynAny_ptr; class TAO_Export DynAny : public virtual TAO_Local_ServantBase @@ -1160,6 +1162,7 @@ private: #endif /* end #if !defined */ +#endif /* TAO_HAS_MINIMUM_CORBA */ #if defined(_MSC_VER) #pragma warning(default:4250) diff --git a/TAO/tao/PolicyS.cpp b/TAO/tao/PolicyS.cpp index cad124b75a8..fc38fecb15a 100644 --- a/TAO/tao/PolicyS.cpp +++ b/TAO/tao/PolicyS.cpp @@ -13,6 +13,8 @@ #include "tao/Operation_Table.h" #include "tao/Server_Request.h" #include "tao/POA_CORBA.h" +#include "tao/Environment.h" +#include "tao/Typecode.h" ACE_RCSID(tao, PolicyS, "$Id$") diff --git a/TAO/tao/Request.cpp b/TAO/tao/Request.cpp index de869fbe159..e45aff5f8ac 100644 --- a/TAO/tao/Request.cpp +++ b/TAO/tao/Request.cpp @@ -1,6 +1,9 @@ // $Id$ #include "tao/Request.h" + +#if !defined (TAO_HAS_MINIMUM_CORBA) + #include "tao/Object.h" #include "tao/Stub.h" @@ -106,3 +109,5 @@ CORBA_Request::send_oneway (CORBA::Environment &ACE_TRY_ENV) exceptions_, ACE_TRY_ENV); } + +#endif /* TAO_HAS_MINIMUM_CORBA */ diff --git a/TAO/tao/Request.h b/TAO/tao/Request.h index 997d66aa6cf..7e0e55fc0f0 100644 --- a/TAO/tao/Request.h +++ b/TAO/tao/Request.h @@ -19,7 +19,11 @@ // ============================================================================ #ifndef TAO_REQUEST_H -#define TAO_REQUEST_ H +#define TAO_REQUEST_H + +#include "tao/orbconf.h" + +#if !defined (TAO_HAS_MINIMUM_CORBA) #include "tao/corbafwd.h" #include "tao/NVList.h" @@ -203,4 +207,6 @@ private: # include "tao/Request.i" #endif /* __ACE_INLINE__ */ +#endif /* TAO_HAS_MINIMUM_CORBA */ + #endif /* TAO_REQUEST_H */ diff --git a/TAO/tao/Sequence_T.cpp b/TAO/tao/Sequence_T.cpp index a8686a9e3d5..fe30d6dc81d 100644 --- a/TAO/tao/Sequence_T.cpp +++ b/TAO/tao/Sequence_T.cpp @@ -64,7 +64,7 @@ TAO_Unbounded_Sequence<T>::~TAO_Unbounded_Sequence (void) this->_deallocate_buffer (); } -template<class T> void +template<class T> void TAO_Unbounded_Sequence<T>::_allocate_buffer (CORBA::ULong length) { T* tmp = TAO_Unbounded_Sequence<T>::allocbuf (length); @@ -169,7 +169,7 @@ TAO_Bounded_Sequence<T, MAX>::~TAO_Bounded_Sequence (void) this->_deallocate_buffer (); } -template<class T, CORBA::ULong MAX> void +template<class T, CORBA::ULong MAX> void TAO_Bounded_Sequence<T, MAX>::_allocate_buffer (CORBA::ULong) { // For this class memory is never reallocated so the implementation @@ -177,7 +177,7 @@ TAO_Bounded_Sequence<T, MAX>::_allocate_buffer (CORBA::ULong) this->buffer_ = TAO_Bounded_Sequence<T, MAX>::allocbuf (MAX); } -template<class T, CORBA::ULong MAX> void +template<class T, CORBA::ULong MAX> void TAO_Bounded_Sequence<T, MAX>::_deallocate_buffer (void) { if (this->buffer_ == 0 || this->release_ == 0) @@ -335,7 +335,7 @@ TAO_Unbounded_Object_Sequence<T>::freebuf (T **buffer) delete[] buffer; } -template<class T> void +template<class T> void TAO_Unbounded_Object_Sequence<T>::_allocate_buffer (CORBA::ULong length) { T **tmp = TAO_Unbounded_Object_Sequence<T>::allocbuf (length); @@ -360,7 +360,7 @@ TAO_Unbounded_Object_Sequence<T>::_allocate_buffer (CORBA::ULong length) this->buffer_ = tmp; } -template<class T> void +template<class T> void TAO_Unbounded_Object_Sequence<T>::_deallocate_buffer (void) { if (this->buffer_ == 0 || this->release_ == 0) @@ -501,7 +501,7 @@ TAO_Bounded_Object_Sequence<T, MAX>::_allocate_buffer (CORBA::ULong length) TAO_Bounded_Object_Sequence<T, MAX>::allocbuf (length); } -template<class T, CORBA::ULong MAX> void +template<class T, CORBA::ULong MAX> void TAO_Bounded_Object_Sequence<T, MAX>::_deallocate_buffer (void) { if (this->buffer_ == 0 || this->release_ == 0) @@ -649,7 +649,7 @@ TAO_Unbounded_Pseudo_Sequence<T>::freebuf (T **buffer) delete[] buffer; } -template<class T> void +template<class T> void TAO_Unbounded_Pseudo_Sequence<T>::_allocate_buffer (CORBA::ULong length) { T **tmp = TAO_Unbounded_Pseudo_Sequence<T>::allocbuf (length); @@ -674,7 +674,7 @@ TAO_Unbounded_Pseudo_Sequence<T>::_allocate_buffer (CORBA::ULong length) this->buffer_ = tmp; } -template<class T> void +template<class T> void TAO_Unbounded_Pseudo_Sequence<T>::_deallocate_buffer (void) { if (this->buffer_ == 0 || this->release_ == 0) @@ -797,7 +797,7 @@ TAO_Bounded_Pseudo_Sequence<T, MAX>::_allocate_buffer (CORBA::ULong length) TAO_Bounded_Pseudo_Sequence<T, MAX>::allocbuf (length); } -template<class T, CORBA::ULong MAX> void +template<class T, CORBA::ULong MAX> void TAO_Bounded_Pseudo_Sequence<T, MAX>::_deallocate_buffer (void) { if (this->buffer_ == 0 || this->release_ == 0) @@ -932,7 +932,7 @@ TAO_Bounded_String_Sequence<MAX>::_allocate_buffer (CORBA::ULong length) TAO_Bounded_String_Sequence<MAX>::allocbuf (MAX); } -template<CORBA::ULong MAX> void +template<CORBA::ULong MAX> void TAO_Bounded_String_Sequence<MAX>::_deallocate_buffer (void) { if (this->buffer_ == 0 || this->release_ == 0) diff --git a/TAO/tao/Sequence_T.h b/TAO/tao/Sequence_T.h index d2e9e758de7..e2200ad344a 100644 --- a/TAO/tao/Sequence_T.h +++ b/TAO/tao/Sequence_T.h @@ -281,13 +281,16 @@ public: TAO_Object_Manager<T> &operator= (T *); // Assignment from T *. + T * operator-> (void) const; + // Return pointer. + operator const T *() const; // Cast (read-only). operator T *&(); // Cast. - const T *in (void) const; + T *in (void) const; // for in parameter. T *&inout (void); diff --git a/TAO/tao/Sequence_T.i b/TAO/tao/Sequence_T.i index 128c705df70..0a43b5b986b 100644 --- a/TAO/tao/Sequence_T.i +++ b/TAO/tao/Sequence_T.i @@ -229,6 +229,12 @@ TAO_Object_Manager<T>::TAO_Object_Manager(T** buffer, CORBA::Boolean release) { } +template <class T> ACE_INLINE T * +TAO_Object_Manager<T>::operator-> (void) const +{ + return *this->ptr_; +} + template <class T> ACE_INLINE TAO_Object_Manager<T>::operator const T* () const // cast { @@ -241,7 +247,7 @@ TAO_Object_Manager<T>::operator T* &() // cast return *this->ptr_; } -template <class T> ACE_INLINE const T * +template <class T> ACE_INLINE T * TAO_Object_Manager<T>::in (void) const { return *this->ptr_; diff --git a/TAO/tao/Servant_Base.cpp b/TAO/tao/Servant_Base.cpp index efbd9759231..659171c5f52 100644 --- a/TAO/tao/Servant_Base.cpp +++ b/TAO/tao/Servant_Base.cpp @@ -98,7 +98,7 @@ TAO_ServantBase::_create_stub (CORBA_Environment &env) && this == poa_current->servant ()) { stub = orb_core->orb ()->create_stub_object (poa_current->object_key (), - this->_interface_repository_id (), + this->_interface_repository_id (), env); } else @@ -125,7 +125,7 @@ TAO_ServantBase::_create_stub (CORBA_Environment &env) STUB_Object * TAO_Local_ServantBase::_create_stub (CORBA_Environment &env) { - PortableServer::ObjectId_var invalid_oid = + PortableServer::ObjectId_var invalid_oid = PortableServer::string_to_ObjectId ("invalid"); TAO_ObjectKey tmp_key (invalid_oid->length (), @@ -138,6 +138,8 @@ TAO_Local_ServantBase::_create_stub (CORBA_Environment &env) env); } +#if !defined (TAO_HAS_MINIMUM_CORBA) + CORBA::Object_ptr TAO_DynamicImplementation::_this (CORBA::Environment &env) { @@ -219,3 +221,5 @@ TAO_DynamicImplementation::_dispatch (CORBA::ServerRequest &request, request.dsi_marshal (env); } } + +#endif /* TAO_HAS_MINIMUM_CORBA */ diff --git a/TAO/tao/Servant_Base.h b/TAO/tao/Servant_Base.h index b5676694496..fcf4f406aa4 100644 --- a/TAO/tao/Servant_Base.h +++ b/TAO/tao/Servant_Base.h @@ -102,6 +102,8 @@ protected: // register with the default POA }; +#if !defined (TAO_HAS_MINIMUM_CORBA) + class TAO_Export TAO_DynamicImplementation : public virtual TAO_ServantBase { // = TITLE @@ -146,6 +148,8 @@ protected: // Turns around and calls invoke. }; +#endif /* TAO_HAS_MINIMUM_CORBA */ + #if defined (__ACE_INLINE__) # include "tao/Servant_Base.i" #endif /* __ACE_INLINE__ */ diff --git a/TAO/tao/Server_Request.cpp b/TAO/tao/Server_Request.cpp index 8be2ab94a53..139427bc84f 100644 --- a/TAO/tao/Server_Request.cpp +++ b/TAO/tao/Server_Request.cpp @@ -11,6 +11,7 @@ #include "tao/Principal.h" #include "tao/ORB_Core.h" #include "tao/Timeprobe.h" +#include "tao/Any.h" #if !defined (__ACE_INLINE__) # include "tao/Server_Request.i" @@ -47,7 +48,13 @@ IIOP_ServerRequest::IIOP_ServerRequest (TAO_InputCDR &input, incoming_ (&input), outgoing_ (&output), response_expected_ (0), + +#if !defined (TAO_HAS_MINIMUM_CORBA) + params_ (0), + +#endif /* TAO_HAS_MINIMUM_CORBA */ + retval_ (0), exception_ (0), exception_type_ (TAO_GIOP_NO_EXCEPTION), @@ -179,7 +186,13 @@ IIOP_ServerRequest::IIOP_ServerRequest (CORBA::ULong &request_id, incoming_ (0), outgoing_ (&output), response_expected_ (response_expected), + +#if !defined (TAO_HAS_MINIMUM_CORBA) + params_ (0), + +#endif /* TAO_HAS_MINIMUM_CORBA */ + retval_ (0), exception_ (0), exception_type_ (TAO_GIOP_NO_EXCEPTION), @@ -193,8 +206,14 @@ IIOP_ServerRequest::IIOP_ServerRequest (CORBA::ULong &request_id, IIOP_ServerRequest::~IIOP_ServerRequest (void) { + +#if !defined (TAO_HAS_MINIMUM_CORBA) + if (this->params_) CORBA::release (this->params_); + +#endif /* TAO_HAS_MINIMUM_CORBA */ + delete this->retval_; delete this->exception_; } @@ -211,6 +230,8 @@ IIOP_ServerRequest::oa (void) return this->orb_core_->root_poa (); } +#if !defined (TAO_HAS_MINIMUM_CORBA) + // Unmarshal in/inout params, and set up to marshal the appropriate // inout/out/return values later on. @@ -345,6 +366,71 @@ IIOP_ServerRequest::set_exception (const CORBA::Any &value, } } +// this method will be utilized by the DSI servant to marshal outgoing +// parameters + +void +IIOP_ServerRequest::dsi_marshal (CORBA::Environment &env) +{ + // NOTE: if "env" is set, it takes precedence over exceptions + // reported using the mechanism of the ServerRequest. Only system + // exceptions are reported that way ... + // + // XXX Exception reporting is ambiguous; it can be cleaner than + // this. With both language-mapped and dynamic/explicit reporting + // mechanisms, one of must be tested "first" ... so an exception + // reported using the other mechanism could be "lost". Perhaps only + // the language mapped one should be used for system exceptions. + + + // only if there wasn't any exception, we proceed + if (this->exception_type_ == TAO_GIOP_NO_EXCEPTION && + CORBA::is_nil (this->forward_location_.in ())) + { + // ... then send any return value ... + if (this->retval_) + { + CORBA::TypeCode_var tc = this->retval_->type (); + if (this->retval_->any_owns_data ()) + { + (void) this->outgoing_->encode (tc.in (), retval_->value (), 0, env); + } + else + { + TAO_InputCDR cdr (retval_->_tao_get_cdr ()); + (void) this->outgoing_->append (tc.in (), &cdr, env); + } + } + + // ... Followed by "inout" and "out" parameters, left to right + if (this->params_) + { + for (u_int i = 0; + i < this->params_->count (); + i++) + { + CORBA::NamedValue_ptr nv = this->params_->item (i, env); + if (!(nv->flags () & (CORBA::ARG_INOUT|CORBA::ARG_OUT))) + continue; + + CORBA::Any_ptr any = nv->value (); + CORBA::TypeCode_var tc = any->type (); + if (any->any_owns_data ()) + { + (void) this->outgoing_->encode (tc.in (), any->value (), 0, env); + } + else + { + TAO_InputCDR cdr (any->_tao_get_cdr ()); + (void) this->outgoing_->append (tc.in (), &cdr, env); + } + } + } + } +} + +#endif /* TAO_HAS_MINIMUM_CORBA */ + // Extension void IIOP_ServerRequest::demarshal (CORBA::Environment &orb_env, @@ -516,70 +602,6 @@ IIOP_ServerRequest::init_reply (CORBA::Environment &env) this->outgoing_->write_ulong (TAO_GIOP_NO_EXCEPTION); } -// this method will be utilized by the DSI servant to marshal outgoing -// parameters - -void -IIOP_ServerRequest::dsi_marshal (CORBA::Environment &env) -{ - // NOTE: if "env" is set, it takes precedence over exceptions - // reported using the mechanism of the ServerRequest. Only system - // exceptions are reported that way ... - // - // XXX Exception reporting is ambiguous; it can be cleaner than - // this. With both language-mapped and dynamic/explicit reporting - // mechanisms, one of must be tested "first" ... so an exception - // reported using the other mechanism could be "lost". Perhaps only - // the language mapped one should be used for system exceptions. - - - // only if there wasn't any exception, we proceed - if (this->exception_type_ == TAO_GIOP_NO_EXCEPTION && - CORBA::is_nil (this->forward_location_.in ())) - { - // ... then send any return value ... - if (this->retval_) - { - CORBA::TypeCode_var tc = this->retval_->type (); - if (this->retval_->any_owns_data ()) - { - (void) this->outgoing_->encode (tc.in (), retval_->value (), 0, env); - } - else - { - TAO_InputCDR cdr (retval_->_tao_get_cdr ()); - (void) this->outgoing_->append (tc.in (), &cdr, env); - } - } - - // ... Followed by "inout" and "out" parameters, left to right - if (this->params_) - { - for (u_int i = 0; - i < this->params_->count (); - i++) - { - CORBA::NamedValue_ptr nv = this->params_->item (i, env); - if (!(nv->flags () & (CORBA::ARG_INOUT|CORBA::ARG_OUT))) - continue; - - CORBA::Any_ptr any = nv->value (); - CORBA::TypeCode_var tc = any->type (); - if (any->any_owns_data ()) - { - (void) this->outgoing_->encode (tc.in (), any->value (), 0, env); - } - else - { - TAO_InputCDR cdr (any->_tao_get_cdr ()); - (void) this->outgoing_->append (tc.in (), &cdr, env); - } - } - } - } -} - - CORBA::Object_ptr IIOP_ServerRequest::forward_location (void) // get the forward_location diff --git a/TAO/tao/Server_Request.h b/TAO/tao/Server_Request.h index 9aeb8639923..3ce54d31c45 100644 --- a/TAO/tao/Server_Request.h +++ b/TAO/tao/Server_Request.h @@ -110,6 +110,8 @@ public: static CORBA_ServerRequest *_nil (void); // the standard _nil method on pseudo objects +#if !defined (TAO_HAS_MINIMUM_CORBA) + virtual void arguments (CORBA::NVList_ptr &list, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; // Implementation uses this to provide the ORB with the operation's @@ -141,9 +143,17 @@ public: // this stuff is a catastrophic error since this is all part of the // basic CORBA Object Model. + virtual void dsi_marshal (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; + // marshal outgoing parameters. Used by DSI + +#endif /* TAO_HAS_MINIMUM_CORBA */ + virtual const char *operation (void) const = 0; // get the operation name + virtual void init_reply (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; + // Start a Reply message. + // CORBA::Context_ptr ctx (void) = 0; // return the context pointer @@ -166,12 +176,6 @@ public: ...) = 0; // marshal outgoing parameters - virtual void dsi_marshal (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; - // marshal outgoing parameters. Used by DSI - - virtual void init_reply (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0; - // Start a Reply message. - virtual TAO_InputCDR &incoming (void) = 0; // Retrieve the incoming stream. @@ -204,6 +208,8 @@ public: virtual ~IIOP_ServerRequest (void); // Destructor. +#if !defined (TAO_HAS_MINIMUM_CORBA) + // = General ServerRequest operations void arguments (CORBA::NVList_ptr &list, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); @@ -214,6 +220,12 @@ public: void set_exception (const CORBA::Any &value, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); + virtual void dsi_marshal (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); + // does the marshaling of outgoing parameters and is used by the DSI based + // scheme + +#endif /* TAO_HAS_MINIMUM_CORBA */ + // = Request attributes. const char *operation (void) const; @@ -248,10 +260,6 @@ public: // marshal outgoing parameters and return value. This is used by the SSI // i.e., by the IDL compiler generated skeletons. - virtual void dsi_marshal (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - // does the marshaling of outgoing parameters and is used by the DSI based - // scheme - virtual void init_reply (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); // start a Reply message @@ -313,9 +321,13 @@ private: CORBA::Boolean response_expected_; // is it oneway or twoway +#if !defined (TAO_HAS_MINIMUM_CORBA) + CORBA::NVList_ptr params_; // Incoming parameters. +#endif /* TAO_HAS_MINIMUM_CORBA */ + CORBA::Any_ptr retval_; // Return value. diff --git a/TAO/tao/Server_Strategy_Factory.cpp b/TAO/tao/Server_Strategy_Factory.cpp index 22257f16b5c..ffc68595ae3 100644 --- a/TAO/tao/Server_Strategy_Factory.cpp +++ b/TAO/tao/Server_Strategy_Factory.cpp @@ -5,6 +5,7 @@ ACE_RCSID(tao, Server_Strategy_Factory, "$Id$") TAO_Server_Strategy_Factory::TAO_Server_Strategy_Factory (void) + : active_object_map_creation_parameters_ () { } @@ -42,20 +43,6 @@ TAO_Server_Strategy_Factory::scheduling_strategy (void) return 0; } -TAO_Active_Object_Map_Impl * -TAO_Server_Strategy_Factory::create_active_object_map (int user_id_policy) -{ - ACE_UNUSED_ARG (user_id_policy); - return 0; -} - -TAO_Reverse_Active_Object_Map_Impl * -TAO_Server_Strategy_Factory::create_reverse_active_object_map (int unique_id_policy) -{ - ACE_UNUSED_ARG (unique_id_policy); - return 0; -} - ACE_Lock * TAO_Server_Strategy_Factory::create_poa_lock (void) { @@ -92,12 +79,22 @@ TAO_Server_Strategy_Factory::create_cached_connector_lock (void) return 0; } -u_long -TAO_Server_Strategy_Factory::active_object_map_size (void) const +const TAO_Server_Strategy_Factory::Active_Object_Map_Creation_Parameters & +TAO_Server_Strategy_Factory::active_object_map_creation_parameters (void) const { - return TAO_DEFAULT_SERVER_ACTIVE_OBJECT_MAP_SIZE; + return this->active_object_map_creation_parameters_; } +TAO_Server_Strategy_Factory::Active_Object_Map_Creation_Parameters::Active_Object_Map_Creation_Parameters (void) + : active_object_map_size_ (TAO_DEFAULT_SERVER_ACTIVE_OBJECT_MAP_SIZE), + object_lookup_strategy_for_user_id_policy_ (TAO_DYNAMIC_HASH), + object_lookup_strategy_for_system_id_policy_ (TAO_ACTIVE_DEMUX), + reverse_object_lookup_strategy_for_unique_id_policy_ (TAO_DYNAMIC_HASH), + use_active_hint_in_ids_ (1), + allow_reactivation_of_system_ids_ (1) +{ +}; + #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) template class ACE_Creation_Strategy<TAO_Server_Connection_Handler>; template class ACE_Acceptor<TAO_Server_Connection_Handler, TAO_SOCK_ACCEPTOR>; diff --git a/TAO/tao/Server_Strategy_Factory.h b/TAO/tao/Server_Strategy_Factory.h index ce9cacb56aa..e4bcdd61371 100644 --- a/TAO/tao/Server_Strategy_Factory.h +++ b/TAO/tao/Server_Strategy_Factory.h @@ -20,6 +20,7 @@ #include "ace/Service_Object.h" #include "ace/Strategies_T.h" #include "tao/Connect.h" +#include "tao/params.h" class TAO_Active_Object_Map_Impl; class TAO_Reverse_Active_Object_Map_Impl; @@ -32,6 +33,37 @@ class TAO_Server_Strategy_Factory : public ACE_Service_Object // serves as an interface to a subclass that REALLY gets // specified and loaded by the Service Configurator. public: + + struct Active_Object_Map_Creation_Parameters + { + Active_Object_Map_Creation_Parameters (void); + // Constructor. + + u_long active_object_map_size_; + // Default size of object lookup table. + + TAO_Demux_Strategy object_lookup_strategy_for_user_id_policy_; + // The type of lookup/demultiplexing strategy being used for user + // id policy + + TAO_Demux_Strategy object_lookup_strategy_for_system_id_policy_; + // The type of lookup/demultiplexing strategy being used for + // system id policy + + TAO_Demux_Strategy reverse_object_lookup_strategy_for_unique_id_policy_; + // The type of reverse lookup/demultiplexing strategy being used + // for the UNIQUE_ID policy + + int use_active_hint_in_ids_; + // Flag to indicate whether the active hint should be used with + // the IOR. + + int allow_reactivation_of_system_ids_; + // Flag to indicate whether reactivations of servants was required + // (under the system id policy). If not, certain resources may + // not be required. + }; + // = Initialization and termination methods. TAO_Server_Strategy_Factory (void); // Constructor. @@ -69,16 +101,6 @@ public: virtual SCHEDULING_STRATEGY *scheduling_strategy (void); // Return the scheduling strategy used. - virtual TAO_Active_Object_Map_Impl *create_active_object_map (int user_id_policy); - // Return a new id-->sevant table. If <user_id_policy> is true, the - // request is being made for a POA with USER_ID policy. Otherwise, - // the SYSTEM_ID policy is being used. - - virtual TAO_Reverse_Active_Object_Map_Impl *create_reverse_active_object_map (int unique_id_policy); - // Return a new servant-->id table. If <unique_id_policy> is true, - // the request is being made for a POA with UNIQUE_ID - // policy. Otherwise, the MULTIPLE_ID policy is being used. - virtual ACE_Lock *create_poa_lock (void); // Return a new lock for use in locking the POA. @@ -97,8 +119,13 @@ public: virtual ACE_Lock *create_cached_connector_lock (void); // Create the lock to be used by the cached connector. - virtual u_long active_object_map_size (void) const; - // Return the object table size + virtual const Active_Object_Map_Creation_Parameters &active_object_map_creation_parameters (void) const; + // Return the active object map creation parameters. + +protected: + + Active_Object_Map_Creation_Parameters active_object_map_creation_parameters_; + // Active object map creation parameters. }; #endif /* TAO_SERVER_STRATEGY_FACTORY_H */ diff --git a/TAO/tao/Stub.cpp b/TAO/tao/Stub.cpp index 633b2946fc3..5d1865c9a77 100644 --- a/TAO/tao/Stub.cpp +++ b/TAO/tao/Stub.cpp @@ -623,6 +623,8 @@ STUB_Object::put_params (CORBA::Environment &env, } } +#if !defined (TAO_HAS_MINIMUM_CORBA) + // DII analogue of the above. void @@ -864,3 +866,5 @@ STUB_Object::put_params (TAO_GIOP_Invocation &call, } } } + +#endif /* TAO_HAS_MINIMUM_CORBA */ diff --git a/TAO/tao/Stub.h b/TAO/tao/Stub.h index 8fb8c491384..cec067cc9cd 100644 --- a/TAO/tao/Stub.h +++ b/TAO/tao/Stub.h @@ -228,6 +228,8 @@ public: // shuffling. The stub and "do_static_call" parameters are all but the // same, except that their order is different. +#if !defined (TAO_HAS_MINIMUM_CORBA) + void do_dynamic_call (const char *opname, CORBA::Boolean is_roundtrip, CORBA::NVList_ptr args, @@ -253,6 +255,8 @@ public: // - exceptions ... list of legal user-defined exceptions // - TAO_IN_ENV ... used for exception reporting. +#endif /* TAO_HAS_MINIMUM_CORBA */ + CORBA::String_var type_id; // All objref representations carry around a type ID. @@ -381,12 +385,16 @@ protected: // Helper method to factor out common code in static oneway // vs. twoway invocations. +#if !defined (TAO_HAS_MINIMUM_CORBA) + void put_params (TAO_GIOP_Invocation &call, CORBA::NVList_ptr args, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); // Helper method to factor out common code in dynamic oneway // vs. twoway invocations. +#endif /* TAO_HAS_MINIMUM_CORBA */ + private: TAO_Profile *set_profile_in_use_i (TAO_Profile *pfile); // Makes a copy of the profile and frees the existing profile_in_use. diff --git a/TAO/tao/corbafwd.h b/TAO/tao/corbafwd.h index 44cb290157e..66d2d56fa52 100644 --- a/TAO/tao/corbafwd.h +++ b/TAO/tao/corbafwd.h @@ -27,7 +27,7 @@ #define TAO_CORBAFWD_H // @@ TODO take the portion that we need of ace/CDR_Stream.h into -// ace/CDR_Types.h +// ace/CDR_Types.h #include "ace/CDR_Stream.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) @@ -135,6 +135,8 @@ typedef class CORBA_Exception *CORBA_Exception_ptr; TAO_SYSTEM_EXCEPTION_LIST #undef TAO_SYSTEM_EXCEPTION +#if !defined (TAO_HAS_MINIMUM_CORBA) + class CORBA_Request; class CORBA_Request_var; class CORBA_Request_out; @@ -150,6 +152,8 @@ class CORBA_NVList_var; class CORBA_NVList_out; typedef class CORBA_NVList *CORBA_NVList_ptr; +#endif /* TAO_HAS_MINIMUM_CORBA */ + class CORBA_ORB; class CORBA_ORB_var; class CORBA_ORB_out; @@ -310,6 +314,13 @@ public: typedef CORBA_SystemException SystemException; typedef CORBA_UserException UserException; +#if !defined (TAO_HAS_MINIMUM_CORBA) + + typedef CORBA_Request Request; + typedef Request *Request_ptr; + typedef CORBA_Request_var Request_var; + typedef CORBA_Request_out Request_out; + typedef CORBA_NamedValue NamedValue; typedef NamedValue *NamedValue_ptr; typedef CORBA_NamedValue_var NamedValue_var; @@ -320,6 +331,8 @@ public: typedef CORBA_NVList_var NVList_var; typedef CORBA_NVList_out NVList_out; +#endif /* TAO_HAS_MINIMUM_CORBA */ + typedef CORBA_Object Object; typedef CORBA_Object *Object_ptr; typedef CORBA_Object_var Object_var; @@ -338,11 +351,6 @@ public: typedef CORBA_ORB_var ORB_var; typedef CORBA_ORB_out ORB_out; - typedef CORBA_Request Request; - typedef Request *Request_ptr; - typedef CORBA_Request_var Request_var; - typedef CORBA_Request_out Request_out; - typedef CORBA_ServerRequest ServerRequest; typedef ServerRequest *ServerRequest_ptr; @@ -405,27 +413,37 @@ TAO_SYSTEM_EXCEPTION_LIST // = all the CORBA::is_nil methods. static Boolean is_nil (Object_ptr); static Boolean is_nil (Environment_ptr); - static Boolean is_nil (NamedValue_ptr); - static Boolean is_nil (NVList_ptr); - static Boolean is_nil (Request_ptr); // static Boolean is_nil (Context_ptr); static Boolean is_nil (TypeCode_ptr); static Boolean is_nil (ORB_ptr); static Boolean is_nil (Principal_ptr); static Boolean is_nil (ServerRequest_ptr req); +#if !defined (TAO_HAS_MINIMUM_CORBA) + + static Boolean is_nil (Request_ptr); + static Boolean is_nil (NamedValue_ptr); + static Boolean is_nil (NVList_ptr); + +#endif /* TAO_HAS_MINIMUM_CORBA */ + // = all the CORBA release methods. static void release (Object_ptr); static void release (Environment_ptr); - static void release (NamedValue_ptr); - static void release (NVList_ptr); - static void release (Request_ptr); static void release (Principal_ptr); static void release (Context_ptr); static void release (TypeCode_ptr); static void release (ORB_ptr); static void release (ServerRequest_ptr req); +#if !defined (TAO_HAS_MINIMUM_CORBA) + + static void release (Request_ptr); + static void release (NamedValue_ptr); + static void release (NVList_ptr); + +#endif /* TAO_HAS_MINIMUM_CORBA */ + enum TCKind { // = Kinds of typecodes. @@ -514,7 +532,7 @@ TAO_SYSTEM_EXCEPTION_LIST // Obtain the thread-specific default environment. // There could be a single version of these methods, but g++ 2.7.2 - // gets horribly confused if we used CORBA::default_environment() at + // gets horribly confused if we used CORBA::default_environment() at // this point. static ORB_ptr ORB_init (int &argc, char *const *argv, diff --git a/TAO/tao/default_server.cpp b/TAO/tao/default_server.cpp index 7226e704f3b..f7db60ca811 100644 --- a/TAO/tao/default_server.cpp +++ b/TAO/tao/default_server.cpp @@ -11,10 +11,6 @@ ACE_RCSID(tao, default_server, "$Id$") TAO_Default_Server_Strategy_Factory::TAO_Default_Server_Strategy_Factory (void) : thread_flags_ (THR_BOUND), - active_object_map_size_ (TAO_DEFAULT_SERVER_ACTIVE_OBJECT_MAP_SIZE), - object_lookup_strategy_for_user_id_policy_ (TAO_DYNAMIC_HASH), - object_lookup_strategy_for_system_id_policy_ (TAO_ACTIVE_DEMUX), - reverse_object_lookup_strategy_for_unique_id_policy_ (TAO_DYNAMIC_HASH), poa_lock_type_ (TAO_THREAD_LOCK), poa_mgr_lock_type_ (TAO_THREAD_LOCK), event_loop_lock_type_ (TAO_NULL_LOCK), @@ -169,105 +165,6 @@ TAO_Default_Server_Strategy_Factory::create_cached_connector_lock (void) return the_lock; } -TAO_Active_Object_Map_Impl * -TAO_Default_Server_Strategy_Factory::create_active_object_map (int user_id_policy) -{ - if (user_id_policy) - return this->create_user_id_policy_active_object_map (); - else - return this->create_system_id_policy_active_object_map (); -} - -TAO_Active_Object_Map_Impl * -TAO_Default_Server_Strategy_Factory::create_user_id_policy_active_object_map (void) -{ - return this->create_active_object_map_i (this->object_lookup_strategy_for_user_id_policy_, 1); -} - -TAO_Active_Object_Map_Impl * -TAO_Default_Server_Strategy_Factory::create_system_id_policy_active_object_map (void) -{ - return this->create_active_object_map_i (this->object_lookup_strategy_for_system_id_policy_, 0); -} - -TAO_Active_Object_Map_Impl * -TAO_Default_Server_Strategy_Factory::create_active_object_map_i (TAO_Demux_Strategy table_type, - int user_id_policy) -{ - // Create the appropriate-sized object table based on passed - // arguments. - TAO_Active_Object_Map_Impl *objtable = 0; - - switch (table_type) - { - case TAO_LINEAR: - ACE_NEW_RETURN (objtable, - TAO_Linear_Active_Object_Map (this->active_object_map_size_), - 0); - break; - // Don't do this one right now until we determine how to deal - // with its reliance on a global singleton. - case TAO_USER_DEFINED: - // it is assumed that the user would have used the hooks to - // supply a user-defined instance of the object table - // - // Note that the usage below doesn't really fit very well now. - // We need for the userdef stuff to provide a creation hook--IF - // we decide to keep the whole demultiplexing strategy creation - // the way it is. IMHO, the way that userdef stuff should be - // done is to create the User_Server_Strategy_Factory and just - // link it in. The default server would only encompass the - // strategies that are "shipped", so to speak. --cjc - if (user_id_policy) - objtable = TAO_ORB_Core_instance()->oa_params()->userdef_lookup_strategy_for_user_id_policy (); - else - objtable = TAO_ORB_Core_instance()->oa_params()->userdef_lookup_strategy_for_system_id_policy (); - break; - case TAO_ACTIVE_DEMUX: - ACE_NEW_RETURN (objtable, - TAO_Active_Demux_Active_Object_Map (this->active_object_map_size_), - 0); - break; - case TAO_DYNAMIC_HASH: - ACE_NEW_RETURN (objtable, - TAO_Dynamic_Hash_Active_Object_Map (this->active_object_map_size_), - 0); - break; - } - - return objtable; -} - -TAO_Reverse_Active_Object_Map_Impl * -TAO_Default_Server_Strategy_Factory::create_reverse_active_object_map (int unique_id_policy) -{ - // Create the appropriate-sized object table based on passed - // arguments. - TAO_Reverse_Active_Object_Map_Impl *objtable = 0; - - if (unique_id_policy) - { - if (this->reverse_object_lookup_strategy_for_unique_id_policy_ == TAO_USER_DEFINED) - { - objtable = TAO_ORB_Core_instance ()->oa_params ()->userdef_reverse_lookup_strategy_for_unique_id_policy (); - } - else - { - ACE_NEW_RETURN (objtable, - TAO_Reverse_Active_Object_Map_For_Unique_Id_Policy (this->active_object_map_size_), - 0); - } - } - else - { - ACE_NEW_RETURN (objtable, - TAO_Reverse_Active_Object_Map_For_Multiple_Id_Policy (), - 0); - } - - return objtable; -} - // Evil macros b/c I'm lazy! #define TAO_BEGINCHECK if (0) #define TAO_CHECKANDSET(sym) else if (ACE_OS::strcmp (flag, #sym) == 0) ACE_SET_BITS (this->thread_flags_, sym) @@ -338,7 +235,27 @@ TAO_Default_Server_Strategy_Factory::parse_args (int argc, char *argv[]) { curarg++; if (curarg < argc) - this->active_object_map_size_ = ACE_OS::strtoul (argv[curarg], 0, 10); + this->active_object_map_creation_parameters_.active_object_map_size_ = ACE_OS::strtoul (argv[curarg], 0, 10); + } + else if (ACE_OS::strcmp (argv[curarg], "-ORBactivehintinids") == 0) + { + curarg++; + if (curarg < argc) + { + char *value = argv[curarg]; + + this->active_object_map_creation_parameters_.use_active_hint_in_ids_ = ACE_OS::atoi (value); + } + } + else if (ACE_OS::strcmp (argv[curarg], "-ORBallowreactivationofsystemids") == 0) + { + curarg++; + if (curarg < argc) + { + char *value = argv[curarg]; + + this->active_object_map_creation_parameters_.allow_reactivation_of_system_ids_ = ACE_OS::atoi (value); + } } else if (ACE_OS::strcmp (argv[curarg], "-ORBuseridpolicydemuxstrategy") == 0) { @@ -349,34 +266,24 @@ TAO_Default_Server_Strategy_Factory::parse_args (int argc, char *argv[]) // Active demux not supported with user id policy if (ACE_OS::strcasecmp (name, "dynamic") == 0) - this->object_lookup_strategy_for_user_id_policy_ = TAO_DYNAMIC_HASH; + this->active_object_map_creation_parameters_.object_lookup_strategy_for_user_id_policy_ = TAO_DYNAMIC_HASH; else if (ACE_OS::strcasecmp (name, "linear") == 0) - this->object_lookup_strategy_for_user_id_policy_ = TAO_LINEAR; - else if (ACE_OS::strcasecmp (name, "user") == 0) - this->object_lookup_strategy_for_user_id_policy_ = TAO_USER_DEFINED; + this->active_object_map_creation_parameters_.object_lookup_strategy_for_user_id_policy_ = TAO_LINEAR; } } - else if (ACE_OS::strcmp (argv[curarg], "-ORBsystemidpolicydemuxstrategy") == 0 - || ACE_OS::strcmp (argv[curarg], "-ORBdemuxstrategy") == 0) + else if (ACE_OS::strcmp (argv[curarg], "-ORBsystemidpolicydemuxstrategy") == 0) { - // @@ -ORBdemuxstrategy is deprecated and should not be used anymore. - if (ACE_OS::strcmp (argv[curarg], "-ORBdemuxstrategy") == 0) - ACE_DEBUG ((LM_DEBUG, - "Warning: -ORBdemuxstrategy is deprecated. Please use -ORBsystemidpolicydemuxstrategy instead.\n")); - curarg++; if (curarg < argc) { char *name = argv[curarg]; if (ACE_OS::strcasecmp (name, "dynamic") == 0) - this->object_lookup_strategy_for_system_id_policy_ = TAO_DYNAMIC_HASH; + this->active_object_map_creation_parameters_.object_lookup_strategy_for_system_id_policy_ = TAO_DYNAMIC_HASH; else if (ACE_OS::strcasecmp (name, "linear") == 0) - this->object_lookup_strategy_for_system_id_policy_ = TAO_LINEAR; + this->active_object_map_creation_parameters_.object_lookup_strategy_for_system_id_policy_ = TAO_LINEAR; else if (ACE_OS::strcasecmp (name, "active") == 0) - this->object_lookup_strategy_for_system_id_policy_ = TAO_ACTIVE_DEMUX; - else if (ACE_OS::strcasecmp (name, "user") == 0) - this->object_lookup_strategy_for_system_id_policy_ = TAO_USER_DEFINED; + this->active_object_map_creation_parameters_.object_lookup_strategy_for_system_id_policy_ = TAO_ACTIVE_DEMUX; } } else if (ACE_OS::strcmp (argv[curarg], "-ORBuniqueidpolicyreversedemuxstrategy") == 0) @@ -387,11 +294,18 @@ TAO_Default_Server_Strategy_Factory::parse_args (int argc, char *argv[]) char *name = argv[curarg]; if (ACE_OS::strcasecmp (name, "dynamic") == 0) - this->reverse_object_lookup_strategy_for_unique_id_policy_ = TAO_DYNAMIC_HASH; + this->active_object_map_creation_parameters_.reverse_object_lookup_strategy_for_unique_id_policy_ = TAO_DYNAMIC_HASH; else if (ACE_OS::strcasecmp (name, "user") == 0) - this->reverse_object_lookup_strategy_for_unique_id_policy_ = TAO_USER_DEFINED; + this->active_object_map_creation_parameters_.reverse_object_lookup_strategy_for_unique_id_policy_ = TAO_USER_DEFINED; } } + else if (ACE_OS::strcmp (argv[curarg], "-ORBdemuxstrategy") == 0) + { + ACE_DEBUG ((LM_DEBUG, + "Warning: -ORBdemuxstrategy is deprecated. Please use " + "-ORBsystemidpolicydemuxstrategy or -ORBuseridpolicydemuxstrategy instead.\n")); + curarg++; + } else if (ACE_OS::strcmp (argv[curarg], "-ORBpoalock") == 0) { curarg++; @@ -468,21 +382,13 @@ TAO_Default_Server_Strategy_Factory::parse_args (int argc, char *argv[]) return 0; } -u_long -TAO_Default_Server_Strategy_Factory::active_object_map_size (void) const -{ - return this->active_object_map_size_; -} - -TAO_Default_Server_Creation_Strategy:: -TAO_Default_Server_Creation_Strategy (ACE_Thread_Manager *t) +TAO_Default_Server_Creation_Strategy::TAO_Default_Server_Creation_Strategy (ACE_Thread_Manager *t) : ACE_Creation_Strategy<TAO_Server_Connection_Handler> (t) { } int -TAO_Default_Server_Creation_Strategy:: -make_svc_handler (TAO_Server_Connection_Handler *&sh) +TAO_Default_Server_Creation_Strategy::make_svc_handler (TAO_Server_Connection_Handler *&sh) { if (sh == 0) { diff --git a/TAO/tao/default_server.h b/TAO/tao/default_server.h index 01cad8eac2f..195fd9c6503 100644 --- a/TAO/tao/default_server.h +++ b/TAO/tao/default_server.h @@ -52,16 +52,6 @@ public: virtual CONCURRENCY_STRATEGY *concurrency_strategy (void); - virtual TAO_Active_Object_Map_Impl *create_active_object_map (int user_id_policy); - // Return a new id-->sevant table. If <user_id_policy> is true, the - // request is being made for a POA with USER_ID policy. Otherwise, - // the SYSTEM_ID policy is being used. - - virtual TAO_Reverse_Active_Object_Map_Impl *create_reverse_active_object_map (int unique_id_policy); - // Return a new servant-->id table. If <unique_id_policy> is true, - // the request is being made for a POA with UNIQUE_ID - // policy. Otherwise, the MULTIPLE_ID policy is being used. - virtual ACE_Lock *create_poa_lock (void); // Creates and returns a lock for POA based on the setting for // <-ORBpoalock>. A setting of <thread> returns an @@ -105,9 +95,6 @@ public: virtual int init (int argc, char *argv[]); // Initialize the ORB when it's linked dynamically. - virtual u_long active_object_map_size (void) const; - // Return the object table size - int parse_args (int argc, char *argv[]); // Arguments are in the form of -ORBxxx. Valid arguments are: // <-ORBconcurrency> <{which}> @@ -126,30 +113,9 @@ public: protected: void tokenize (char *flag_string); - // = Helpers for <create_active_object_map> - TAO_Active_Object_Map_Impl *create_user_id_policy_active_object_map (void); - TAO_Active_Object_Map_Impl *create_system_id_policy_active_object_map (void); - TAO_Active_Object_Map_Impl *create_active_object_map_i (TAO_Demux_Strategy table_type, - int user_id_policy); - u_long thread_flags_; // Default thread flags passed to thr_create(). - u_long active_object_map_size_; - // Default size of object lookup table. - - TAO_Demux_Strategy object_lookup_strategy_for_user_id_policy_; - // The type of lookup/demultiplexing strategy being used for user id - // policy - - TAO_Demux_Strategy object_lookup_strategy_for_system_id_policy_; - // The type of lookup/demultiplexing strategy being used for system - // id policy - - TAO_Demux_Strategy reverse_object_lookup_strategy_for_unique_id_policy_; - // The type of reverse lookup/demultiplexing strategy being used for - // the UNIQUE_ID policy - enum Lock_Type { TAO_NULL_LOCK, diff --git a/TAO/tao/orbconf.h b/TAO/tao/orbconf.h index 2e663146195..e5ef3579e36 100644 --- a/TAO/tao/orbconf.h +++ b/TAO/tao/orbconf.h @@ -255,4 +255,7 @@ // The Root POA default name. #define TAO_DEFAULT_ROOTPOA_NAME "" +// Minimum CORBA +// #define TAO_HAS_MINIMUM_CORBA + #endif /* TAO_ORB_CONFIG_H */ |