#include "tao/Object.h"#include "tao/Stub.h"#include "tao/Profile.h"#include "tao/ORB_Core.h"#include "tao/Connector_Registry.h"#include "tao/LocateRequest_Invocation_Adapter.h"#include "tao/debug.h"#include "tao/Dynamic_Adapter.h"#include "tao/IFR_Client_Adapter.h"#include "tao/Remote_Object_Proxy_Broker.h"#include "tao/CDR.h"#include "tao/SystemException.h"#include "tao/PolicyC.h"#include "ace/Dynamic_Service.h"#include "ace/OS_NS_string.h"Include dependency graph for Object.cpp:

Go to the source code of this file.
Namespaces | |
| namespace | TAO |
Defines | |
| #define | TAO_OBJECT_IOR_EVALUATE |
| #define | TAO_OBJECT_IOR_EVALUATE_RETURN |
Functions | |
| CORBA::Boolean | operator<< (TAO_OutputCDR &cdr, const CORBA::Object *x) |
| CORBA::Boolean | operator>> (TAO_InputCDR &cdr, CORBA::Object *&x) |
Variables | |
| TAO::Object_Proxy_Broker *(* | _TAO_Object_Proxy_Broker_Factory_function_pointer )(void)=0 |
|
|
Value: if (!this->is_evaluated_) \ { \ ACE_GUARD (ACE_Lock , mon, *this->refcount_lock_); \ CORBA::Object::tao_object_initialize (this); \ } Definition at line 92 of file Object.cpp. Referenced by CORBA::Object::_create_request(). |
|
|
Value: if (!this->is_evaluated_) \ { \ ACE_GUARD_RETURN (ACE_Lock , mon, *this->refcount_lock_, 0); \ if (!this->is_evaluated_) \ CORBA::Object::tao_object_initialize (this); \ } Definition at line 99 of file Object.cpp. Referenced by CORBA::Object::_get_cached_policy(), CORBA::Object::_get_component(), CORBA::Object::_get_interface(), CORBA::Object::_get_orb(), CORBA::Object::_get_policy(), CORBA::Object::_get_policy_overrides(), CORBA::Object::_hash(), CORBA::Object::_is_a(), CORBA::Object::_is_equivalent(), CORBA::Object::_key(), CORBA::Object::_non_existent(), CORBA::Object::_repository_id(), CORBA::Object::_request(), CORBA::Object::_set_policy_overrides(), CORBA::Object::_stubobj(), and CORBA::Object::_validate_connection(). |
|
||||||||||||
|
Definition at line 709 of file Object.cpp.
00710 {
00711 if (x == 0)
00712 {
00713 // NIL objrefs ... marshal as empty type hint, no elements.
00714 cdr.write_ulong (1);
00715 cdr.write_char ('\0');
00716 cdr.write_ulong (0);
00717 return (CORBA::Boolean) cdr.good_bit ();
00718 }
00719
00720 if (!x->is_evaluated ())
00721 {
00722 // @@ This is too inefficient. Need to speed this up if this is
00723 // a bottle neck.
00724 cdr << const_cast<IOP::IOR &> (x->ior ());
00725 return cdr.good_bit ();
00726 }
00727
00728 TAO_Stub *stubobj = x->_stubobj ();
00729
00730 if (stubobj == 0)
00731 return false;
00732
00733 return (stubobj->marshal (cdr));
00734 }
|
|
||||||||||||
|
Definition at line 850 of file Object.cpp.
00851 {
00852 bool lazy_strategy = false;
00853 TAO_ORB_Core *orb_core = cdr.orb_core ();
00854
00855 if (orb_core == 0)
00856 {
00857 orb_core = TAO_ORB_Core_instance ();
00858 if (TAO_debug_level > 0)
00859 {
00860 ACE_DEBUG ((LM_WARNING,
00861 ACE_TEXT ("TAO (%P|%t) WARNING: extracting object from ")
00862 ACE_TEXT ("default ORB_Core\n")));
00863 }
00864 }
00865 else
00866 {
00867 if (orb_core->resource_factory ()->resource_usage_strategy () ==
00868 TAO_Resource_Factory::TAO_LAZY)
00869 lazy_strategy = true;
00870 }
00871
00872 if (!lazy_strategy)
00873 {
00874 // If the user has set up a eager strategy..
00875 CORBA::String_var type_hint;
00876
00877 if ((cdr >> type_hint.inout ()) == 0)
00878 return 0;
00879
00880 CORBA::ULong profile_count;
00881 if ((cdr >> profile_count) == 0)
00882 return 0;
00883
00884 if (profile_count == 0)
00885 {
00886 x = CORBA::Object::_nil ();
00887 return (CORBA::Boolean) cdr.good_bit ();
00888 }
00889
00890 // get a profile container to store all profiles in the IOR.
00891 TAO_MProfile mp (profile_count);
00892
00893 TAO_ORB_Core *orb_core = cdr.orb_core ();
00894 if (orb_core == 0)
00895 {
00896 orb_core = TAO_ORB_Core_instance ();
00897 if (TAO_debug_level > 0)
00898 {
00899 ACE_DEBUG ((LM_WARNING,
00900 ACE_TEXT ("TAO (%P|%t) - Object::tao_object_initialize ")
00901 ACE_TEXT ("WARNING: extracting object from ")
00902 ACE_TEXT ("default ORB_Core\n")));
00903 }
00904 }
00905
00906 // Ownership of type_hint is given to TAO_Stub
00907 // TAO_Stub will make a copy of mp!
00908
00909 TAO_Stub *objdata = 0;
00910
00911 ACE_DECLARE_NEW_CORBA_ENV;
00912 ACE_TRY
00913 {
00914 TAO_Connector_Registry *connector_registry =
00915 orb_core->connector_registry (ACE_ENV_SINGLE_ARG_PARAMETER);
00916 ACE_TRY_CHECK;
00917
00918 for (CORBA::ULong i = 0; i != profile_count && cdr.good_bit (); ++i)
00919 {
00920 TAO_Profile *pfile =
00921 connector_registry->create_profile (cdr);
00922 if (pfile != 0)
00923 mp.give_profile (pfile);
00924 }
00925
00926 // Make sure we got some profiles!
00927 if (mp.profile_count () != profile_count)
00928 {
00929 // @@ This occurs when profile creation fails when decoding the
00930 // profile from the IOR.
00931 ACE_ERROR_RETURN ((LM_ERROR,
00932 ACE_TEXT ("TAO (%P|%t) ERROR: Could not create all ")
00933 ACE_TEXT ("profiles while extracting object\n")
00934 ACE_TEXT ("TAO (%P|%t) ERROR: reference from the ")
00935 ACE_TEXT ("CDR stream.\n")),
00936 0);
00937 }
00938
00939
00940 objdata = orb_core->create_stub (type_hint.in (),
00941 mp
00942 ACE_ENV_ARG_PARAMETER);
00943 ACE_TRY_CHECK;
00944 }
00945 ACE_CATCHANY
00946 {
00947 if (TAO_debug_level > 0)
00948 ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
00949 ACE_TEXT ("TAO - ERROR creating stub ")
00950 ACE_TEXT ("object when demarshaling object ")
00951 ACE_TEXT ("reference.\n"));
00952
00953 return 0;
00954 }
00955 ACE_ENDTRY;
00956 ACE_CHECK_RETURN (0);
00957
00958 TAO_Stub_Auto_Ptr safe_objdata (objdata);
00959
00960 x = orb_core->create_object (safe_objdata.get ());
00961 if (x == 0)
00962 return 0;
00963
00964 // Transfer ownership to the CORBA::Object
00965 (void) safe_objdata.release ();
00966 }
00967 else
00968 {
00969 // Lazy strategy!
00970 IOP::IOR *ior = 0;
00971
00972 ACE_NEW_RETURN (ior,
00973 IOP::IOR (),
00974 0);
00975
00976 cdr >> *ior;
00977 ACE_NEW_RETURN (x,
00978 CORBA::Object (ior,
00979 orb_core),
00980 0);
00981 }
00982
00983 return (CORBA::Boolean) cdr.good_bit ();
00984 }
|
|
|
This function pointer is set only when the Portable server library is present. Definition at line 1018 of file Object.cpp. Referenced by TAO_Stub::is_collocated(). |
1.3.6