diff options
author | jai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-10-05 02:35:47 +0000 |
---|---|---|
committer | jai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-10-05 02:35:47 +0000 |
commit | f72fcee1e876501b9936fe1dc9ccfeba42885b6a (patch) | |
tree | d744eb1729e356360d2e5cad94e6f2ae2261090d | |
parent | 402f34c0c02ab1ff0c663707018938fa6ecc8046 (diff) | |
download | ATCD-f72fcee1e876501b9936fe1dc9ccfeba42885b6a.tar.gz |
Fri Oct 4 19:31:51 2002 Jaiganesh Balasubramanian <jai@doc.ece.uci.edu>
-rw-r--r-- | TAO/ChangeLog | 11 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Basic.cpp | 35 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Basic.h | 31 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/LoadBalancing/GenericFactory/LB_server.cpp | 45 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/LoadBalancing/GenericFactory/LB_server.h | 19 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Makefile | 160 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/LoadBalancing/GenericFactory/client.cpp | 11 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/LoadBalancing/GenericFactory/server.cpp | 62 |
8 files changed, 258 insertions, 116 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index c95f0392a77..016ebbbe792 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,14 @@ +Fri Oct 4 19:31:51 2002 Jaiganesh Balasubramanian <jai@doc.ece.uci.edu> + + * orbsvcs/tests/LoadBalancing/GenericFactory/Basic.cpp: + * orbsvcs/tests/LoadBalancing/GenericFactory/Basic.h: + * orbsvcs/tests/LoadBalancing/GenericFactory/LB_server.h: + * orbsvcs/tests/LoadBalancing/GenericFactory/LB_server.cpp: + * orbsvcs/tests/LoadBalancing/GenericFactory/Makefile: + * orbsvcs/tests/LoadBalancing/GenericFactory/client.cpp: + * orbsvcs/tests/LoadBalancing/GenericFactory/server.cpp: + Fixed the code review comments given by Ossama. + Fri Oct 04 19:23:08 2002 Irfan Pyarali <irfan@oomworks.com> * tao/PortableServer/Object_Adapter.cpp (init): diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Basic.cpp b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Basic.cpp index 547f43f3d85..85023fca026 100644 --- a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Basic.cpp +++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Basic.cpp @@ -2,12 +2,20 @@ // $Id$ // #include "Basic.h" +#include "LB_server.h" ACE_RCSID (GenericFactory, Basic, "$Id$") -Basic::Basic (CORBA::ORB_ptr orb) +Basic::Basic (CORBA::Object_ptr object_group, + CosLoadBalancing::LoadManager_ptr lm, + CORBA::ORB_ptr orb, + const char *loc) : orb_ (CORBA::ORB::_duplicate (orb)) { + this->object_group_ = CORBA::Object::_duplicate (object_group); + this->lm_ = CosLoadBalancing::LoadManager::_duplicate (lm); + this->location_.length (1); + this->location_[0].id = CORBA::string_dup (loc); } char * @@ -21,5 +29,28 @@ void Basic::shutdown (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { - this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); + ACE_TRY + { + this->lm_->remove_member (this->object_group_.in (), + this->location_ + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCH (PortableGroup::ObjectNotFound, ex) + { + ACE_PRINT_EXCEPTION (ex, + "Caught exception"); + ACE_TRY_THROW (CORBA::INTERNAL ()); + } + ACE_CATCH (PortableGroup::MemberNotFound, ex) + { + ACE_PRINT_EXCEPTION (ex, + "Caught exception"); + ACE_TRY_THROW (CORBA::INTERNAL ()); + } + ACE_ENDTRY; + } diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Basic.h b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Basic.h index afa65f11ef8..16b50fab81e 100644 --- a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Basic.h +++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Basic.h @@ -5,10 +5,9 @@ #ifndef BASIC_H #define BASIC_H -// @@ Jai, you don't need this header for non-library code. -#include "ace/pre.h" - #include "TestS.h" +#include "orbsvcs/orbsvcs/CosLoadBalancingC.h" +#include "orbsvcs/orbsvcs/PortableGroupC.h" #if defined (_MSC_VER) # if (_MSC_VER >= 1200) @@ -17,22 +16,18 @@ # pragma warning (disable:4250) #endif /* _MSC_VER */ +class LB_Basic_Test; /// Implement the Test::Basic interface class Basic : public virtual POA_Test::Basic -// @@ Jai, do you really want to enable reference counting in this -// servant? There is nothing wrong in doing so but the code in -// server.cpp assumes that the server is not reference counted. -// -// If you're going to leave reference counting enabled, add a -// protected destructor to force proper memory management through -// the reference counting mechanism. - , public virtual PortableServer::RefCountServantBase { public: /// Constructor - Basic (CORBA::ORB_ptr orb); + Basic (CORBA::Object_ptr object_group, + CosLoadBalancing::LoadManager_ptr lm, + CORBA::ORB_ptr orb, + const char *loc); virtual char * get_string (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); @@ -44,12 +39,20 @@ private: /// Use an ORB reference to convert strings to objects and shutdown /// the application. CORBA::ORB_var orb_; + + /// Load Manager Reference used to delete the servant reference from the + /// object group. + CosLoadBalancing::LoadManager_var lm_; + + /// Location of the object group member. + PortableGroup::Location location_ ; + + /// Object Group reference. + CORBA::Object_var object_group_; }; #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma warning(pop) #endif /* _MSC_VER */ -// @@ Jai, you don't need this header for non-library code. -#include "ace/post.h" #endif /* BASIC_H */ diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/LB_server.cpp b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/LB_server.cpp index 42ab6b9f3de..a1283fe9f38 100644 --- a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/LB_server.cpp +++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/LB_server.cpp @@ -7,31 +7,22 @@ ACE_RCSID (GenericFactory, LB_server, "$Id$") - -// @@ Jai why do you have this pragma here? -// 1) You probably don't need it at all. -// 2) It should be used before the class is declared, i.e the -// header in this case! -#if defined (_MSC_VER) -# pragma warning (disable : 4250) -#endif /* _MSC_VER */ - LB_Basic_Test::LB_Basic_Test (int argc, char **argv) : argc_ (argc) , argv_ (argv) { } -LB_Basic_Test::~LB_Basic_Test (void) +int +LB_Basic_Test::destroy (void) { ACE_TRY_NEW_ENV { - this->root_poa_->destroy (1, 1 ACE_ENV_ARG_PARAMETER); + this->lm_->delete_object (this->fcid_.in () + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - // @@ Jai, you're missing the ACE_ENV_ARG_PARAMETER in this - // call. The ACE_TRY_CHECK below is useless without it. - this->lm_->delete_object (this->fcid_.in ()); + this->root_poa_->destroy (1, 1 ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; this->orb_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); @@ -43,6 +34,26 @@ LB_Basic_Test::~LB_Basic_Test (void) "Exception caught while destroying Basic_Test\n"); } ACE_ENDTRY; + + return 1; +} + +CORBA::ORB_ptr +LB_Basic_Test::orb (void) +{ + return this->orb_.in (); +} + +CORBA::Object_ptr +LB_Basic_Test::object_group (void) +{ + return this->object_group_.in (); +} + +CosLoadBalancing::LoadManager_ptr +LB_Basic_Test::load_manager (void) +{ + return this->lm_.in (); } int @@ -142,11 +153,11 @@ LB_Basic_Test::create_object_group (void) PortableGroup::MEMB_APP_CTRL; property.val <<= msv; - // @@ Jai, you're missing the ACE_ENV_ARG_PARAMETER in this - // call, and the accompanying ACE_TRY_CHECK after it. this->object_group_ = this->lm_->create_object (repository_id, criteria, - this->fcid_.out ()); + this->fcid_.out () + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; CORBA::String_var ior = this->orb_->object_to_string (this->object_group_.in () diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/LB_server.h b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/LB_server.h index 76914aa9d55..9c974bb3ebf 100644 --- a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/LB_server.h +++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/LB_server.h @@ -39,8 +39,8 @@ public: LB_Basic_Test (int argc, char **argv); // Constructor - ~LB_Basic_Test (void); - // Destructor + int destroy (void); + // destroys LoadManager, ORB and POA. int start_orb_and_poa (void); // start the ORB. @@ -54,16 +54,15 @@ public: int register_servant (Basic *servant, const char *loc); // register the servants with the object group. - // @@ Jai, we do not inline methods in the header. If you're going - // to inline this method, put it in a separate inline file. Is - // it really necessary to inline this method? - // @@ Jai, you're missing the "void" parameter in this method. - // According to our coding style, methods/functions without - // parameters must have "void" explicitly placed in the parameter - // list. I've mentioned this to you before. - CORBA::ORB_ptr orb () { return this->orb_.in ();} + CORBA::ORB_ptr orb (void); // for servants to register to the initialised ORB. + CORBA::Object_ptr object_group (void); + // for servants to get the reference for object_group. + + CosLoadBalancing::LoadManager_ptr load_manager (void); + // for servants to get the reference for object_group. + private: CosLoadBalancing::LoadManager_var lm_; diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Makefile b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Makefile index 803f3fd7634..c613a5684dc 100644 --- a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Makefile +++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Makefile @@ -70,7 +70,8 @@ realclean: clean # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. -.obj/client.o .obj/client.so .shobj/client.o .shobj/client.so: client.cpp TestC.h $(TAO_ROOT)/tao/corba.h \ +.obj/client.o .obj/client.so .shobj/client.o .shobj/client.so: client.cpp TestC.h \ + $(TAO_ROOT)/tao/corba.h \ $(ACE_ROOT)/ace/pre.h \ $(ACE_ROOT)/ace/post.h \ $(ACE_ROOT)/ace/ace_wchar.h \ @@ -99,7 +100,8 @@ realclean: clean $(ACE_ROOT)/ace/Global_Macros.h \ $(ACE_ROOT)/ace/Min_Max.h \ $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Trace.h $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ $(ACE_ROOT)/ace/Message_Block.i \ $(ACE_ROOT)/ace/Message_Block_T.h \ $(ACE_ROOT)/ace/Message_Block_T.i \ @@ -250,8 +252,8 @@ realclean: clean $(TAO_ROOT)/tao/Messaging_SyncScopeC.i \ $(TAO_ROOT)/tao/IOPC.h \ $(TAO_ROOT)/tao/IOPC.i \ - $(TAO_ROOT)/tao/PortableInterceptorC.i TestC.i \ - $(ACE_ROOT)/ace/Get_Opt.h \ + $(TAO_ROOT)/tao/PortableInterceptorC.i \ + TestC.i $(ACE_ROOT)/ace/Get_Opt.h \ $(ACE_ROOT)/ace/Containers.h \ $(ACE_ROOT)/ace/Containers.i \ $(ACE_ROOT)/ace/Containers_T.h \ @@ -262,7 +264,8 @@ realclean: clean $(ACE_ROOT)/ace/Containers_T.cpp \ $(ACE_ROOT)/ace/Get_Opt.i -.obj/TestC.o .obj/TestC.so .shobj/TestC.o .shobj/TestC.so: TestC.cpp TestC.h $(TAO_ROOT)/tao/corba.h \ +.obj/TestC.o .obj/TestC.so .shobj/TestC.o .shobj/TestC.so: TestC.cpp TestC.h \ + $(TAO_ROOT)/tao/corba.h \ $(ACE_ROOT)/ace/pre.h \ $(ACE_ROOT)/ace/post.h \ $(ACE_ROOT)/ace/ace_wchar.h \ @@ -291,7 +294,8 @@ realclean: clean $(ACE_ROOT)/ace/Global_Macros.h \ $(ACE_ROOT)/ace/Min_Max.h \ $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Trace.h $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ $(ACE_ROOT)/ace/Message_Block.i \ $(ACE_ROOT)/ace/Message_Block_T.h \ $(ACE_ROOT)/ace/Message_Block_T.i \ @@ -442,8 +446,8 @@ realclean: clean $(TAO_ROOT)/tao/Messaging_SyncScopeC.i \ $(TAO_ROOT)/tao/IOPC.h \ $(TAO_ROOT)/tao/IOPC.i \ - $(TAO_ROOT)/tao/PortableInterceptorC.i TestC.i \ - $(TAO_ROOT)/tao/Stub.h \ + $(TAO_ROOT)/tao/PortableInterceptorC.i \ + TestC.i $(TAO_ROOT)/tao/Stub.h \ $(TAO_ROOT)/tao/MProfile.h \ $(TAO_ROOT)/tao/MProfile.i \ $(TAO_ROOT)/tao/ORB_Core.h \ @@ -587,7 +591,8 @@ realclean: clean $(ACE_ROOT)/ace/Global_Macros.h \ $(ACE_ROOT)/ace/Min_Max.h \ $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Trace.h $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ $(ACE_ROOT)/ace/Message_Block.i \ $(ACE_ROOT)/ace/Message_Block_T.h \ $(ACE_ROOT)/ace/Message_Block_T.i \ @@ -738,7 +743,8 @@ realclean: clean $(TAO_ROOT)/tao/Messaging_SyncScopeC.i \ $(TAO_ROOT)/tao/IOPC.h \ $(TAO_ROOT)/tao/IOPC.i \ - $(TAO_ROOT)/tao/PortableInterceptorC.i TestC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.i \ + TestC.i \ $(TAO_ROOT)/tao/PortableServer/PortableServer.h \ $(TAO_ROOT)/tao/PortableServer/portableserver_export.h \ $(TAO_ROOT)/tao/PortableServer/PortableServerC.h \ @@ -926,7 +932,8 @@ realclean: clean $(ACE_ROOT)/ace/Global_Macros.h \ $(ACE_ROOT)/ace/Min_Max.h \ $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Trace.h $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ $(ACE_ROOT)/ace/Message_Block.i \ $(ACE_ROOT)/ace/Message_Block_T.h \ $(ACE_ROOT)/ace/Message_Block_T.i \ @@ -1241,7 +1248,8 @@ realclean: clean $(ACE_ROOT)/ace/Global_Macros.h \ $(ACE_ROOT)/ace/Min_Max.h \ $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Trace.h $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ $(ACE_ROOT)/ace/Message_Block.i \ $(ACE_ROOT)/ace/Message_Block_T.h \ $(ACE_ROOT)/ace/Message_Block_T.i \ @@ -1525,8 +1533,9 @@ realclean: clean $(TAO_ROOT)/tao/PortableServer/Direct_Object_Proxy_Impl.h \ TestS_T.h TestS_T.i TestS_T.cpp TestS.i -.obj/Basic.o .obj/Basic.so .shobj/Basic.o .shobj/Basic.so: Basic.cpp Basic.h $(ACE_ROOT)/ace/pre.h TestS.h \ - TestC.h $(TAO_ROOT)/tao/corba.h \ +.obj/Basic.o .obj/Basic.so .shobj/Basic.o .shobj/Basic.so: Basic.cpp Basic.h TestS.h TestC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/pre.h \ $(ACE_ROOT)/ace/post.h \ $(ACE_ROOT)/ace/ace_wchar.h \ $(ACE_ROOT)/ace/ace_wchar.inl \ @@ -1554,7 +1563,8 @@ realclean: clean $(ACE_ROOT)/ace/Global_Macros.h \ $(ACE_ROOT)/ace/Min_Max.h \ $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Trace.h $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ $(ACE_ROOT)/ace/Message_Block.i \ $(ACE_ROOT)/ace/Message_Block_T.h \ $(ACE_ROOT)/ace/Message_Block_T.i \ @@ -1705,7 +1715,8 @@ realclean: clean $(TAO_ROOT)/tao/Messaging_SyncScopeC.i \ $(TAO_ROOT)/tao/IOPC.h \ $(TAO_ROOT)/tao/IOPC.i \ - $(TAO_ROOT)/tao/PortableInterceptorC.i TestC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.i \ + TestC.i \ $(TAO_ROOT)/tao/PortableServer/PortableServer.h \ $(TAO_ROOT)/tao/PortableServer/portableserver_export.h \ $(TAO_ROOT)/tao/PortableServer/PortableServerC.h \ @@ -1722,6 +1733,121 @@ realclean: clean $(TAO_ROOT)/tao/PortableServer/Collocated_Object.i \ $(TAO_ROOT)/tao/PortableServer/ThruPOA_Object_Proxy_Impl.h \ $(TAO_ROOT)/tao/PortableServer/Direct_Object_Proxy_Impl.h \ - TestS_T.h TestS_T.i TestS_T.cpp TestS.i + TestS_T.h TestS_T.i TestS_T.cpp TestS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosLoadBalancingC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/LoadBalancing/LoadBalancing_export.h \ + $(TAO_ROOT)/tao/Messaging/Messaging.h \ + $(TAO_ROOT)/tao/Messaging/messaging_export.h \ + $(TAO_ROOT)/tao/Messaging/MessagingC.h \ + $(TAO_ROOT)/tao/Messaging/Messaging_SyncScope_PolicyC.h \ + $(TAO_ROOT)/tao/Messaging/Messaging_SyncScope_PolicyC.i \ + $(TAO_ROOT)/tao/Messaging/Messaging_RT_PolicyC.h \ + $(TAO_ROOT)/tao/TimeBaseC.h \ + $(TAO_ROOT)/tao/SmartProxies/Smart_Proxies.h \ + $(TAO_ROOT)/tao/SmartProxies/smartproxies_export.h \ + $(TAO_ROOT)/tao/TAO_Singleton.h \ + $(TAO_ROOT)/tao/TAO_Singleton.inl \ + $(TAO_ROOT)/tao/TAO_Singleton.cpp \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(TAO_ROOT)/tao/TAO_Singleton_Manager.h \ + $(TAO_ROOT)/tao/TAO_Singleton_Manager.inl \ + $(TAO_ROOT)/tao/SmartProxies/Smart_Proxies.inl \ + $(TAO_ROOT)/tao/TimeBaseC.i \ + $(TAO_ROOT)/tao/Messaging/Messaging_RT_PolicyC.i \ + $(TAO_ROOT)/tao/Messaging/Messaging_No_ImplC.h \ + $(TAO_ROOT)/tao/Messaging/Messaging_No_ImplC.i \ + $(TAO_ROOT)/tao/Messaging/MessagingC.i \ + $(TAO_ROOT)/tao/Messaging/TAO_ExtC.h \ + $(TAO_ROOT)/tao/Messaging/TAO_ExtC.i \ + $(TAO_ROOT)/tao/TAOC.h \ + $(TAO_ROOT)/tao/TAOC.i \ + $(TAO_ROOT)/tao/Messaging/Twoway_Asynch_Invocation.h \ + $(TAO_ROOT)/tao/Messaging/Asynch_Reply_Dispatcher.h \ + $(TAO_ROOT)/tao/Messaging/Asynch_Timeout_Handler.h \ + $(TAO_ROOT)/tao/Asynch_Reply_Dispatcher_Base.h \ + $(TAO_ROOT)/tao/Transport.h \ + $(TAO_ROOT)/tao/Transport_Descriptor_Interface.h \ + $(TAO_ROOT)/tao/Transport_Descriptor_Interface.inl \ + $(TAO_ROOT)/tao/Transport_Cache_Manager.h \ + $(TAO_ROOT)/tao/Cache_Entries.h \ + $(ACE_ROOT)/ace/Recyclable.h \ + $(ACE_ROOT)/ace/Recyclable.inl \ + $(TAO_ROOT)/tao/Cache_Entries.inl \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Types.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/DLL.h \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Service_Types.i \ + $(ACE_ROOT)/ace/XML_Svc_Conf.h \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(TAO_ROOT)/tao/Transport_Cache_Manager.inl \ + $(TAO_ROOT)/tao/Transport_Timer.h \ + $(TAO_ROOT)/tao/Incoming_Message_Queue.h \ + $(TAO_ROOT)/tao/Pluggable_Messaging_Utils.h \ + $(TAO_ROOT)/tao/Pluggable_Messaging_Utils.i \ + $(TAO_ROOT)/tao/Incoming_Message_Queue.inl \ + $(TAO_ROOT)/tao/Synch_Refcountable.h \ + $(ACE_ROOT)/ace/Refcountable.h \ + $(ACE_ROOT)/ace/Refcountable.inl \ + $(TAO_ROOT)/tao/Synch_Refcountable.inl \ + $(TAO_ROOT)/tao/Transport.inl \ + $(TAO_ROOT)/tao/Reply_Dispatcher.h \ + $(TAO_ROOT)/tao/Reply_Dispatcher.i \ + $(TAO_ROOT)/tao/Asynch_Reply_Dispatcher_Base.i \ + $(TAO_ROOT)/tao/Messaging/Asynch_Reply_Dispatcher.i \ + $(TAO_ROOT)/tao/Asynch_Invocation.h \ + $(TAO_ROOT)/tao/Invocation.h \ + $(TAO_ROOT)/tao/Synch_Reply_Dispatcher.h \ + $(TAO_ROOT)/tao/LF_Event.h \ + $(TAO_ROOT)/tao/LF_Event.inl \ + $(TAO_ROOT)/tao/GIOP_Message_Version.h \ + $(TAO_ROOT)/tao/GIOP_Message_Version.inl \ + $(TAO_ROOT)/tao/operation_details.h \ + $(TAO_ROOT)/tao/Service_Context.h \ + $(TAO_ROOT)/tao/Service_Context.inl \ + $(TAO_ROOT)/tao/target_specification.h \ + $(TAO_ROOT)/tao/target_specification.i \ + $(TAO_ROOT)/tao/operation_details.i \ + $(TAO_ROOT)/tao/Invocation.i \ + $(TAO_ROOT)/tao/Asynch_Invocation.i \ + $(TAO_ROOT)/tao/Messaging/Twoway_Asynch_Invocation.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/PortableGroupC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/PortableGroup/portablegroup_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Naming/naming_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.i \ + $(TAO_ROOT)/tao/GIOPC.h \ + $(TAO_ROOT)/tao/GIOPC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/PortableGroupC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosLoadBalancingC.i \ + LB_server.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/client.cpp b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/client.cpp index 018b66d7d76..8ca5bf4d686 100644 --- a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/client.cpp +++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/client.cpp @@ -61,12 +61,6 @@ main (int argc, char *argv[]) 1); } - // @@ Jai, make multiple invocations to force the load balancer - // to return forward the client to a different servant. It's - // not crucial to do this. Doing so is just meant to - // exercise the LoadManager internals a bit. For example, - // try putting the below get_string() call in a loop that - // executes 10 times. CORBA::String_var the_string = basic->get_string (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; @@ -74,9 +68,6 @@ main (int argc, char *argv[]) ACE_DEBUG ((LM_DEBUG, "(%P|%t) - string returned <%s>\n", the_string.in ())); - // @@ Jai, something to think about... You're shutting down the - // servant, but its object reference is still registered with - // the LoadManager. What does that mean? :-) basic->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; @@ -86,7 +77,7 @@ main (int argc, char *argv[]) ACE_CATCHANY { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Exception caught:"); + "Exception caught in client.cpp:"); return 1; } ACE_ENDTRY; diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/server.cpp b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/server.cpp index 75675a72cd6..969432ef629 100644 --- a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/server.cpp +++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/server.cpp @@ -8,9 +8,6 @@ ACE_RCSID (GenericFactory, int main (int argc, char *argv[]) { - // @@ Jai, why do you have this ACE_TRY block? None of your code - // below uses it. That is why you're getting an "unused - // ACE_TRY_FLAG" warning. ACE_TRY_NEW_ENV { const char *loc1 = "MyLocation 1"; @@ -24,40 +21,15 @@ main (int argc, char *argv[]) if (basic_test.create_object_group () == -1) return 1; - // @@ You've enabled reference counting in this servant but you - // instantiate the servant on the stack! Either disable - // reference counting by not inheriting from - // PortableServer::RefCountServantBase or instantiate these - // servants on the heap, and store the servant pointers in a - // PortableServer::ServantBase_var to eventually transfer - // ownership to the POA. For example: - // - // Basic * servant; - // ACE_NEW_THROW_EX (servant, - // Basic (basic_test.orb ()), - // CORBA::NO_MEMORY ()); - // ACE_TRY_CHECK; - // - // PortableServer::ServantBase_var safe_servant = servant; - // - // When safe_servant goes out of scope, the reference count - // is decreased by one. However, when the servant was - // activated it's reference count was incremented by one by - // the POA. The net effect is that the POA ends up managing - // servant's memory. - // - // If you really intended for the servants to be reference - // counted, you would have noticed this problem had you made - // the servant's destructor protected. Doing so would have - // caused the compiler to choke on the below code since the - // it would attempt to generate code that calls a protected - // destructor, as if it was public. - // - // Decide if you want to reference count the servant or not. - // As things are now, the POA will probably seg fault when - // attempt to clean up its resources. - Basic basic_servant1 (basic_test.orb ()); - Basic basic_servant2 (basic_test.orb ()); + Basic basic_servant1 (basic_test.object_group (), + basic_test.load_manager (), + basic_test.orb (), + loc1); + + Basic basic_servant2 (basic_test.object_group (), + basic_test.load_manager (), + basic_test.orb (), + loc2); if (basic_test.register_servant (&basic_servant1, loc1) == -1) return 1; @@ -65,15 +37,13 @@ main (int argc, char *argv[]) if (basic_test.register_servant (&basic_servant2, loc2) == -1) return 1; - // @@ Jai, where's your orb->run() call? You're client can't - // make invocations on the servants without it! Presumably, - // the code should look like this: - // - // basic_test.orb ()->run (ACE_ENV_SINGLE_ARG_PARAMETER); - // ACE_TRY_CHECK; - // - // Note that you'll need the ACE_TRY_NEW_ENV block if you run - // the ORB here. + basic_test.orb ()->run (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - event loop finished\n")); + + basic_test.destroy (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; } ACE_CATCHANY { |