diff options
author | doccvs <doccvs@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-12-22 22:19:33 +0000 |
---|---|---|
committer | doccvs <doccvs@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-12-22 22:19:33 +0000 |
commit | e89cafbb7e4de961db24f77f5828d1c908f2ef98 (patch) | |
tree | 4742dc76fcf1d3099728949e4cbe4770ab3b65fb /TAO | |
parent | a841826f94054005f0def249b0f4edbb5599ee9d (diff) | |
download | ATCD-e89cafbb7e4de961db24f77f5828d1c908f2ef98.tar.gz |
ChangeLogTag: Fri Dec 22 14:13:46 2000 Priyanka Gontla <pgontla@ece.uci.edu>
Diffstat (limited to 'TAO')
-rw-r--r-- | TAO/ChangeLogs/ChangeLog-02a | 91 | ||||
-rw-r--r-- | TAO/tao/Default_Protocols_Hooks.cpp | 44 | ||||
-rw-r--r-- | TAO/tao/Default_Protocols_Hooks.h | 27 | ||||
-rw-r--r-- | TAO/tao/DynamicInterface/Makefile | 68 | ||||
-rw-r--r-- | TAO/tao/Invocation_Endpoint_Selectors.cpp | 11 | ||||
-rw-r--r-- | TAO/tao/Makefile | 417 | ||||
-rw-r--r-- | TAO/tao/ORB.cpp | 4 | ||||
-rw-r--r-- | TAO/tao/ORB_Core.cpp | 180 | ||||
-rw-r--r-- | TAO/tao/ORB_Core.h | 42 | ||||
-rw-r--r-- | TAO/tao/ORB_Core.i | 30 | ||||
-rw-r--r-- | TAO/tao/Pool_Per_Endpoint.cpp | 11 | ||||
-rw-r--r-- | TAO/tao/PortableServer/Makefile | 33 | ||||
-rw-r--r-- | TAO/tao/PortableServer/Object_Adapter.cpp | 23 | ||||
-rw-r--r-- | TAO/tao/Protocols_Hooks.cpp | 39 | ||||
-rw-r--r-- | TAO/tao/Protocols_Hooks.h | 33 | ||||
-rw-r--r-- | TAO/tao/RT_Current.cpp | 12 | ||||
-rw-r--r-- | TAO/tao/RT_ORBInitializer.cpp | 5 | ||||
-rw-r--r-- | TAO/tao/RT_Protocols_Hooks.cpp | 363 | ||||
-rw-r--r-- | TAO/tao/RT_Protocols_Hooks.h | 29 | ||||
-rw-r--r-- | TAO/tao/Strategies/Reactor_Per_Priority.cpp | 16 | ||||
-rw-r--r-- | TAO/tao/Stub.cpp | 38 |
21 files changed, 1045 insertions, 471 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a index 5f32d6aa6fc..8300ef4468f 100644 --- a/TAO/ChangeLogs/ChangeLog-02a +++ b/TAO/ChangeLogs/ChangeLog-02a @@ -1,3 +1,94 @@ +Fri Dec 22 14:13:46 2000 Priyanka Gontla <pgontla@ece.uci.edu> + + * tao/ORB_Core.h : + * tao/ORB_Core.cpp : + * tao/ORB_Core.i: + + This change is aimed at making ORB_Core not-dependent on RT_ORB, + RT_Current, Priority_Mapping_Manager and RT_Policy_i. + + Removed the set_default_policies method. It now is in + Protocols_Hooks and derived classes. The default implementation + does nothing and the RT_Protocols_Hooks implementation does the + actual setting of the policies. With this change, ORB_Core doesnt + depend on RT_Policy_i. + + Similar is the case with get_thread_priority and + set_thread_priority methods. + + Added resolve_rt_orb_i (CORBA::Environment &) method. + This method creates the RT_ORB with the help of the + TAO_RT_ORB_Loader class. And also helps set the RT_Current + object. This method is called by TAO_ORB_Core::rt_orb (). + + Added and modified accessor methods for + TAO_Priority_Mapping_Manager. + CORBA::Object_ptr priority_mapping_manager (void); + void priority_mapping_manager (CORBA::Object_ptr obj); + + The set method is called from RT_ORBInitializer which sets the + static variable CORBA::Object_ptr priority_mapping_manager_. + + Added a accessor method to retrieve the protected + TAO_Policy_Manager_Impl *default_policies_. + + The methods rt_orb and rt_current return CORBA::Object_ptr. + Modified the corresponding variables to be CORBA::Object_ptr's. + + Changed the signature of rt_orb to take CORBA::Environment as an + argument. + + * tao/RT_ORB_Loader.h: + * tao/RT_ORB_Loader.cpp: + The factory class that helps create an RT_ORB object and set the + RT_Current object. + + * tao/ORB.cpp (resolve_rt_current): + Started using the unused ACE_TRY_ENV in resolve_rt_orb. + Passed ACE_TRY_ENV as an argument when invoking + TAO_ORB_Core::rt_orb. + + * tao/RT_Protocols_Hooks.cpp : + * tao/RT_Protocols_Hooks.h : + * tao/Default_Protocols_Hooks.cpp : + * tao/Default_Protocols_Hooks.h : + * tao/Protocols_Hooks.cpp : + * tao/Protocols_Hooks.h : + + Added the following virtual functions. As before, the default + implementation does nothing and the RT implementation does the + needful. + + int get_thread_priority (TAO_ORB_Core *, + int set_thread_priority (TAO_ORB_Core *, + int set_default_policies (TAO_ORB_Core *orb_core); + These methods are moved from ORB_Core. + + void set_priority_mapping (TAO_ORB_Core *, + This method is called from ORB_Core to set the + priority_mapping. Added this new method to not use + TAO_Priority_Mapping_Manager class in ORB_Core. + + * tao/Invocation_Endpoint_Selectors.cpp : + * tao/PortableServer/Object_Adapter.cpp: + * tao/Strategies/Reactor_Per_Priority.cpp: + * tao/RT_Current.cpp: + * tao/Pool_Per_Endpoint.cpp: + + Changed the signatures and the way the methods are invoked + according to the changes done with regards to the modified + methods. + + * tao/Makefile: + Added the new files. RT_ORB_Loader.{h.cpp} + + * tao/Stub.cpp : + Fixed the KCC warnings related to the previous change. + Added some comments regarding the way I am throwing exceptions. + * tao/RT_Protocols_Hooks.cpp (validate_policy_type): + Set type_value=3 in the other 'if' case so that I can check on + the value of type_value to throw the needed exception. + Fri Dec 22 15:25:51 2000 Balachandran Natarajan <bala@cs.wustl.edu> * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.h: diff --git a/TAO/tao/Default_Protocols_Hooks.cpp b/TAO/tao/Default_Protocols_Hooks.cpp index 4d3d56f5a1d..e834c9f426d 100644 --- a/TAO/tao/Default_Protocols_Hooks.cpp +++ b/TAO/tao/Default_Protocols_Hooks.cpp @@ -86,16 +86,6 @@ TAO_Default_Protocols_Hooks::get_selector_bands_policy_hook ( return; } -void -TAO_Default_Protocols_Hooks::select_endpoint_hook ( - TAO_GIOP_Invocation *, - CORBA::Policy *, - TAO_Profile *&, - CORBA::Environment &) -{ - return; -} - CORBA::Policy * TAO_Default_Protocols_Hooks::effective_priority_banded_connection_hook (CORBA::Policy *, CORBA::Policy *, @@ -112,6 +102,40 @@ TAO_Default_Protocols_Hooks::effective_client_protocol_hook (CORBA::Policy *, return CORBA::Policy::_nil (); } +int +TAO_Default_Protocols_Hooks::get_thread_priority (TAO_ORB_Core *, + CORBA::Short &, + CORBA::Environment &) +{ + return 0; +} + +int +TAO_Default_Protocols_Hooks::set_thread_priority (TAO_ORB_Core *, + CORBA::Short, + CORBA::Environment &) +{ + return 0; +} + +void +TAO_Default_Protocols_Hooks::set_priority_mapping (TAO_ORB_Core *, + TAO_Resource_Factory *, + CORBA::Environment &) +{ + return; +} + +int +TAO_Default_Protocols_Hooks::set_default_policies (TAO_ORB_Core *) +{ + ACE_DEBUG ((LM_DEBUG, + "%s - %d\n", + __FILE__, __LINE__)); + + return 0; +} + // **************************************************************** ACE_STATIC_SVC_DEFINE (TAO_Default_Protocols_Hooks, diff --git a/TAO/tao/Default_Protocols_Hooks.h b/TAO/tao/Default_Protocols_Hooks.h index 2739ac2b5af..4f74b696f73 100644 --- a/TAO/tao/Default_Protocols_Hooks.h +++ b/TAO/tao/Default_Protocols_Hooks.h @@ -73,10 +73,6 @@ class TAO_Export TAO_Default_Protocols_Hooks : public TAO_Protocols_Hooks CORBA::Short &p, int &in_range); - virtual void select_endpoint_hook (TAO_GIOP_Invocation *invocation, - CORBA::Policy *client_protocol_policy, - TAO_Profile *&profile, - CORBA::Environment &ACE_TRY_ENV); /** * Hook to check and override the exposed policies if needed @@ -89,6 +85,29 @@ class TAO_Export TAO_Default_Protocols_Hooks : public TAO_Protocols_Hooks virtual CORBA::Policy *effective_client_protocol_hook (CORBA::Policy *override, CORBA::Policy *exposed, CORBA::Environment &); + + /** + * Accessor and modifier to the current thread priority, used to + * implement the RTCORBA::Current interface, but it is faster for + * some critical components. If TAO_HAS_RT_CORBA == 0, the + * operations are no-ops. + */ + //@{ + virtual int get_thread_priority (TAO_ORB_Core *, + CORBA::Short &, + CORBA::Environment &); + + virtual int set_thread_priority (TAO_ORB_Core *, + CORBA::Short, + CORBA::Environment &); + //@} + + virtual void set_priority_mapping (TAO_ORB_Core *, + TAO_Resource_Factory *, + CORBA::Environment &); + + virtual int set_default_policies (TAO_ORB_Core *orb_core); + }; #if defined (__ACE_INLINE__) diff --git a/TAO/tao/DynamicInterface/Makefile b/TAO/tao/DynamicInterface/Makefile index 3cbeb07e686..f636659632a 100644 --- a/TAO/tao/DynamicInterface/Makefile +++ b/TAO/tao/DynamicInterface/Makefile @@ -1256,12 +1256,6 @@ CPPFLAGS += -I$(TAO_ROOT) $(TAO_ROOT)/tao/PortableServer/Servant_Base.i \ dynamicinterface_export.h Server_Request.h Context.h Context.inl \ $(TAO_ROOT)/tao/TAO_Server_Request.h \ - $(TAO_ROOT)/tao/ORB.h \ - $(TAO_ROOT)/tao/Services.h \ - $(TAO_ROOT)/tao/Services.i \ - $(TAO_ROOT)/tao/CORBA_String.h \ - $(TAO_ROOT)/tao/CORBA_String.inl \ - $(TAO_ROOT)/tao/ORB.i \ $(TAO_ROOT)/tao/Tagged_Profile.h \ $(TAO_ROOT)/tao/IOPC.h \ $(TAO_ROOT)/tao/IOPC.i \ @@ -1276,6 +1270,12 @@ CPPFLAGS += -I$(TAO_ROOT) $(TAO_ROOT)/tao/Service_Context.inl \ $(TAO_ROOT)/tao/TAO_Server_Request.i \ Server_Request.inl $(TAO_ROOT)/tao/ORB_Core.h \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/CORBA_String.h \ + $(TAO_ROOT)/tao/CORBA_String.inl \ + $(TAO_ROOT)/tao/ORB.i \ $(TAO_ROOT)/tao/Policy_Manager.h \ $(TAO_ROOT)/tao/LocalObject.h \ $(TAO_ROOT)/tao/LocalObject.i \ @@ -1964,10 +1964,12 @@ CPPFLAGS += -I$(TAO_ROOT) $(TAO_ROOT)/tao/TAO_Server_Request.h \ $(ACE_ROOT)/ace/SString.h \ $(ACE_ROOT)/ace/SString.i \ - $(TAO_ROOT)/tao/ORB.h \ - $(TAO_ROOT)/tao/Exception.h \ - $(TAO_ROOT)/tao/Exception.i \ - $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Tagged_Profile.h \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/CDR.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/CDR.i \ $(TAO_ROOT)/tao/Sequence.h \ $(TAO_ROOT)/tao/Managed_Types.h \ $(TAO_ROOT)/tao/Managed_Types.i \ @@ -1975,30 +1977,6 @@ CPPFLAGS += -I$(TAO_ROOT) $(TAO_ROOT)/tao/Sequence_T.h \ $(TAO_ROOT)/tao/Sequence_T.i \ $(TAO_ROOT)/tao/Sequence_T.cpp \ - $(TAO_ROOT)/tao/Services.i \ - $(TAO_ROOT)/tao/CORBA_String.h \ - $(TAO_ROOT)/tao/CORBA_String.inl \ - $(TAO_ROOT)/tao/PolicyC.h \ - $(TAO_ROOT)/tao/CurrentC.h \ - $(TAO_ROOT)/tao/Object.h \ - $(TAO_ROOT)/tao/Abstract_Servant_Base.h \ - $(TAO_ROOT)/tao/Object_Proxy_Broker.h \ - $(TAO_ROOT)/tao/Object_Proxy_Impl.h \ - $(TAO_ROOT)/tao/Object.i \ - $(TAO_ROOT)/tao/CurrentC.i \ - $(TAO_ROOT)/tao/Encodable.h \ - $(TAO_ROOT)/tao/CDR.h \ - $(ACE_ROOT)/ace/CDR_Stream.h \ - $(ACE_ROOT)/ace/CDR_Stream.i \ - $(TAO_ROOT)/tao/CDR.i \ - $(TAO_ROOT)/tao/Typecode.h \ - $(TAO_ROOT)/tao/Typecode.i \ - $(TAO_ROOT)/tao/Environment.h \ - $(TAO_ROOT)/tao/Environment.i \ - $(TAO_ROOT)/tao/PolicyC.i \ - $(TAO_ROOT)/tao/ORB.i \ - $(TAO_ROOT)/tao/Tagged_Profile.h \ - $(TAO_ROOT)/tao/IOPC.h \ $(TAO_ROOT)/tao/IOPC.i \ $(TAO_ROOT)/tao/GIOPC.h \ $(TAO_ROOT)/tao/Object_KeyC.h \ @@ -2009,9 +1987,20 @@ CPPFLAGS += -I$(TAO_ROOT) $(TAO_ROOT)/tao/OctetSeqC.i \ $(TAO_ROOT)/tao/Service_Context.h \ $(TAO_ROOT)/tao/Service_Context.inl \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Abstract_Servant_Base.h \ + $(TAO_ROOT)/tao/Object_Proxy_Broker.h \ + $(TAO_ROOT)/tao/Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/Object.i \ $(TAO_ROOT)/tao/TAO_Server_Request.i \ Server_Request.inl $(TAO_ROOT)/tao/NVList.h \ $(TAO_ROOT)/tao/Any.h \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/Typecode.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/Typecode.i \ $(TAO_ROOT)/tao/Any.i \ $(TAO_ROOT)/tao/NVList.i \ $(TAO_ROOT)/tao/GIOP_Utils.h \ @@ -2019,6 +2008,17 @@ CPPFLAGS += -I$(TAO_ROOT) $(TAO_ROOT)/tao/Marshal.h \ $(TAO_ROOT)/tao/Principal.h \ $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/CORBA_String.h \ + $(TAO_ROOT)/tao/CORBA_String.inl \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/Encodable.h \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/ORB.i \ $(TAO_ROOT)/tao/Marshal.i .obj/Unknown_User_Exception.o .obj/Unknown_User_Exception.so .shobj/Unknown_User_Exception.o .shobj/Unknown_User_Exception.so: Unknown_User_Exception.cpp \ diff --git a/TAO/tao/Invocation_Endpoint_Selectors.cpp b/TAO/tao/Invocation_Endpoint_Selectors.cpp index 0fa74b575e3..c5132e72b8a 100644 --- a/TAO/tao/Invocation_Endpoint_Selectors.cpp +++ b/TAO/tao/Invocation_Endpoint_Selectors.cpp @@ -91,7 +91,10 @@ TAO_Endpoint_Selector_Factory::get_selector (TAO_GIOP_Invocation if (is_client_propagated) { // Get client priority. - if (invocation->orb_core_->get_thread_priority (state.client_priority_) + if (invocation->orb_core_->get_protocols_hooks () + ->get_thread_priority (invocation->orb_core_, + state.client_priority_, + ACE_TRY_ENV) == -1) ACE_THROW (CORBA::DATA_CONVERSION (1, CORBA::COMPLETED_NO)); @@ -221,10 +224,14 @@ check_client_priority_policy (TAO_GIOP_Invocation *invocation, // mode == TAO::USE_THREAD_PRIORITY { CORBA::Short priority; - if (invocation->orb_core_->get_thread_priority (priority) + if (invocation->orb_core_->get_protocols_hooks + ()->get_thread_priority (invocation->orb_core_, + priority, + ACE_TRY_ENV) == -1) ACE_THROW (CORBA::DATA_CONVERSION (1, CORBA::COMPLETED_NO)); + invocation->endpoint_selection_state_.min_priority_ = priority; invocation->endpoint_selection_state_.max_priority_ = diff --git a/TAO/tao/Makefile b/TAO/tao/Makefile index a2740129d96..9e2f33553cf 100644 --- a/TAO/tao/Makefile +++ b/TAO/tao/Makefile @@ -302,6 +302,7 @@ ORB_CORE_FILES += \ RT_Mutex \ RT_Policy_i \ RT_ORB \ + RT_ORB_Loader \ RT_Protocols_Hooks \ Pool_Per_Endpoint \ RTCORBAC \ @@ -10581,9 +10582,8 @@ realclean: Invocation.i ClientRequestInfo.inl DomainC.i Exception.h InterfaceC.h \ ifrfwd.h \ Remote_Object_Proxy_Impl.h \ - ORB_Core.h PortableInterceptor.h \ - PortableInterceptor.i \ - RequestInfo_Util.h + ORB_Core.h PortableInterceptor.h Interceptor_List.h \ + PortableInterceptor.i RequestInfo_Util.h .obj/TimeBaseC.o .obj/TimeBaseC.so .shobj/TimeBaseC.o .shobj/TimeBaseC.so: TimeBaseC.cpp \ TimeBaseC.h \ @@ -15128,6 +15128,131 @@ realclean: Invocation_Endpoint_Selectors.i \ Invocation.i ClientRequestInfo.inl Tagged_Components.h +.obj/RequestInfo_Util.o .obj/RequestInfo_Util.so .shobj/RequestInfo_Util.o .shobj/RequestInfo_Util.so: RequestInfo_Util.cpp RequestInfo_Util.h \ + $(ACE_ROOT)/ace/pre.h corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Base.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Malloc_Allocator.h \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.i \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/CDR_Base.inl \ + try_macros.h \ + orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + varbase.h \ + TAO_Export.h \ + corbafwd.i DynamicC.h \ + corbafwd.h \ + Any.h \ + CDR.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + CDR.i \ + Environment.h \ + Environment.i \ + Object.h \ + Abstract_Servant_Base.h \ + Object_Proxy_Broker.h \ + Object_Proxy_Impl.h \ + Object.i \ + Typecode.h \ + Exception.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + Exception.i \ + Typecode.i \ + Any.i \ + Sequence.h \ + Managed_Types.h \ + Managed_Types.i \ + Sequence.i \ + Sequence_T.h \ + Sequence_T.i \ + Sequence_T.cpp DynamicC.i Any.h \ + StringSeqC.h StringSeqC.i + .obj/PortableInterceptorC.o .obj/PortableInterceptorC.so .shobj/PortableInterceptorC.o .shobj/PortableInterceptorC.so: PortableInterceptorC.cpp \ PortableInterceptorC.h $(ACE_ROOT)/ace/pre.h \ corbafwd.h \ @@ -17702,10 +17827,12 @@ realclean: corbafwd.i \ $(ACE_ROOT)/ace/SString.h \ $(ACE_ROOT)/ace/SString.i \ - ORB.h \ - Exception.h \ - Exception.i \ - Services.h \ + Tagged_Profile.h \ + IOPC.h \ + CDR.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + CDR.i \ Sequence.h \ Managed_Types.h \ Managed_Types.i \ @@ -17713,30 +17840,6 @@ realclean: Sequence_T.h \ Sequence_T.i \ Sequence_T.cpp \ - Services.i \ - CORBA_String.h \ - CORBA_String.inl \ - PolicyC.h \ - CurrentC.h \ - Object.h \ - Abstract_Servant_Base.h \ - Object_Proxy_Broker.h \ - Object_Proxy_Impl.h \ - Object.i \ - CurrentC.i \ - Encodable.h \ - CDR.h \ - $(ACE_ROOT)/ace/CDR_Stream.h \ - $(ACE_ROOT)/ace/CDR_Stream.i \ - CDR.i \ - Typecode.h \ - Typecode.i \ - Environment.h \ - Environment.i \ - PolicyC.i \ - ORB.i \ - Tagged_Profile.h \ - IOPC.h \ IOPC.i \ GIOPC.h \ Object_KeyC.h \ @@ -17747,10 +17850,32 @@ realclean: OctetSeqC.i \ Service_Context.h \ Service_Context.inl \ + Object.h \ + Abstract_Servant_Base.h \ + Object_Proxy_Broker.h \ + Object_Proxy_Impl.h \ + Object.i \ TAO_Server_Request.i \ + Environment.h \ + Environment.i \ Principal.h \ Principal.i \ ORB_Core.h \ + ORB.h \ + Exception.h \ + Exception.i \ + Services.h \ + Services.i \ + CORBA_String.h \ + CORBA_String.inl \ + PolicyC.h \ + CurrentC.h \ + CurrentC.i \ + Encodable.h \ + Typecode.h \ + Typecode.i \ + PolicyC.i \ + ORB.i \ Policy_Manager.h \ LocalObject.h \ LocalObject.i \ @@ -24280,7 +24405,13 @@ realclean: ORB_Core.h \ Stub.i Connector_Registry.h \ params.h \ - Connector_Registry.i + Connector_Registry.i \ + IIOP_Endpoint.h \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/Addr.h \ + $(ACE_ROOT)/ace/Addr.i \ + $(ACE_ROOT)/ace/INET_Addr.i \ + IIOP_Endpoint.i .obj/CORBANAME_Parser.o .obj/CORBANAME_Parser.so .shobj/CORBANAME_Parser.o .shobj/CORBANAME_Parser.so: CORBANAME_Parser.cpp CORBANAME_Parser.h \ $(ACE_ROOT)/ace/pre.h \ @@ -30552,6 +30683,180 @@ realclean: RT_Mutex.h \ RT_Mutex.i +.obj/RT_ORB_Loader.o .obj/RT_ORB_Loader.so .shobj/RT_ORB_Loader.o .shobj/RT_ORB_Loader.so: RT_ORB_Loader.cpp RT_ORB_Loader.h \ + $(ACE_ROOT)/ace/pre.h \ + Object_Loader.h \ + corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Base.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Malloc_Allocator.h \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.i \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/CDR_Base.inl \ + try_macros.h \ + orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + varbase.h \ + TAO_Export.h \ + corbafwd.i \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + Object_Loader.i \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(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 \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h RT_ORB.h \ + RTCORBAS.h \ + IOPS.h \ + IOPC.h \ + CDR.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + CDR.i \ + Sequence.h \ + Managed_Types.h \ + Managed_Types.i \ + Sequence.i \ + Sequence_T.h \ + Sequence_T.i \ + Sequence_T.cpp \ + IOPC.i \ + IOPS_T.h \ + IOPS_T.i \ + IOPS_T.cpp \ + IOPS.i \ + TimeBaseS.h \ + TimeBaseC.h \ + Any.h \ + Environment.h \ + Environment.i \ + Object.h \ + Abstract_Servant_Base.h \ + Object_Proxy_Broker.h \ + Object_Proxy_Impl.h \ + Object.i \ + Typecode.h \ + Exception.h \ + Exception.i \ + Typecode.i \ + Any.i \ + TimeBaseC.i \ + TimeBaseS_T.h \ + TimeBaseS_T.i \ + TimeBaseS_T.cpp \ + TimeBaseS.i \ + RTCORBAC.h \ + PolicyC.h \ + CurrentC.h \ + CurrentC.i \ + Encodable.h \ + PolicyC.i \ + RTCORBAC.i \ + RTCORBAS_T.h \ + RTCORBAS_T.i \ + RTCORBAS_T.cpp \ + RTCORBAS.i \ + LocalObject.h \ + LocalObject.i \ + RT_ORB.i + .obj/RT_Protocols_Hooks.o .obj/RT_Protocols_Hooks.so .shobj/RT_Protocols_Hooks.o .shobj/RT_Protocols_Hooks.so: RT_Protocols_Hooks.cpp RT_Protocols_Hooks.h \ $(ACE_ROOT)/ace/pre.h Protocols_Hooks.h ORB_Core.h \ corbafwd.h $(ACE_ROOT)/ace/CDR_Base.h \ @@ -33409,8 +33714,7 @@ realclean: corbafwd.i \ GIOP_Message_Generator_Parser.inl \ GIOP_Message_Generator_Parser_10.inl \ - GIOP_Utils.h \ - Object.h \ + GIOP_Utils.h Object.h \ Abstract_Servant_Base.h \ Object_Proxy_Broker.h \ Object_Proxy_Impl.h \ @@ -33442,8 +33746,7 @@ realclean: Service_Context.inl \ target_specification.h \ target_specification.i \ - operation_details.i \ - Any.h \ + operation_details.i CDR.h Any.h \ Environment.h \ Environment.i \ Typecode.h \ @@ -33452,27 +33755,13 @@ realclean: $(ACE_ROOT)/ace/SString.i \ Exception.i \ Typecode.i \ - Any.i \ - debug.h \ - OctetSeqC.h \ - OctetSeqC.i \ - Pluggable_Messaging_Utils.h \ + Any.i debug.h OctetSeqC.h \ + OctetSeqC.i Pluggable_Messaging_Utils.h \ Pluggable_Messaging_Utils.i \ - TAO_Server_Request.h \ - ORB.h \ - Services.h \ - Services.i \ - CORBA_String.h \ - CORBA_String.inl \ - PolicyC.h \ - CurrentC.h \ - CurrentC.i \ - Encodable.h \ - PolicyC.i \ - ORB.i \ - TAO_Server_Request.i \ - GIOP_Message_State.h \ - GIOP_Message_State.i + TAO_Server_Request.h corbafwd.h Tagged_Profile.h Service_Context.h \ + Object.h TAO_Server_Request.i GIOP_Message_State.h \ + GIOP_Message_State.i \ + CORBA_String.h CORBA_String.inl .obj/GIOP_Message_Generator_Parser_11.o .obj/GIOP_Message_Generator_Parser_11.so .shobj/GIOP_Message_Generator_Parser_11.o .shobj/GIOP_Message_Generator_Parser_11.so: \ GIOP_Message_Generator_Parser_11.cpp \ @@ -33733,19 +34022,13 @@ realclean: Pluggable_Messaging_Utils.h \ Pluggable_Messaging_Utils.i \ TAO_Server_Request.h \ - ORB.h \ - Services.h \ - Services.i \ - CORBA_String.h \ - CORBA_String.inl \ + TAO_Server_Request.i \ + TAOC.h \ PolicyC.h \ CurrentC.h \ CurrentC.i \ Encodable.h \ PolicyC.i \ - ORB.i \ - TAO_Server_Request.i \ - TAOC.h \ TimeBaseC.h \ TimeBaseC.i \ Priority_Mapping_Manager.h \ @@ -33819,6 +34102,12 @@ realclean: $(ACE_ROOT)/ace/Message_Queue.i \ Pluggable.i \ ORB_Core.h \ + ORB.h \ + Services.h \ + Services.i \ + CORBA_String.h \ + CORBA_String.inl \ + ORB.i \ Policy_Manager.h \ Policy_Manager.i \ Resource_Factory.h \ diff --git a/TAO/tao/ORB.cpp b/TAO/tao/ORB.cpp index 7511b300a63..c080e9251fa 100644 --- a/TAO/tao/ORB.cpp +++ b/TAO/tao/ORB.cpp @@ -519,12 +519,12 @@ CORBA_ORB::resolve_priority_mapping_manager (CORBA::Environment &/*ACE_TRY_ENV*/ } CORBA_Object_ptr -CORBA_ORB::resolve_rt_orb (CORBA::Environment &/*ACE_TRY_ENV*/) +CORBA_ORB::resolve_rt_orb (CORBA::Environment &ACE_TRY_ENV) { #if (TAO_HAS_RT_CORBA == 1) - return this->orb_core_->rt_orb (); + return this->orb_core_->rt_orb (ACE_TRY_ENV); #else diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp index 2be6f14ed1b..ec840ce117f 100644 --- a/TAO/tao/ORB_Core.cpp +++ b/TAO/tao/ORB_Core.cpp @@ -17,11 +17,6 @@ #include "Connector_Registry.h" #include "Acceptor_Registry.h" -#include "RT_ORB.h" -#include "Priority_Mapping_Manager.h" -#include "RT_Current.h" -#include "RT_Policy_i.h" - #include "Sync_Strategies.h" #include "Object_Loader.h" @@ -63,6 +58,7 @@ TAO_default_environment () TAO_ORB_Core::Timeout_Hook TAO_ORB_Core::timeout_hook_ = 0; TAO_ORB_Core::Sync_Scope_Hook TAO_ORB_Core::sync_scope_hook_ = 0; +CORBA::Object_ptr TAO_ORB_Core::priority_mapping_manager_ = 0; const char * TAO_ORB_Core::resource_factory_name_ = "Resource_Factory"; const char *TAO_ORB_Core::protocols_hooks_name_ = "Protocols_Hooks"; const char * TAO_ORB_Core::dynamic_adapter_name_ = "Dynamic_Adapter"; @@ -141,7 +137,7 @@ TAO_ORB_Core::TAO_ORB_Core (const char *orbid) client_priority_policy_selector_ (0), rt_orb_ (0), rt_current_ (0), - priority_mapping_manager_ (0), + // priority_mapping_manager_ (0), #endif /* TAO_HAS_RT_CORBA == 1 */ #if (TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1) eager_buffering_sync_strategy_ (0), @@ -206,19 +202,6 @@ TAO_ORB_Core::TAO_ORB_Core (const char *orbid) ACE_NEW (this->client_priority_policy_selector_, TAO_Client_Priority_Policy_Selector); -#if (TAO_HAS_RT_CORBA == 1) - - ACE_NEW (this->rt_orb_, - TAO_RT_ORB); - - ACE_NEW (this->rt_current_, - TAO_RT_Current (this)); - - ACE_NEW (this->priority_mapping_manager_, - TAO_Priority_Mapping_Manager); - -#endif /* TAO_HAS_RT_CORBA == 1 */ - #endif /* TAO_HAS_CORBA_MESSAGING == 1 */ ACE_NEW (this->default_endpoint_selector_, @@ -262,9 +245,9 @@ TAO_ORB_Core::~TAO_ORB_Core (void) delete this->priority_protocol_selector_; delete this->bands_protocol_selector_; delete this->client_priority_policy_selector_; - delete this->rt_orb_; - delete this->rt_current_; - delete this->priority_mapping_manager_; + // delete this->rt_orb_; + // delete this->rt_current_; + // delete this->priority_mapping_manager_; #endif /* TAO_HAS_RT_CORBA == 1 */ @@ -929,7 +912,11 @@ TAO_ORB_Core::init (int &argc, char *argv[], CORBA::Environment &ACE_TRY_ENV) this->reactor_registry_->open (this); #if (TAO_HAS_RT_CORBA == 1) - this->priority_mapping_manager_->mapping (trf->get_priority_mapping ()); + this->get_protocols_hooks()->set_priority_mapping (this, + trf, + ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); + #endif /* TAO_HAS_RT_CORBA == 1 */ // @@ ???? @@ -1056,7 +1043,7 @@ TAO_ORB_Core::init (int &argc, char *argv[], CORBA::Environment &ACE_TRY_ENV) // registries! // Set ORB-level policy defaults. - if (this->set_default_policies () != 0) + if (this->get_protocols_hooks ()->set_default_policies (this) != 0) ACE_THROW_RETURN (CORBA::INITIALIZE ( CORBA::SystemException::_tao_minor_code ( TAO_ORB_CORE_INIT_LOCATION_CODE, @@ -1939,61 +1926,37 @@ TAO_ORB_Core::open (CORBA::Environment &ACE_TRY_ENV) return 0; } -int -TAO_ORB_Core::set_default_policies (void) -{ #if (TAO_HAS_RT_CORBA == 1) - // Set RTCORBA policy defaults. - // Set RTCORBA::ServerProtocolPolicy and - // RTCORBA::ClientProtocolPolicy defaults to include all protocols - // that were loaded into this ORB. - // First, create a protocol list. - - TAO_ProtocolFactorySet *pfs = this->protocol_factories (); - RTCORBA::ProtocolList protocols; - protocols.length (pfs->size ()); +void +TAO_ORB_Core::resolve_rt_orb_i (CORBA::Environment &ACE_TRY_ENV) +{ + // @@ + TAO_Object_Loader *loader = + ACE_Dynamic_Service<TAO_Object_Loader>::instance ("RT_ORB_Loader"); - int i = 0; - for (TAO_ProtocolFactorySetItor factory = pfs->begin (); - factory != pfs->end (); - ++factory, ++i) + if (loader == 0) { - CORBA::ULong protocol_type = (*factory)->factory ()->tag (); - protocols[i].protocol_type = protocol_type; - protocols[i].orb_protocol_properties = - RTCORBA::ProtocolProperties::_nil (); - // @@ Later, we will likely migrate to using RTCORBA protocol - // policies for configuration of protocols in nonRT use cases. - // Then, the code below will change to each protocol factory - // being responsible for creation of its own default protocol - // properties. - protocols[i].transport_protocol_properties = - TAO_Protocol_Properties_Factory::create_transport_protocol_property - (protocol_type); + // The Loader has not been statically configured, try to + // dynamically load it... + ACE_Service_Config::process_directive ( + "dynamic RT_ORB_Loader Service_Object *" + "TAO:_make_TAO_RT_ORB_Loader()" + ); + + loader = + ACE_Dynamic_Service<TAO_Object_Loader>::instance ("RT_ORB_Loader"); + if (loader == 0) + ACE_THROW (CORBA::ORB::InvalidName ()); } - // Set ServerProtocolPolicy. - TAO_ServerProtocolPolicy *server_protocol_policy = 0; - ACE_NEW_RETURN (server_protocol_policy, - TAO_ServerProtocolPolicy (protocols), - -1); - this->default_policies_->server_protocol (server_protocol_policy); - - // Set ClientProtocolPolicy. - // NOTE: ClientProtocolPolicy default is used ONLY for protocol - // configuration (not protocol preference) IF there is no ORB-level - // override. It is not used when computing effective policy value - // for preferencing protocols. - TAO_ClientProtocolPolicy *client_protocol_policy = 0; - ACE_NEW_RETURN (client_protocol_policy, - TAO_ClientProtocolPolicy (protocols), - -1); - this->default_policies_->client_protocol (client_protocol_policy); + /// Create RT_ORB object. + this->rt_orb_ = + loader->create_object (this->orb_.in (), 0, 0, ACE_TRY_ENV); + +} #endif /* TAO_HAS_RT_CORBA == 1 */ - return 0; -} void TAO_ORB_Core::resolve_typecodefactory_i (CORBA::Environment &ACE_TRY_ENV) @@ -2421,63 +2384,6 @@ TAO_ORB_Core::reactor (TAO_Acceptor *acceptor) return this->reactor_; } -int -TAO_ORB_Core::get_thread_priority (CORBA::Short &priority) -{ -#if (TAO_HAS_RT_CORBA == 0) - priority = 0; - return 0; -#else - ACE_hthread_t current; - ACE_Thread::self (current); - - int native_priority; - if (ACE_Thread::getprio (current, native_priority) == -1) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("TAO (%P|%t) - ORB_Core::get_thread_priority: ") - ACE_TEXT (" ACE_Thread::get_prio\n"))); - return -1; - } - - TAO_Priority_Mapping *priority_mapping = - this->priority_mapping_manager ()->mapping (); - - if (priority_mapping->to_CORBA (native_priority, priority) == 0) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("TAO (%P|%t) - ORB_Core::get_thread_priority: ") - ACE_TEXT (" Priority_Mapping::to_CORBA\n"))); - return -1; - } - - return 0; -#endif /* TAO_HAS_RT_CORBA == 0 */ -} - -int -TAO_ORB_Core::set_thread_priority (CORBA::Short priority) -{ -#if (TAO_HAS_RT_CORBA == 0) - ACE_UNUSED_ARG (priority); - return 0; -#else - TAO_Priority_Mapping *priority_mapping = - this->priority_mapping_manager ()->mapping (); - - CORBA::Short native_priority; - if (priority_mapping->to_native (priority, native_priority) == 0) - return -1; - ACE_hthread_t current; - ACE_Thread::self (current); - - if (ACE_Thread::setprio (current, native_priority) == -1) - return -1; - - return 0; -#endif /* TAO_HAS_RT_CORBA == 0 */ -} - CORBA::Object_ptr TAO_ORB_Core::implrepo_service (void) { @@ -2635,7 +2541,23 @@ TAO_ORB_Core::stubless_relative_roundtrip_timeout (void) } -#if (TAO_HAS_RT_CORBA == 1) +#if (TAO_HAS_RT_CORBA==1) + +CORBA::Object_ptr +TAO_ORB_Core::priority_mapping_manager (void) +{ + if (CORBA::is_nil (TAO_ORB_Core::priority_mapping_manager_)) + return TAO_ORB_Core::priority_mapping_manager_; + else + return CORBA::Object::_nil (); +} + +void +TAO_ORB_Core::priority_mapping_manager (CORBA::Object_ptr manager) +{ + TAO_ORB_Core::priority_mapping_manager_ = + CORBA::Object::_duplicate (manager); +} CORBA::Policy * TAO_ORB_Core::threadpool (void) diff --git a/TAO/tao/ORB_Core.h b/TAO/tao/ORB_Core.h index 77ceab75100..868f3fbefea 100644 --- a/TAO/tao/ORB_Core.h +++ b/TAO/tao/ORB_Core.h @@ -427,6 +427,9 @@ public: /// locking strategies. ACE_Data_Block *create_input_cdr_data_block (size_t size); + /// Accessor method for the default_policies_ + TAO_Policy_Manager_Impl *get_default_policies (void); + /** * The thread has a default environment to simplify porting between * platforms that support native C++ exceptions and those that @@ -551,15 +554,21 @@ public: #if (TAO_HAS_RT_CORBA == 1) /// Access the RTORB. - TAO_RT_ORB *rt_orb (void); + CORBA::Object_ptr rt_orb (CORBA::Environment &ACE_TRY_ENV); /// Access the RT Current. - TAO_RT_Current *rt_current (void); + //@{ + CORBA::Object_ptr rt_current (void); + void rt_current (CORBA::Object_ptr current); + //@} /// Access the priority mapping manager class. This is a TAO /// extension but there is no standard for setting priority mapping /// either. - TAO_Priority_Mapping_Manager *priority_mapping_manager (void); + //@{ + CORBA::Object_ptr priority_mapping_manager (void); + static void priority_mapping_manager (CORBA::Object_ptr manager); + //@} /// Methods for obtaining ORB implementation default values for RT /// policies. @@ -599,17 +608,6 @@ public: // be "RT_Protocols_Hooks". static const char *protocols_hooks_name_; - /** - * Accessor and modifier to the current thread priority, used to - * implement the RTCORBA::Current interface, but it is faster for - * some critical components. If TAO_HAS_RT_CORBA == 0, the - * operations are no-ops. - */ - //@{ - int get_thread_priority (CORBA::Short &priority); - int set_thread_priority (CORBA::Short priority); - //@} - /// Obtain the TSS resources of this orb. TAO_ORB_Core_TSS_Resources* get_tss_resources (void); @@ -884,10 +882,12 @@ protected: ACE_Allocator *input_cdr_buffer_allocator_i (TAO_ORB_Core_TSS_Resources *); //@} - /// Set ORB-level policy defaults for this ORB. Currently sets - /// default RTCORBA policies: ServerProtocolPolicy and - /// ClientProtocolPolicy. - int set_default_policies (void); +#if (TAO_HAS_RT_CORBA == 1) + + /// Obtain and cache the RT_ORB factory object reference + void resolve_rt_orb_i (CORBA::Environment &ACE_TRY_ENV); + +#endif /* TAO_HAS_RT_CORBA == 1 */ /// Obtain and cache the dynamic any factory object reference. void resolve_typecodefactory_i (CORBA::Environment &ACE_TRY_ENV); @@ -1141,13 +1141,13 @@ protected: *client_priority_policy_selector_; /// Implementation of RTCORBA::RTORB interface. - TAO_RT_ORB *rt_orb_; + CORBA::Object_ptr rt_orb_; /// Implementation of RTCORBA::RTCurrent interface. - TAO_RT_Current *rt_current_; + CORBA::Object_ptr rt_current_; /// Manager for setting priority mapping. - TAO_Priority_Mapping_Manager *priority_mapping_manager_; + static CORBA::Object_ptr priority_mapping_manager_; #endif /* TAO_HAS_RT_CORBA == 1 */ diff --git a/TAO/tao/ORB_Core.i b/TAO/tao/ORB_Core.i index 35f1e77cad4..1180c14074c 100644 --- a/TAO/tao/ORB_Core.i +++ b/TAO/tao/ORB_Core.i @@ -589,6 +589,12 @@ TAO_ORB_Core::poa_current (CORBA::Object_ptr current) CORBA::Object::_duplicate (current); } +ACE_INLINE TAO_Policy_Manager_Impl * +TAO_ORB_Core::get_default_policies (void) +{ + return this->default_policies_; +} + ACE_INLINE CORBA_Environment * TAO_ORB_Core::default_environment (void) const { @@ -651,22 +657,28 @@ TAO_ORB_Core::client_priority_policy_selector (void) return this->client_priority_policy_selector_; } -ACE_INLINE TAO_Priority_Mapping_Manager * -TAO_ORB_Core::priority_mapping_manager (void) +ACE_INLINE CORBA::Object_ptr +TAO_ORB_Core::rt_orb (CORBA::Environment &ACE_TRY_ENV) { - return this->priority_mapping_manager_; +if (CORBA::is_nil (this->rt_orb_)) + { + this->resolve_rt_orb_i (ACE_TRY_ENV); + ACE_CHECK_RETURN (CORBA::Object::_nil ()); + } + return CORBA::Object::_duplicate (this->rt_orb_); } -ACE_INLINE TAO_RT_ORB * -TAO_ORB_Core::rt_orb (void) +ACE_INLINE CORBA::Object_ptr +TAO_ORB_Core::rt_current (void) { - return this->rt_orb_; + return CORBA::Object::_duplicate (this->rt_current_); } -ACE_INLINE TAO_RT_Current * -TAO_ORB_Core::rt_current (void) +ACE_INLINE void +TAO_ORB_Core::rt_current (CORBA::Object_ptr current) { - return this->rt_current_; + this->rt_current_ = + CORBA::Object::_duplicate (current); } #endif /* TAO_HAS_RT_CORBA == 1 */ diff --git a/TAO/tao/Pool_Per_Endpoint.cpp b/TAO/tao/Pool_Per_Endpoint.cpp index 4c6d6469211..2481c1308fa 100644 --- a/TAO/tao/Pool_Per_Endpoint.cpp +++ b/TAO/tao/Pool_Per_Endpoint.cpp @@ -43,8 +43,17 @@ TAO_Pool_Per_Endpoint::run (CORBA::Environment &ACE_TRY_ENV) ACE_Sched_Params::priority_min (this->policy_); #if (TAO_HAS_RT_CORBA == 1) + + CORBA::Object_var obj = + this->orb_->orb_core ()->priority_mapping_manager (); + + TAO_Priority_Mapping_Manager_var mapping_manager = + TAO_Priority_Mapping_Manager::_narrow (obj.in (), + ACE_TRY_ENV); + RTCORBA::PriorityMapping *pm = - this->orb_->orb_core ()->priority_mapping_manager ()->mapping (); + mapping_manager.in ()->mapping (); + const CORBA::Short corba_priority = (*i)->priority (); CORBA::Short native_priority; if (pm->to_native (corba_priority, native_priority) == 1) diff --git a/TAO/tao/PortableServer/Makefile b/TAO/tao/PortableServer/Makefile index 199c3cda9df..f08cb54e7f0 100644 --- a/TAO/tao/PortableServer/Makefile +++ b/TAO/tao/PortableServer/Makefile @@ -1458,8 +1458,8 @@ CPPFLAGS += -I$(TAO_ROOT) $(TAO_ROOT)/tao/PortableInterceptor.h \ $(TAO_ROOT)/tao/PortableInterceptor.i \ $(TAO_ROOT)/tao/BiDirPolicyC.h \ - $(TAO_ROOT)/tao/BiDirPolicyC.i \ - $(ACE_ROOT)/ace/Auto_Ptr.h \ + $(TAO_ROOT)/tao/BiDirPolicyC.i ServerRequestInfo.h \ + ServerRequestInfo.inl $(ACE_ROOT)/ace/Auto_Ptr.h \ $(ACE_ROOT)/ace/Auto_Ptr.i \ $(ACE_ROOT)/ace/Auto_Ptr.cpp \ $(TAO_ROOT)/tao/Timeprobe.h \ @@ -3942,9 +3942,9 @@ CPPFLAGS += -I$(TAO_ROOT) $(TAO_ROOT)/tao/DomainC.i Collocated_Object.h \ Collocated_Object.i ServerRequestInfo.h \ $(TAO_ROOT)/tao/OctetSeqC.h \ - $(TAO_ROOT)/tao/OctetSeqC.i DomainS_T.h \ - DomainS_T.i DomainS_T.cpp DomainS.i Object_Adapter.h Key_Adapters.h \ - $(ACE_ROOT)/ace/Map.h \ + $(TAO_ROOT)/tao/OctetSeqC.i ServerRequestInfo.inl \ + DomainS_T.h DomainS_T.i DomainS_T.cpp DomainS.i Object_Adapter.h \ + Key_Adapters.h $(ACE_ROOT)/ace/Map.h \ $(ACE_ROOT)/ace/Map_T.h \ $(ACE_ROOT)/ace/Pair.h \ $(ACE_ROOT)/ace/Pair_T.h \ @@ -3967,7 +3967,8 @@ CPPFLAGS += -I$(TAO_ROOT) $(TAO_ROOT)/tao/Tagged_Profile.i \ $(TAO_ROOT)/tao/TAO_Server_Request.i \ $(TAO_ROOT)/tao/PortableInterceptor.h \ - $(TAO_ROOT)/tao/PortableInterceptor.i + $(TAO_ROOT)/tao/PortableInterceptor.i \ + $(TAO_ROOT)/tao/RequestInfo_Util.h .obj/PolicyS.o .obj/PolicyS.so .shobj/PolicyS.o .shobj/PolicyS.so: PolicyS.cpp POA_CORBA.h \ $(ACE_ROOT)/ace/pre.h \ @@ -4600,7 +4601,17 @@ CPPFLAGS += -I$(TAO_ROOT) $(TAO_ROOT)/tao/StringSeqC.i \ $(TAO_ROOT)/tao/OctetSeqC.h \ $(TAO_ROOT)/tao/OctetSeqC.i \ - portableserver_export.h + portableserver_export.h ServerRequestInfo.inl \ + $(TAO_ROOT)/tao/TAO_Server_Request.h \ + $(TAO_ROOT)/tao/Tagged_Profile.h \ + $(TAO_ROOT)/tao/GIOPC.h \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/GIOPC.i \ + $(TAO_ROOT)/tao/Tagged_Profile.i \ + $(TAO_ROOT)/tao/Service_Context.h \ + $(TAO_ROOT)/tao/Service_Context.inl \ + $(TAO_ROOT)/tao/TAO_Server_Request.i .obj/ImplRepoC.o .obj/ImplRepoC.so .shobj/ImplRepoC.o .shobj/ImplRepoC.so: ImplRepoC.cpp ImplRepoC.h \ $(ACE_ROOT)/ace/pre.h portableserver_export.h \ @@ -5506,9 +5517,11 @@ CPPFLAGS += -I$(TAO_ROOT) $(TAO_ROOT)/tao/StringSeqC.h \ $(TAO_ROOT)/tao/StringSeqC.i \ $(TAO_ROOT)/tao/OctetSeqC.h \ - $(TAO_ROOT)/tao/OctetSeqC.i MessagingS_T.h \ - MessagingS_T.i MessagingS_T.cpp MessagingS.i Operation_Table.h \ - Object_Adapter.h Key_Adapters.h $(ACE_ROOT)/ace/Map.h \ + $(TAO_ROOT)/tao/OctetSeqC.i \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.inl \ + MessagingS_T.h MessagingS_T.i MessagingS_T.cpp MessagingS.i \ + Operation_Table.h Object_Adapter.h Key_Adapters.h \ + $(ACE_ROOT)/ace/Map.h \ $(ACE_ROOT)/ace/Map_T.h \ $(ACE_ROOT)/ace/Pair.h \ $(ACE_ROOT)/ace/Pair_T.h \ diff --git a/TAO/tao/PortableServer/Object_Adapter.cpp b/TAO/tao/PortableServer/Object_Adapter.cpp index 40633ea104f..d13c0ddcad4 100644 --- a/TAO/tao/PortableServer/Object_Adapter.cpp +++ b/TAO/tao/PortableServer/Object_Adapter.cpp @@ -1441,13 +1441,18 @@ TAO_Object_Adapter::Servant_Upcall::poa_cleanup (void) TAO_Object_Adapter::Priority_Model_Processing::~Priority_Model_Processing (void) { + ACE_DECLARE_NEW_CORBA_ENV; + if (this->state_ == PRIORITY_RESET_REQUIRED) { this->state_ = NO_ACTION_REQUIRED; // Reset the priority of the current thread back to its original // value. - if (poa_.orb_core ().set_thread_priority (this->original_priority_) + if (poa_.orb_core ().get_protocols_hooks ()-> + set_thread_priority (&poa_.orb_core (), + this->original_priority_, + ACE_TRY_ENV) == -1) // At this point we cannot throw an exception. Just log the // error. @@ -1471,7 +1476,10 @@ TAO_Object_Adapter::Priority_Model_Processing::pre_invoke ( != TAO_INVALID_PRIORITY) { // Remember current thread's priority. - if (poa_.orb_core ().get_thread_priority (this->original_priority_) + if (poa_.orb_core ().get_protocols_hooks ()-> + get_thread_priority (&poa_.orb_core (), + this->original_priority_, + ACE_TRY_ENV) == -1) ACE_THROW (CORBA::DATA_CONVERSION (1, CORBA::COMPLETED_NO)); @@ -1523,7 +1531,11 @@ TAO_Object_Adapter::Priority_Model_Processing::pre_invoke ( ACE_TEXT (" temporarily changed to %d\n"), original_priority_, target_priority)); - if (poa_.orb_core ().set_thread_priority (target_priority) == -1) + if (poa_.orb_core ().get_protocols_hooks ()-> + set_thread_priority (&poa_.orb_core (), + target_priority, + ACE_TRY_ENV) + == -1) ACE_THROW (CORBA::DATA_CONVERSION (1, CORBA::COMPLETED_NO)); this->state_ = PRIORITY_RESET_REQUIRED; @@ -1547,7 +1559,10 @@ TAO_Object_Adapter::Priority_Model_Processing::post_invoke ( // Reset the priority of the current thread back to its original // value. - if (poa_.orb_core ().set_thread_priority (this->original_priority_) + if (poa_.orb_core ().get_protocols_hooks ()-> + set_thread_priority (&poa_.orb_core (), + this->original_priority_, + ACE_TRY_ENV) == -1) ACE_THROW (CORBA::DATA_CONVERSION (1, CORBA::COMPLETED_NO)); } diff --git a/TAO/tao/Protocols_Hooks.cpp b/TAO/tao/Protocols_Hooks.cpp index 47852fd70e0..24572cd9ccb 100644 --- a/TAO/tao/Protocols_Hooks.cpp +++ b/TAO/tao/Protocols_Hooks.cpp @@ -80,15 +80,6 @@ TAO_Protocols_Hooks:: get_selector_bands_policy_hook ( return; } -void -TAO_Protocols_Hooks::select_endpoint_hook (TAO_GIOP_Invocation *, - CORBA::Policy *, - TAO_Profile *&, - CORBA::Environment &) -{ - return; -} - CORBA::Policy * TAO_Protocols_Hooks::effective_priority_banded_connection_hook (CORBA::Policy *, CORBA::Policy *, @@ -105,6 +96,36 @@ TAO_Protocols_Hooks::effective_client_protocol_hook (CORBA::Policy *, return CORBA::Policy::_nil (); } +int +TAO_Protocols_Hooks::get_thread_priority (TAO_ORB_Core *, + CORBA::Short &, + CORBA::Environment &) +{ + return 0; +} + +int +TAO_Protocols_Hooks::set_thread_priority (TAO_ORB_Core *, + CORBA::Short, + CORBA::Environment &) +{ + return 0; +} + +void +TAO_Protocols_Hooks::set_priority_mapping (TAO_ORB_Core *, + TAO_Resource_Factory *, + CORBA::Environment &) +{ + return; +} + +int +TAO_Protocols_Hooks::set_default_policies (TAO_ORB_Core *) +{ + return 0; +} + #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) template class ACE_Dynamic_Service<TAO_Protocols_Hooks>; diff --git a/TAO/tao/Protocols_Hooks.h b/TAO/tao/Protocols_Hooks.h index d4d24c94fc6..1d00dbc634d 100644 --- a/TAO/tao/Protocols_Hooks.h +++ b/TAO/tao/Protocols_Hooks.h @@ -77,11 +77,6 @@ public: CORBA::Short &p, int &in_range); - virtual void select_endpoint_hook (TAO_GIOP_Invocation *invocation, - CORBA::Policy *client_protocol_policy, - TAO_Profile *&profile, - CORBA::Environment &ACE_TRY_ENV); - /** * Hook to check and override the exposed policies if needed * @@ -93,6 +88,34 @@ public: virtual CORBA::Policy *effective_client_protocol_hook (CORBA::Policy *override, CORBA::Policy *exposed, CORBA::Environment &); + + /** + * Accessor and modifier to the current thread priority, used to + * implement the RTCORBA::Current interface, but it is faster for + * some critical components. If TAO_HAS_RT_CORBA == 0, the + * operations are no-ops. + */ + //@{ + virtual int get_thread_priority (TAO_ORB_Core *, + CORBA::Short &, + CORBA::Environment &); + + virtual int set_thread_priority (TAO_ORB_Core *, + CORBA::Short, + CORBA::Environment &); + + //@} + + virtual void set_priority_mapping (TAO_ORB_Core *, + TAO_Resource_Factory *, + CORBA::Environment &); + + /// Sets the default_policies for ORB. + /// 1. Sets ORB-level policy defaults for this ORB. Currently sets + /// default RTCORBA policies: ServerProtocolPolicy and + /// ClientProtocolPolicy. + virtual int set_default_policies (TAO_ORB_Core *orb_core); + }; #include "ace/post.h" diff --git a/TAO/tao/RT_Current.cpp b/TAO/tao/RT_Current.cpp index 34c481e1591..e9b22f7a0b7 100644 --- a/TAO/tao/RT_Current.cpp +++ b/TAO/tao/RT_Current.cpp @@ -32,7 +32,11 @@ TAO_RT_Current::the_priority (CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) { RTCORBA::Priority priority; - if (this->orb_core_->get_thread_priority (priority) == -1) + if (this->orb_core_->get_protocols_hooks ()-> + get_thread_priority (this->orb_core_, + priority, + ACE_TRY_ENV) + == -1) ACE_THROW_RETURN (CORBA::DATA_CONVERSION (1, CORBA::COMPLETED_NO), -1); return priority; @@ -43,7 +47,11 @@ TAO_RT_Current::the_priority (RTCORBA::Priority the_priority, CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) { - if (this->orb_core_->set_thread_priority (the_priority) == -1) + if (this->orb_core_->get_protocols_hooks () + ->set_thread_priority (this->orb_core_, + the_priority, + ACE_TRY_ENV) + == -1) ACE_THROW (CORBA::DATA_CONVERSION (1, CORBA::COMPLETED_NO)); } diff --git a/TAO/tao/RT_ORBInitializer.cpp b/TAO/tao/RT_ORBInitializer.cpp index 240d58ee0a1..849e6333a3a 100644 --- a/TAO/tao/RT_ORBInitializer.cpp +++ b/TAO/tao/RT_ORBInitializer.cpp @@ -12,6 +12,7 @@ ACE_RCSID (tao, RT_ORBInitializer, "$Id$") #include "tao/RTCORBAC.h" #include "tao/RT_Policy_i.h" #include "tao/RT_Protocols_Hooks.h" +#include "tao/Priority_Mapping_Manager.h" #include "tao/Exception.h" #include "tao/ORB_Core.h" @@ -24,6 +25,10 @@ TAO_RT_ORBInitializer::pre_init ( // Sets the name of the Protocol_Hooks to be the RT_Protocols_Hooks. TAO_ORB_Core::set_protocols_hooks ("RT_Protocols_Hooks"); + // Set the Priority_Mapping_Manager + TAO_Priority_Mapping_Manager *manager = new TAO_Priority_Mapping_Manager; + TAO_ORB_Core::priority_mapping_manager (manager); + // Sets the client_protocol policy. TAO_RT_Protocols_Hooks::set_client_protocols_hook (TAO_ClientProtocolPolicy::hook); diff --git a/TAO/tao/RT_Protocols_Hooks.cpp b/TAO/tao/RT_Protocols_Hooks.cpp index 20f4af083ab..9b9cd30cae1 100644 --- a/TAO/tao/RT_Protocols_Hooks.cpp +++ b/TAO/tao/RT_Protocols_Hooks.cpp @@ -6,6 +6,7 @@ #include "tao/Invocation.h" #include "tao/Stub.h" #include "tao/MProfile.h" +#include "tao/Priority_Mapping_Manager.h" #include "ace/Dynamic_Service.h" @@ -112,10 +113,6 @@ TAO_RT_Protocols_Hooks::validate_policy_type (CORBA::ULong type, { // Validity check. Make sure requested policy type is appropriate // for this scope. - if (type == RTCORBA::THREADPOOL_POLICY_TYPE - || type == RTCORBA::SERVER_PROTOCOL_POLICY_TYPE) - ACE_THROW (CORBA::INV_POLICY ()); - if (type == RTCORBA::PRIORITY_MODEL_POLICY_TYPE) type_value = 0; @@ -124,97 +121,13 @@ TAO_RT_Protocols_Hooks::validate_policy_type (CORBA::ULong type, if (type == RTCORBA::CLIENT_PROTOCOL_POLICY_TYPE) type_value = 2; -} -CORBA::Policy * -TAO_RT_Protocols_Hooks::effective_priority_banded_connection_hook (CORBA::Policy *override, - CORBA::Policy *exposed, - CORBA::Environment &ACE_TRY_ENV) -{ - RTCORBA::PriorityBandedConnectionPolicy_var override_policy_ptr = - RTCORBA::PriorityBandedConnectionPolicy::_narrow (override, - ACE_TRY_ENV); - ACE_CHECK_RETURN (CORBA::Policy::_nil ()); - - TAO_PriorityBandedConnectionPolicy *override_policy = - ACE_static_cast (TAO_PriorityBandedConnectionPolicy *, - override_policy_ptr.in ()); - - RTCORBA::PriorityBandedConnectionPolicy_var exposed_policy_ptr = - RTCORBA::PriorityBandedConnectionPolicy::_narrow (exposed, - ACE_TRY_ENV); - ACE_CHECK_RETURN (CORBA::Policy::_nil ()); - - TAO_PriorityBandedConnectionPolicy *exposed_policy = - ACE_static_cast (TAO_PriorityBandedConnectionPolicy *, - exposed_policy_ptr.in ()); - - // Both override and exposed have been set. - // See if either of them has empty priority bands. - CORBA::Object_var auto_release_exp = exposed_policy; - CORBA::Object_var auto_release_ov = override_policy; - - if (exposed_policy->priority_bands_rep ().length () == 0) - { - auto_release_ov._retn (); - return override; - } - - if (override_policy->priority_bands_rep ().length () == 0) - { - auto_release_exp._retn (); - return exposed; - } - - // Both override and exposed have been set and neither has empty - // priority bands. This is illegal (ptc/99-05-03, sec. 4.12.1). - ACE_THROW_RETURN (CORBA::INV_POLICY (), - 0); -} - -CORBA::Policy * -TAO_RT_Protocols_Hooks::effective_client_protocol_hook ( - CORBA::Policy_ptr override, - CORBA::Policy_ptr exposed, - CORBA::Environment &ACE_TRY_ENV) -{ - RTCORBA::ClientProtocolPolicy_var override_policy_var = - RTCORBA::ClientProtocolPolicy::_narrow (override, - ACE_TRY_ENV); - ACE_CHECK_RETURN (CORBA::Policy::_nil ()); - - TAO_ClientProtocolPolicy *override_policy = - ACE_static_cast (TAO_ClientProtocolPolicy *, - override_policy_var.in ()); - - RTCORBA::ClientProtocolPolicy_var exposed_policy_var = - RTCORBA::ClientProtocolPolicy::_narrow (exposed, - ACE_TRY_ENV); - ACE_CHECK_RETURN (CORBA::Policy::_nil ()); - - TAO_ClientProtocolPolicy *exposed_policy = - ACE_static_cast (TAO_ClientProtocolPolicy *, - exposed_policy_var.in ()); - - // Both override and exposed have been set. - // See if either of them has empty priority bands. - RTCORBA::ProtocolList &protocols_rep_var = - exposed_policy->protocols_rep (); - - if (protocols_rep_var.length () == 0) - { - return override; - } - - if (override_policy->protocols_rep ().length () == 0) + if (type == RTCORBA::THREADPOOL_POLICY_TYPE + || type == RTCORBA::SERVER_PROTOCOL_POLICY_TYPE) { - return exposed; + type_value = 3; + ACE_THROW (CORBA::INV_POLICY ()); } - - // Both override and exposed have been set and neither has empty - // protocols. This is illegal (ptc/99-05-03, sec. 4.15.4). - ACE_THROW_RETURN (CORBA::INV_POLICY (), - 0); } void @@ -332,69 +245,237 @@ TAO_RT_Protocols_Hooks::get_selector_bands_policy_hook ( return; } -void -TAO_RT_Protocols_Hooks::select_endpoint_hook ( - TAO_GIOP_Invocation *invocation, - CORBA::Policy *client_protocol_policy, - TAO_Profile *& profile, - CORBA::Environment &ACE_TRY_ENV) +CORBA::Policy * +TAO_RT_Protocols_Hooks::effective_priority_banded_connection_hook (CORBA::Policy *override, + CORBA::Policy *exposed, + CORBA::Environment &ACE_TRY_ENV) { - RTCORBA::ClientProtocolPolicy_var cp_policy = - RTCORBA::ClientProtocolPolicy::_narrow (client_protocol_policy, + RTCORBA::PriorityBandedConnectionPolicy_var override_policy_ptr = + RTCORBA::PriorityBandedConnectionPolicy::_narrow (override, + ACE_TRY_ENV); + ACE_CHECK_RETURN (CORBA::Policy::_nil ()); + + TAO_PriorityBandedConnectionPolicy *override_policy = + ACE_static_cast (TAO_PriorityBandedConnectionPolicy *, + override_policy_ptr.in ()); + + RTCORBA::PriorityBandedConnectionPolicy_var exposed_policy_ptr = + RTCORBA::PriorityBandedConnectionPolicy::_narrow (exposed, + ACE_TRY_ENV); + ACE_CHECK_RETURN (CORBA::Policy::_nil ()); + + TAO_PriorityBandedConnectionPolicy *exposed_policy = + ACE_static_cast (TAO_PriorityBandedConnectionPolicy *, + exposed_policy_ptr.in ()); + + // Both override and exposed have been set. + // See if either of them has empty priority bands. + CORBA::Object_var auto_release_exp = exposed_policy; + CORBA::Object_var auto_release_ov = override_policy; + + if (exposed_policy->priority_bands_rep ().length () == 0) + { + auto_release_ov._retn (); + return override; + } + + if (override_policy->priority_bands_rep ().length () == 0) + { + auto_release_exp._retn (); + return exposed; + } + + // Both override and exposed have been set and neither has empty + // priority bands. This is illegal (ptc/99-05-03, sec. 4.12.1). + ACE_THROW_RETURN (CORBA::INV_POLICY (), + 0); +} + +CORBA::Policy * +TAO_RT_Protocols_Hooks::effective_client_protocol_hook ( + CORBA::Policy_ptr override, + CORBA::Policy_ptr exposed, + CORBA::Environment &ACE_TRY_ENV) +{ + RTCORBA::ClientProtocolPolicy_var override_policy_var = + RTCORBA::ClientProtocolPolicy::_narrow (override, ACE_TRY_ENV); - ACE_CHECK; + ACE_CHECK_RETURN (CORBA::Policy::_nil ()); - TAO_ClientProtocolPolicy *client_protocol = + TAO_ClientProtocolPolicy *override_policy = ACE_static_cast (TAO_ClientProtocolPolicy *, - cp_policy.in ()); + override_policy_var.in ()); + + RTCORBA::ClientProtocolPolicy_var exposed_policy_var = + RTCORBA::ClientProtocolPolicy::_narrow (exposed, + ACE_TRY_ENV); + ACE_CHECK_RETURN (CORBA::Policy::_nil ()); - RTCORBA::ProtocolList & protocols = - client_protocol->protocols_rep (); + TAO_ClientProtocolPolicy *exposed_policy = + ACE_static_cast (TAO_ClientProtocolPolicy *, + exposed_policy_var.in ()); - CORBA::ULong protocol_index = - invocation->get_endpoint_selection_state ().client_protocol_index_; + // Both override and exposed have been set. + // See if either of them has empty priority bands. + RTCORBA::ProtocolList &protocols_rep_var = + exposed_policy->protocols_rep (); - if (protocols.length () == protocol_index) - // We have tried all the protocols specified in the client - // protocol policy with no success. Throw exception. + if (protocols_rep_var.length () == 0) { - // Figure out proper exception. - if (!invocation->get_endpoint_selection_state ().valid_endpoint_found_) - { - if (invocation->get_inconsistent_policies ()) - { - invocation->get_inconsistent_policies ()->length (1); - CORBA::PolicyList_var inconsistent_policies = - invocation->get_inconsistent_policies (); - inconsistent_policies [0u] = - CORBA::Policy::_duplicate (invocation-> - get_endpoint_selection_state ().client_protocol_policy_); - } - ACE_THROW (CORBA::INV_POLICY ()); - } - else - // At least one satisfactory endpoint was found, but - // connection could not be established. - ACE_THROW (CORBA::COMM_FAILURE ()); + return override; + } + + if (override_policy->protocols_rep ().length () == 0) + { + return exposed; } - // Find a Profile for the next protocol we would like to try. - TAO_MProfile& mprofile = invocation->get_stub ()->base_profiles (); + // Both override and exposed have been set and neither has empty + // protocols. This is illegal (ptc/99-05-03, sec. 4.15.4). + ACE_THROW_RETURN (CORBA::INV_POLICY (), + 0); +} + +int +TAO_RT_Protocols_Hooks::get_thread_priority (TAO_ORB_Core *orb_core, + CORBA::Short &priority, + CORBA::Environment &ACE_TRY_ENV) +{ + ACE_hthread_t current; + ACE_Thread::self (current); - for (TAO_PHandle i = 0; - i < mprofile.profile_count (); - ++i) + int native_priority; + if (ACE_Thread::getprio (current, native_priority) == -1) { - TAO_Profile *pf = mprofile.get_profile (i); - if (pf->tag () - == protocols[protocol_index].protocol_type) - { - profile = pf; - break; - } + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO (%P|%t) - RT_Protocols_Hooks::get_thread_priority: ") + ACE_TEXT (" ACE_Thread::get_prio\n"))); + return -1; } - return; + CORBA::Object_var obj = + orb_core->priority_mapping_manager (); + + TAO_Priority_Mapping_Manager_var mapping_manager = + TAO_Priority_Mapping_Manager::_narrow (obj.in (), + ACE_TRY_ENV); + + TAO_Priority_Mapping *priority_mapping = + mapping_manager.in ()->mapping (); + + if (priority_mapping->to_CORBA (native_priority, priority) == 0) + { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO (%P|%t) - RT_Protocols_Hooks::get_thread_priority: ") + ACE_TEXT (" Priority_Mapping::to_CORBA\n"))); + return -1; + } + + return 0; +} + +int +TAO_RT_Protocols_Hooks::set_thread_priority (TAO_ORB_Core *orb_core, + CORBA::Short priority, + CORBA::Environment &ACE_TRY_ENV) +{ + CORBA::Object_var obj = + orb_core->priority_mapping_manager (); + + TAO_Priority_Mapping_Manager_var mapping_manager = + TAO_Priority_Mapping_Manager::_narrow (obj.in (), + ACE_TRY_ENV); + + TAO_Priority_Mapping *priority_mapping = + mapping_manager.in ()->mapping (); + + CORBA::Short native_priority; + if (priority_mapping->to_native (priority, native_priority) == 0) + return -1; + ACE_hthread_t current; + ACE_Thread::self (current); + + if (ACE_Thread::setprio (current, native_priority) == -1) + return -1; + + return 0; +} + +void +TAO_RT_Protocols_Hooks::set_priority_mapping (TAO_ORB_Core *orb_core, + TAO_Resource_Factory + *trf, + CORBA::Environment &ACE_TRY_ENV) +{ + /// + CORBA::Object_var obj = + orb_core->priority_mapping_manager (); + + /// Narrow it down correctly + TAO_Priority_Mapping_Manager_var priority_mapping_manager = + TAO_Priority_Mapping_Manager::_narrow (obj.in (), + ACE_TRY_ENV); + ACE_CHECK; + + if (!CORBA::is_nil (priority_mapping_manager.in ())) + priority_mapping_manager->mapping (trf->get_priority_mapping ()); +} + +int +TAO_RT_Protocols_Hooks::set_default_policies (TAO_ORB_Core *orb_core) +{ +#if (TAO_HAS_RT_CORBA == 1) + // Set RTCORBA policy defaults. + // Set RTCORBA::ServerProtocolPolicy and + // RTCORBA::ClientProtocolPolicy defaults to include all protocols + // that were loaded into this ORB. + // First, create a protocol list. + + TAO_ProtocolFactorySet *pfs = orb_core->protocol_factories (); + + RTCORBA::ProtocolList protocols; + protocols.length (pfs->size ()); + + int i = 0; + for (TAO_ProtocolFactorySetItor factory = pfs->begin (); + factory != pfs->end (); + ++factory, ++i) + { + CORBA::ULong protocol_type = (*factory)->factory ()->tag (); + protocols[i].protocol_type = protocol_type; + protocols[i].orb_protocol_properties = + RTCORBA::ProtocolProperties::_nil (); + // @@ Later, we will likely migrate to using RTCORBA protocol + // policies for configuration of protocols in nonRT use cases. + // Then, the code below will change to each protocol factory + // being responsible for creation of its own default protocol + // properties. + protocols[i].transport_protocol_properties = + TAO_Protocol_Properties_Factory::create_transport_protocol_property + (protocol_type); + } + + // Set ServerProtocolPolicy. + TAO_ServerProtocolPolicy *server_protocol_policy = 0; + ACE_NEW_RETURN (server_protocol_policy, + TAO_ServerProtocolPolicy (protocols), + -1); + orb_core->get_default_policies ()->server_protocol (server_protocol_policy); + + // Set ClientProtocolPolicy. + // NOTE: ClientProtocolPolicy default is used ONLY for protocol + // configuration (not protocol preference) IF there is no ORB-level + // override. It is not used when computing effective policy value + // for preferencing protocols. + TAO_ClientProtocolPolicy *client_protocol_policy = 0; + ACE_NEW_RETURN (client_protocol_policy, + TAO_ClientProtocolPolicy (protocols), + -1); + orb_core->get_default_policies ()->client_protocol (client_protocol_policy); + +#endif /* TAO_HAS_RT_CORBA == 1 */ + + return 0; } ACE_STATIC_SVC_DEFINE (TAO_RT_Protocols_Hooks, diff --git a/TAO/tao/RT_Protocols_Hooks.h b/TAO/tao/RT_Protocols_Hooks.h index 9998d017986..693199a6ca4 100644 --- a/TAO/tao/RT_Protocols_Hooks.h +++ b/TAO/tao/RT_Protocols_Hooks.h @@ -110,10 +110,6 @@ public: CORBA::Short &p, int &in_range); - virtual void select_endpoint_hook (TAO_GIOP_Invocation *invocation, - CORBA::Policy *client_protocol_policy, - TAO_Profile *&profile, - CORBA::Environment &ACE_TRY_ENV); /** * Hook to check and override the exposed policies if needed @@ -126,6 +122,31 @@ public: virtual CORBA::Policy *effective_client_protocol_hook (CORBA::Policy *override, CORBA::Policy *exposed, CORBA::Environment &); + + /** + * Accessor and modifier to the current thread priority, used to + * implement the RTCORBA::Current interface, but it is faster for + * some critical components. If TAO_HAS_RT_CORBA == 0, the + * operations are no-ops. + */ + //@{ + virtual int get_thread_priority (TAO_ORB_Core *orb_core, + CORBA::Short &priority, + CORBA::Environment &ACE_TRY_ENV); + + virtual int set_thread_priority (TAO_ORB_Core *orb_core, + CORBA::Short priority, + CORBA::Environment &ACE_TRY_ENV); + //@} + + virtual void set_priority_mapping (TAO_ORB_Core *orb_core, + TAO_Resource_Factory *trf, + CORBA::Environment &ACE_TRY_ENV); + + /// 1. Sets ORB-level policy defaults for this ORB. Currently sets + /// default RTCORBA policies: ServerProtocolPolicy and + /// ClientProtocolPolicy. + virtual int set_default_policies (TAO_ORB_Core *orb_core); }; #if defined (__ACE_INLINE__) diff --git a/TAO/tao/Strategies/Reactor_Per_Priority.cpp b/TAO/tao/Strategies/Reactor_Per_Priority.cpp index 5acf4502738..44713d6bd1f 100644 --- a/TAO/tao/Strategies/Reactor_Per_Priority.cpp +++ b/TAO/tao/Strategies/Reactor_Per_Priority.cpp @@ -27,6 +27,8 @@ TAO_Reactor_Per_Priority::~TAO_Reactor_Per_Priority (void) ACE_Reactor * TAO_Reactor_Per_Priority::reactor (void) { + ACE_DECLARE_NEW_CORBA_ENV; + TAO_ORB_Core_TSS_Resources *tss = this->orb_core ()->get_tss_resources (); @@ -38,7 +40,11 @@ TAO_Reactor_Per_Priority::reactor (void) return leader_follower->reactor (); CORBA::Short priority = 0; - if (this->orb_core ()->get_thread_priority (priority) == -1) + if (this->orb_core ()->get_protocols_hooks ()-> + get_thread_priority (this->orb_core (), + priority, + ACE_TRY_ENV) + == -1) { if (TAO_debug_level > 3) ACE_DEBUG ((LM_DEBUG, @@ -67,6 +73,8 @@ TAO_Reactor_Per_Priority::reactor (TAO_Acceptor *acceptor) TAO_Leader_Follower & TAO_Reactor_Per_Priority::leader_follower (void) { + ACE_DECLARE_NEW_CORBA_ENV; + TAO_ORB_Core_TSS_Resources *tss = this->orb_core ()->get_tss_resources (); @@ -78,7 +86,11 @@ TAO_Reactor_Per_Priority::leader_follower (void) return *leader_follower; CORBA::Short priority = 0; - if (this->orb_core ()->get_thread_priority (priority) == -1) + if (this->orb_core ()->get_protocols_hooks ()-> + get_thread_priority (this->orb_core (), + priority, + ACE_TRY_ENV) + == -1) return *leader_follower; return *this->leader_follower_i (priority); diff --git a/TAO/tao/Stub.cpp b/TAO/tao/Stub.cpp index fab6f62430c..4982c929be5 100644 --- a/TAO/tao/Stub.cpp +++ b/TAO/tao/Stub.cpp @@ -564,19 +564,19 @@ TAO_Stub::set_policy_overrides (const CORBA::PolicyList & policies, CORBA::ULong type_value = 0; - // @@ Throws CORBA::NO_PERMISSION as of now. - // Not sure if this is right .. since validate_policy_type - // throws a INV_Policy exception and am throwing - // NO_PERMISSION exception now. + // @@ Not sure if this is right. + // This method was throwing CORBA::NO_PERMISSION when the + // if statements (which are now in the validate_policy_type + // hook) were true. I am using the same hook method + // for two other methods which need to throw + // CORBA::INV_Policy (). So, in here, I am not checking the + // CORBA::Environment variable, but checking on the value of + // type_value to throw the right exception. - Priyanka this->orb_core_->get_protocols_hooks ()->validate_policy_type (slot, type_value, ACE_TRY_ENV); - ACE_THROW_RETURN (CORBA::NO_PERMISSION (), - 0); - - if (type_value == 0) - ACE_THROW_RETURN (CORBA::NO_PERMISSION (), - 0); + if (type_value == 0 | type_value == 3) + ACE_THROW_RETURN (CORBA::NO_PERMISSION (), 0); } // We are not required to check for consistency of <policies> with @@ -973,16 +973,14 @@ TAO_Stub::effective_priority_banded_connection (CORBA::Environment &ACE_TRY_ENV) if (override == 0) return exposed; - CORBA::Policy *policy = + CORBA::Policy_var policy = this->orb_core_->get_protocols_hooks ()-> - effective_priority_banded_connection_hook ( - override, + effective_priority_banded_connection_hook (override, exposed, ACE_TRY_ENV); - ACE_THROW_RETURN (CORBA::INV_POLICY (), - 0); + ACE_CHECK_RETURN (CORBA::Policy::_nil ()); - return policy; + return policy.in (); } CORBA::Policy * @@ -1008,8 +1006,12 @@ TAO_Stub::effective_client_protocol (CORBA::Environment &ACE_TRY_ENV) override.in (), exposed.in (), ACE_TRY_ENV); - ACE_THROW_RETURN (CORBA::INV_POLICY (), - 0); + ACE_CHECK_RETURN (0); + + /*if ( + ACE_CHECK_RETURN (CORBA::INV_POLICY (), + CORBA::Policy::_nil ()); + */ return policy.in (); } |