Implementation of a CORBA object reference. More...
#include <Object.h>


Public Types | |
| typedef Object_ptr | _ptr_type |
| typedef Object_var | _var_type |
| typedef Object_out | _out_type |
Public Member Functions | |
| virtual | ~Object (void) |
| Destructor. | |
| virtual TAO_Abstract_ServantBase * | _servant (void) const |
| virtual CORBA::Boolean | _is_collocated (void) const |
| virtual CORBA::Boolean | _is_local (void) const |
| Is this a local object? | |
| virtual TAO::ObjectKey * | _key (void) |
| Object (TAO_Stub *p, CORBA::Boolean collocated=false, TAO_Abstract_ServantBase *servant=0, TAO_ORB_Core *orb_core=0) | |
| Constructor. | |
| Object (IOP::IOR *ior, TAO_ORB_Core *orb_core) | |
| virtual TAO_Stub * | _stubobj (void) const |
| Get the underlying stub object. | |
| virtual TAO_Stub * | _stubobj (void) |
| virtual void | _proxy_broker (TAO::Object_Proxy_Broker *proxy_broker) |
| Set the proxy broker. | |
| virtual CORBA::Boolean | marshal (TAO_OutputCDR &cdr) |
| Allows us to forbid marshaling of local interfaces. | |
| CORBA::Boolean | is_evaluated (void) const |
| Accessor to the flag.. | |
| void | set_collocated_servant (TAO_Abstract_ServantBase *) |
| Mutator for setting the servant in collocated cases. | |
| TAO_ORB_Core * | orb_core (void) const |
| Accessor for the ORB_Core.. | |
| IOP::IOR * | steal_ior (void) |
| Accessors for the underlying IOP::IOR's. | |
| const IOP::IOR & | ior (void) const |
| virtual bool | can_convert_to_ior (void) const |
| Can this object be stringified? | |
| virtual char * | convert_to_ior (bool use_omg_ior_format, const char *ior_prefix) const |
Reference Count Managment | |
| virtual void | _add_ref (void) |
| Increment the reference count. | |
| virtual void | _remove_ref (void) |
| Decrement the reference count. | |
| virtual CORBA::ULong | _refcount_value (void) const |
| Get the refcount. | |
Static Public Member Functions | |
| static CORBA::Boolean | marshal (const Object_ptr x, TAO_OutputCDR &cdr) |
| static void | _tao_any_destructor (void *) |
| Used in the implementation of CORBA::Any. | |
| static CORBA::Boolean | is_nil_i (CORBA::Object_ptr obj) |
| Uninlined part of the now-inlined CORBA::is_nil(). | |
| static void | tao_object_initialize (Object *) |
| Helper function for reading contents of an IOR. | |
Protected Member Functions | |
| Object (int dummy=0) | |
| Initializing a local object. | |
| TAO::Object_Proxy_Broker * | proxy_broker () const |
Protected Attributes | |
| TAO_Configurable_Refcount | refcount_ |
| Number of outstanding references to this object. | |
Private Member Functions | |
| Object (const Object &) | |
| Object & | operator= (const Object &) |
Private Attributes | |
| CORBA::Boolean | is_local_ |
| Specify whether this is a local object or not. | |
| CORBA::Boolean | is_evaluated_ |
| Flag to indicate whether the IOP::IOR has been evaluated fully. | |
| IOP::IOR_var | ior_ |
| TAO_ORB_Core * | orb_core_ |
| Cached pointer of our ORB_Core. | |
| TAO_Stub * | protocol_proxy_ |
| ACE_Lock * | object_init_lock_ |
| Protect reference count manipulation from race conditions. | |
Spec defined methods | |
These methods are defined here since they are required by the CORBA spec in a form specified by the C++ mapping. | |
| virtual CORBA::Boolean | _is_a (const char *logical_type_id) |
| Determine if we are of the type specified by the "logical_type_id". | |
| virtual const char * | _interface_repository_id (void) const |
| virtual CORBA::ULong | _hash (CORBA::ULong maximum) |
| virtual CORBA::Boolean | _is_equivalent (CORBA::Object_ptr other_obj) |
| virtual CORBA::Boolean | _non_existent (void) |
| Determine if we are of the type specified by the "logical_type_id". | |
| virtual InterfaceDef_ptr | _get_interface (void) |
| Get info about the object from the Interface Repository. | |
| virtual CORBA::Object_ptr | _get_component (void) |
| Get info about the object from the Interface Repository. | |
| virtual char * | _repository_id (void) |
| Get the repository id. | |
| virtual void | _create_request (CORBA::Context_ptr ctx, const char *operation, CORBA::NVList_ptr arg_list, CORBA::NamedValue_ptr result, CORBA::Request_ptr &request, CORBA::Flags req_flags) |
| Determine if we are of the type specified by the "logical_type_id". | |
| virtual void | _create_request (CORBA::Context_ptr ctx, const char *operation, CORBA::NVList_ptr arg_list, CORBA::NamedValue_ptr result, CORBA::ExceptionList_ptr exclist, CORBA::ContextList_ptr ctxtlist, CORBA::Request_ptr &request, CORBA::Flags req_flags) |
| Determine if we are of the type specified by the "logical_type_id". | |
| virtual CORBA::Request_ptr | _request (const char *operation) |
| DII operation to create a request. | |
| virtual CORBA::ORB_ptr | _get_orb (void) |
| Determine if we are of the type specified by the "logical_type_id". | |
| static CORBA::Object_ptr | _duplicate (CORBA::Object_ptr obj) |
| Increment the ref count. | |
| static CORBA::Object_ptr | _nil (void) |
| Return a NULL object. | |
| static CORBA::Object_ptr | _narrow (CORBA::Object_ptr obj) |
| No-op it is just here to simplify some templates. | |
Implementation of a CORBA object reference.
All CORBA objects, both unconstrained and locality-constrained, inherit from this class. The interface is defined in the CORBA specification and the C++ mapping.
Definition at line 98 of file Object.h.
| typedef Object_out CORBA::Object::_out_type |
Reimplemented in CORBA::LocalObject, and CORBA::Policy.
| typedef Object_ptr CORBA::Object::_ptr_type |
Reimplemented in CORBA::LocalObject, and CORBA::Policy.
| typedef Object_var CORBA::Object::_var_type |
Reimplemented in CORBA::LocalObject, and CORBA::Policy.
| virtual CORBA::Object::~Object | ( | void | ) | [virtual] |
Destructor.
| CORBA::Object::Object | ( | TAO_Stub * | p, | |
| CORBA::Boolean | collocated = false, |
|||
| TAO_Abstract_ServantBase * | servant = 0, |
|||
| TAO_ORB_Core * | orb_core = 0 | |||
| ) |
Constructor.
This constructor should not be called when the protocol proxy is null ie. when the object is a LocalObject. Assert that requirement.
Definition at line 46 of file Object.cpp.
00050 : is_local_ (false) 00051 , is_evaluated_ (true) 00052 , ior_ (0) 00053 , orb_core_ (orb_core) 00054 , protocol_proxy_ (protocol_proxy) 00055 , object_init_lock_ (0) 00056 { 00057 /// This constructor should not be called when the protocol proxy is 00058 /// null ie. when the object is a LocalObject. Assert that 00059 /// requirement. 00060 ACE_ASSERT (this->protocol_proxy_ != 0); 00061 00062 if (this->orb_core_ == 0) 00063 this->orb_core_ = this->protocol_proxy_->orb_core (); 00064 00065 this->object_init_lock_ = 00066 this->orb_core_->resource_factory ()->create_corba_object_lock (); 00067 00068 this->refcount_ = 00069 this->orb_core_->resource_factory ()->create_corba_object_refcount (); 00070 00071 // Set the collocation marker on the stub. This may not be news to it. 00072 // This may also change the stub's object proxy broker. 00073 this->protocol_proxy_->is_collocated (collocated); 00074 00075 // Set the collocated servant pointer (null if not collocated) on the stub. 00076 this->protocol_proxy_->collocated_servant (servant); 00077 }
| CORBA::Object::Object | ( | IOP::IOR * | ior, | |
| TAO_ORB_Core * | orb_core | |||
| ) |
Definition at line 79 of file Object.cpp.
00081 : is_local_ (false) 00082 , is_evaluated_ (false) 00083 , ior_ (ior) 00084 , orb_core_ (orb_core) 00085 , protocol_proxy_ (0) 00086 , object_init_lock_ (0) 00087 { 00088 this->object_init_lock_ = 00089 this->orb_core_->resource_factory ()->create_corba_object_lock (); 00090 00091 this->refcount_ = 00092 this->orb_core_->resource_factory ()->create_corba_object_refcount (); 00093 }
| CORBA::Object::Object | ( | int | dummy = 0 |
) | [protected] |
Initializing a local object.
Definition at line 10 of file Object.inl.
00011 : is_local_ (true), 00012 is_evaluated_ (true), 00013 ior_ (), 00014 orb_core_ (0), 00015 protocol_proxy_ (0), 00016 object_init_lock_ (0) 00017 { 00018 }
| CORBA::Object::Object | ( | const Object & | ) | [private] |
| void CORBA::Object::_add_ref | ( | void | ) | [virtual] |
Increment the reference count.
Definition at line 114 of file Object.cpp.
| void CORBA::Object::_create_request | ( | CORBA::Context_ptr | ctx, | |
| const char * | operation, | |||
| CORBA::NVList_ptr | arg_list, | |||
| CORBA::NamedValue_ptr | result, | |||
| CORBA::ExceptionList_ptr | exclist, | |||
| CORBA::ContextList_ptr | ctxtlist, | |||
| CORBA::Request_ptr & | request, | |||
| CORBA::Flags | req_flags | |||
| ) | [virtual] |
Determine if we are of the type specified by the "logical_type_id".
Reimplemented in CORBA::LocalObject.
Definition at line 419 of file Object.cpp.
00427 { 00428 TAO_OBJECT_IOR_EVALUATE; 00429 00430 // Since we don't really support Context, anything but a null pointer 00431 // is a no-no. 00432 // Neither can we create a request object from locality constrained 00433 // object references. 00434 if (ctx != 0 || this->protocol_proxy_ == 0) 00435 { 00436 throw ::CORBA::NO_IMPLEMENT (); 00437 } 00438 00439 TAO_Dynamic_Adapter *dynamic_adapter = 00440 ACE_Dynamic_Service<TAO_Dynamic_Adapter>::instance ( 00441 TAO_ORB_Core::dynamic_adapter_name () 00442 ); 00443 00444 dynamic_adapter->create_request ( 00445 this, 00446 this->protocol_proxy_->orb_core ()-> orb (), 00447 operation, 00448 arg_list, 00449 result, 00450 exceptions, 00451 request, 00452 req_flags); 00453 }
| void CORBA::Object::_create_request | ( | CORBA::Context_ptr | ctx, | |
| const char * | operation, | |||
| CORBA::NVList_ptr | arg_list, | |||
| CORBA::NamedValue_ptr | result, | |||
| CORBA::Request_ptr & | request, | |||
| CORBA::Flags | req_flags | |||
| ) | [virtual] |
Determine if we are of the type specified by the "logical_type_id".
Reimplemented in CORBA::LocalObject.
Definition at line 381 of file Object.cpp.
00387 { 00388 TAO_OBJECT_IOR_EVALUATE; 00389 00390 // Since we don't really support Context, anything but a null pointer 00391 // is a no-no. 00392 // Neither can we create a request object from locality constrained 00393 // object references. 00394 if (ctx != 0 || this->protocol_proxy_ == 0) 00395 { 00396 throw ::CORBA::NO_IMPLEMENT (); 00397 } 00398 00399 TAO_Dynamic_Adapter *dynamic_adapter = 00400 ACE_Dynamic_Service<TAO_Dynamic_Adapter>::instance ( 00401 TAO_ORB_Core::dynamic_adapter_name () 00402 ); 00403 00404 dynamic_adapter->create_request ( 00405 this, 00406 this->protocol_proxy_->orb_core ()-> orb (), 00407 operation, 00408 arg_list, 00409 result, 00410 0, 00411 request, 00412 req_flags 00413 ); 00414 }
| CORBA::Object_ptr CORBA::Object::_duplicate | ( | CORBA::Object_ptr | obj | ) | [static] |
Increment the ref count.
Reimplemented in CORBA::LocalObject, and CORBA::Policy.
Definition at line 21 of file Object.inl.
00022 { 00023 if (obj) 00024 { 00025 obj->_add_ref (); 00026 } 00027 00028 return obj; 00029 }
| CORBA::Object_ptr CORBA::Object::_get_component | ( | void | ) | [virtual] |
Get info about the object from the Interface Repository.
Reimplemented in CORBA::LocalObject.
Definition at line 512 of file Object.cpp.
00513 { 00514 TAO_OBJECT_IOR_EVALUATE_RETURN; 00515 return this->proxy_broker ()->_get_component (this); 00516 }
| CORBA::InterfaceDef_ptr CORBA::Object::_get_interface | ( | void | ) | [virtual] |
Get info about the object from the Interface Repository.
Reimplemented in CORBA::LocalObject.
Definition at line 505 of file Object.cpp.
00506 { 00507 TAO_OBJECT_IOR_EVALUATE_RETURN; 00508 return this->proxy_broker ()->_get_interface (this); 00509 }
| CORBA::ORB_ptr CORBA::Object::_get_orb | ( | void | ) | [virtual] |
Determine if we are of the type specified by the "logical_type_id".
Reimplemented in CORBA::LocalObject.
Definition at line 644 of file Object.cpp.
00645 { 00646 if (this->orb_core_ != 0) 00647 { 00648 return CORBA::ORB::_duplicate (this->orb_core_->orb ()); 00649 } 00650 else 00651 { 00652 TAO_OBJECT_IOR_EVALUATE_RETURN; 00653 if (this->protocol_proxy_) 00654 return CORBA::ORB::_duplicate (this->protocol_proxy_->orb_core ()->orb ()); 00655 else 00656 throw ::CORBA::INTERNAL (); 00657 } 00658 }
| CORBA::ULong CORBA::Object::_hash | ( | CORBA::ULong | maximum | ) | [virtual] |
Return a (potentially non-unique) hash value for this object. This method relies on the representation of the object reference's private state. Since that changes easily (when different ORB protocols are in use) there is no default implementation.
Reimplemented in CORBA::LocalObject.
Definition at line 285 of file Object.cpp.
00286 { 00287 TAO_OBJECT_IOR_EVALUATE_RETURN; 00288 00289 if (this->protocol_proxy_ != 0) 00290 return this->protocol_proxy_->hash (maximum); 00291 else 00292 { 00293 // Locality-constrained object. 00294 00295 // Note that we reinterpret_cast to an "unsigned long" instead 00296 // of CORBA::ULong since we need to first cast to an integer 00297 // large enough to hold an address to avoid compile-time 00298 // warnings on some 64-bit platforms. 00299 const CORBA::ULong hash = 00300 static_cast<CORBA::ULong> (reinterpret_cast<ptrdiff_t> (this)); 00301 00302 return hash % maximum; 00303 } 00304 }
| const char * CORBA::Object::_interface_repository_id | ( | void | ) | const [virtual] |
The repository ID for the most derived class, this is an implementation method and does no remote invocations!
Reimplemented in CORBA::Policy.
Definition at line 242 of file Object.cpp.
| CORBA::Boolean CORBA::Object::_is_a | ( | const char * | logical_type_id | ) | [virtual] |
Determine if we are of the type specified by the "logical_type_id".
Reimplemented in CORBA::Policy.
Definition at line 210 of file Object.cpp.
00211 { 00212 TAO_OBJECT_IOR_EVALUATE_RETURN; 00213 00214 // NOTE: if _stub->type_id is nonzero and we have local knowledge of 00215 // it, we can answer this question without a costly remote call. 00216 // 00217 // That "local knowledge" could come from stubs or skeletons linked 00218 // into this process in the best case, or a "near" repository in a 00219 // slightly worse case. Or in a trivial case, if the ID being asked 00220 // about is the ID we have recorded, we don't need to ask about the 00221 // inheritance relationships at all! 00222 // 00223 // In real systems having local knowledge will be common, though as 00224 // the systems built atop ORBs become richer it'll also become 00225 // common to have the "real type ID" not be directly understood 00226 // because it's more deeply derived than any locally known types. 00227 // 00228 // XXX if type_id is that of CORBA::Object, "yes, we comply" :-) 00229 00230 if (this->protocol_proxy_ == 0) 00231 throw ::CORBA::NO_IMPLEMENT (); 00232 00233 if (this->_stubobj ()->type_id.in () != 0 00234 && ACE_OS::strcmp (type_id, 00235 this->_stubobj ()->type_id.in ()) == 0) 00236 return true; 00237 00238 return this->proxy_broker ()->_is_a (this, type_id); 00239 }
| CORBA::Boolean CORBA::Object::_is_collocated | ( | void | ) | const [virtual] |
Is this object collocated with the servant? Note this does not return this->is_collocated_ but will instead query the underlying stub for its collocation status
Definition at line 248 of file Object.cpp.
00249 { 00250 if (this->protocol_proxy_) 00251 { 00252 return this->protocol_proxy_->is_collocated (); 00253 } 00254 00255 return false; 00256 }
| CORBA::Boolean CORBA::Object::_is_equivalent | ( | CORBA::Object_ptr | other_obj | ) | [virtual] |
Try to determine if this object is the same as other_obj. This method relies on the representation of the object reference's private state. Since that changes easily (when different ORB protocols are in use) there is no default implementation.
Definition at line 307 of file Object.cpp.
00308 { 00309 if (other_obj == 0) 00310 { 00311 return false; 00312 } 00313 00314 if (other_obj == this) 00315 { 00316 return true; 00317 } 00318 00319 TAO_OBJECT_IOR_EVALUATE_RETURN; 00320 00321 if (this->protocol_proxy_ != 0) 00322 return this->protocol_proxy_->is_equivalent (other_obj); 00323 00324 return false; 00325 }
| CORBA::Boolean CORBA::Object::_is_local | ( | void | ) | const [virtual] |
Is this a local object?
Definition at line 266 of file Object.cpp.
00267 { 00268 return this->is_local_; 00269 }
| TAO::ObjectKey * CORBA::Object::_key | ( | void | ) | [virtual] |
Return the object key as an out parameter. Caller should release return value when finished with it.
Reimplemented in CORBA::LocalObject.
Definition at line 330 of file Object.cpp.
00331 { 00332 TAO_OBJECT_IOR_EVALUATE_RETURN; 00333 00334 if (this->_stubobj () && this->_stubobj ()->profile_in_use ()) 00335 return this->_stubobj ()->profile_in_use ()->_key (); 00336 00337 if (TAO_debug_level > 2) 00338 { 00339 ACE_ERROR ((LM_ERROR, 00340 ACE_TEXT ("TAO (%P|%t) Null object key return from ") 00341 ACE_TEXT ("profile in use\n"))); 00342 } 00343 00344 throw ::CORBA::INTERNAL ( 00345 CORBA::SystemException::_tao_minor_code ( 00346 0, 00347 EINVAL), 00348 CORBA::COMPLETED_NO); 00349 }
| CORBA::Object_ptr CORBA::Object::_narrow | ( | CORBA::Object_ptr | obj | ) | [static] |
No-op it is just here to simplify some templates.
Definition at line 69 of file Object.inl.
00070 { 00071 return CORBA::Object::_duplicate (obj); 00072 }
| CORBA::Object_ptr CORBA::Object::_nil | ( | void | ) | [static] |
Return a NULL object.
Reimplemented in CORBA::LocalObject, and CORBA::Policy.
Definition at line 62 of file Object.inl.
| CORBA::Boolean CORBA::Object::_non_existent | ( | void | ) | [virtual] |
Determine if we are of the type specified by the "logical_type_id".
Reimplemented in CORBA::LocalObject.
Definition at line 484 of file Object.cpp.
00485 { 00486 TAO_OBJECT_IOR_EVALUATE_RETURN; 00487 00488 CORBA::Boolean retval = false; 00489 00490 try 00491 { 00492 retval = this->proxy_broker ()->_non_existent (this); 00493 } 00494 catch (const ::CORBA::OBJECT_NOT_EXIST&) 00495 { 00496 retval = true; 00497 } 00498 00499 return retval; 00500 }
| void CORBA::Object::_proxy_broker | ( | TAO::Object_Proxy_Broker * | proxy_broker | ) | [virtual] |
Set the proxy broker.
Definition at line 352 of file Object.cpp.
00353 { 00354 this->protocol_proxy_->object_proxy_broker (proxy_broker); 00355 }
| CORBA::ULong CORBA::Object::_refcount_value | ( | void | ) | const [virtual] |
Get the refcount.
Definition at line 129 of file Object.cpp.
00130 { 00131 return static_cast<CORBA::ULong> (this->refcount_.value ()); 00132 }
| void CORBA::Object::_remove_ref | ( | void | ) | [virtual] |
Decrement the reference count.
Definition at line 120 of file Object.cpp.
| char * CORBA::Object::_repository_id | ( | void | ) | [virtual] |
Get the repository id.
Reimplemented in CORBA::LocalObject.
Definition at line 520 of file Object.cpp.
00521 { 00522 TAO_OBJECT_IOR_EVALUATE_RETURN; 00523 return this->proxy_broker ()->_repository_id (this); 00524 }
| CORBA::Request_ptr CORBA::Object::_request | ( | const char * | operation | ) | [virtual] |
DII operation to create a request.
Reimplemented in CORBA::LocalObject.
Definition at line 458 of file Object.cpp.
00459 { 00460 TAO_OBJECT_IOR_EVALUATE_RETURN; 00461 if (this->protocol_proxy_) 00462 { 00463 TAO_Dynamic_Adapter *dynamic_adapter = 00464 ACE_Dynamic_Service<TAO_Dynamic_Adapter>::instance ( 00465 TAO_ORB_Core::dynamic_adapter_name ()); 00466 00467 return dynamic_adapter->request ( 00468 this, 00469 this->protocol_proxy_->orb_core ()->orb (), 00470 operation); 00471 } 00472 else 00473 { 00474 throw ::CORBA::NO_IMPLEMENT (); 00475 } 00476 }
| TAO_Abstract_ServantBase * CORBA::Object::_servant | ( | void | ) | const [virtual] |
Accessor for the cached servant reference held on the stub if this object is collocated
Definition at line 195 of file Object.cpp.
00196 { 00197 if (this->protocol_proxy_ == 0) 00198 { 00199 // No stub set. Should not happen. 00200 return 0; 00201 } 00202 00203 return this->protocol_proxy_->collocated_servant (); 00204 }
| TAO_Stub * CORBA::Object::_stubobj | ( | void | ) | [virtual] |
Definition at line 278 of file Object.cpp.
00279 { 00280 TAO_OBJECT_IOR_EVALUATE_RETURN; 00281 return this->protocol_proxy_; 00282 }
| TAO_Stub * CORBA::Object::_stubobj | ( | void | ) | const [virtual] |
Get the underlying stub object.
Definition at line 272 of file Object.cpp.
00273 { 00274 return this->protocol_proxy_; 00275 }
| void CORBA::Object::_tao_any_destructor | ( | void * | x | ) | [static] |
Used in the implementation of CORBA::Any.
Reimplemented in CORBA::Policy.
Definition at line 135 of file Object.cpp.
00136 { 00137 CORBA::Object_ptr tmp = static_cast<CORBA::Object_ptr> (x); 00138 ::CORBA::release (tmp); 00139 }
| bool CORBA::Object::can_convert_to_ior | ( | void | ) | const [virtual] |
Can this object be stringified?
Definition at line 182 of file Object.cpp.
00183 { 00184 // By default, objects can not be stringified if they are local 00185 return !this->_is_local (); 00186 }
| char * CORBA::Object::convert_to_ior | ( | bool | use_omg_ior_format, | |
| const char * | ior_prefix | |||
| ) | const [virtual] |
A hook to allow users to provide custom object stringification.
Definition at line 189 of file Object.cpp.
| const IOP::IOR & CORBA::Object::ior | ( | void | ) | const |
Definition at line 93 of file Object.inl.
00094 { 00095 return this->ior_.in (); 00096 }
| CORBA::Boolean CORBA::Object::is_evaluated | ( | void | ) | const |
Accessor to the flag..
Definition at line 75 of file Object.inl.
00076 { 00077 return this->is_evaluated_; 00078 }
| CORBA::Boolean CORBA::Object::is_nil_i | ( | CORBA::Object_ptr | obj | ) | [static] |
Uninlined part of the now-inlined CORBA::is_nil().
Definition at line 358 of file Object.cpp.
00359 { 00360 00361 // If the profile length is zero for a non-evaluted IOR it is a 00362 // null-object. 00363 if ((!obj->is_evaluated ()) && obj->ior ().profiles.length () == 0) 00364 return true; 00365 00366 // To accomodate new definitions. 00367 if (obj->orb_core_) 00368 { 00369 return obj->orb_core_->object_is_nil (obj); 00370 } 00371 00372 return false; 00373 }
| CORBA::Boolean CORBA::Object::marshal | ( | TAO_OutputCDR & | cdr | ) | [virtual] |
Allows us to forbid marshaling of local interfaces.
Reimplemented in CORBA::Policy.
Definition at line 143 of file Object.cpp.
| CORBA::Boolean CORBA::Object::marshal | ( | const Object_ptr | x, | |
| TAO_OutputCDR & | cdr | |||
| ) | [static] |
Marshalling operator used by the stub code. A long story why the stub code uses this, let us keep it short here.
Definition at line 149 of file Object.cpp.
00151 { 00152 if (x == 0) 00153 { 00154 // NIL objrefs ... marshal as empty type hint, no elements. 00155 cdr.write_ulong (1); 00156 cdr.write_char ('\0'); 00157 cdr.write_ulong (0); 00158 return (CORBA::Boolean) cdr.good_bit (); 00159 } 00160 00161 return x->marshal (cdr); 00162 }
Reimplemented in CORBA::LocalObject, TAO_Local_RefCounted_Object, TAO_Policy_Manager, and CORBA::Policy.
| TAO_ORB_Core * CORBA::Object::orb_core | ( | void | ) | const |
Accessor for the ORB_Core..
Definition at line 81 of file Object.inl.
00082 { 00083 return this->orb_core_; 00084 }
| TAO::Object_Proxy_Broker * CORBA::Object::proxy_broker | ( | void | ) | const [protected] |
Convenience accessor for the object proxy broker of the underlying stub.
Definition at line 661 of file Object.cpp.
00662 { 00663 // Paranoid check. We *should* never access the proxy_broker 00664 // when the object has not been initialised so there *should* 00665 // alway be a stub, but just in case... 00666 00667 if (this->protocol_proxy_) 00668 { 00669 return this->protocol_proxy_->object_proxy_broker (); 00670 } 00671 00672 // We have no stub. We cannot be collocated. 00673 return the_tao_remote_object_proxy_broker (); 00674 }
| void CORBA::Object::set_collocated_servant | ( | TAO_Abstract_ServantBase * | b | ) |
Mutator for setting the servant in collocated cases.
This is used by the Object_Adapter to set the servant for collocated cases and only when the object is initialized. The object initialization takes place when IOR's are lazily evaluated.
Definition at line 259 of file Object.cpp.
00260 { 00261 this->protocol_proxy_->collocated_servant (b); 00262 this->protocol_proxy_->is_collocated (true); 00263 }
| IOP::IOR * CORBA::Object::steal_ior | ( | void | ) |
Accessors for the underlying IOP::IOR's.
The steal_ior () call basically relinquishes the ownership of the IOR. This is useful for cases when one wants to initialize a new CORBA Object
Definition at line 87 of file Object.inl.
00088 { 00089 return this->ior_._retn (); 00090 }
| void CORBA::Object::tao_object_initialize | ( | CORBA::Object * | obj | ) | [static] |
Helper function for reading contents of an IOR.
Definition at line 709 of file Object.cpp.
00710 { 00711 CORBA::ULong const profile_count = 00712 obj->ior_->profiles.length (); 00713 00714 // Assumption is that after calling this method, folks should test 00715 // for protocol_proxy_ or whatever to make sure that things have 00716 // been initialized! 00717 if (profile_count == 0) 00718 return; 00719 00720 // get a profile container to store all profiles in the IOR. 00721 TAO_MProfile mp (profile_count); 00722 00723 TAO_ORB_Core *&orb_core = obj->orb_core_; 00724 if (orb_core == 0) 00725 { 00726 orb_core = TAO_ORB_Core_instance (); 00727 if (TAO_debug_level > 0) 00728 { 00729 ACE_DEBUG ((LM_WARNING, 00730 ACE_TEXT ("TAO (%P|%t) - Object::tao_object_initialize ") 00731 ACE_TEXT ("WARNING: extracting object from ") 00732 ACE_TEXT ("default ORB_Core\n"))); 00733 } 00734 } 00735 00736 TAO_Stub *objdata = 0; 00737 00738 try 00739 { 00740 TAO_Connector_Registry *connector_registry = 00741 orb_core->connector_registry (); 00742 00743 for (CORBA::ULong i = 0; i != profile_count; ++i) 00744 { 00745 IOP::TaggedProfile &tpfile = obj->ior_->profiles[i]; 00746 00747 // NOTE: This is a place for optimizations. Here we have an 00748 // 2 allocations and 2 copies. Future optimizations should 00749 // target this place. 00750 TAO_OutputCDR o_cdr; 00751 00752 o_cdr << tpfile; 00753 00754 TAO_InputCDR cdr (o_cdr, 00755 orb_core->input_cdr_buffer_allocator (), 00756 orb_core->input_cdr_dblock_allocator (), 00757 orb_core->input_cdr_msgblock_allocator (), 00758 orb_core); 00759 00760 TAO_Profile *pfile = connector_registry->create_profile (cdr); 00761 00762 if (pfile != 0) 00763 mp.give_profile (pfile); 00764 } 00765 00766 // Make sure we got some profiles! 00767 if (mp.profile_count () != profile_count) 00768 { 00769 // @@ This occurs when profile creation fails when decoding the 00770 // profile from the IOR. 00771 ACE_ERROR ((LM_ERROR, 00772 ACE_TEXT ("TAO (%P|%t) ERROR: XXXXX Could not create all ") 00773 ACE_TEXT ("profiles while extracting object\n") 00774 ACE_TEXT ("TAO (%P|%t) ERROR: reference from the ") 00775 ACE_TEXT ("CDR stream.\n"))); 00776 } 00777 00778 00779 objdata = orb_core->create_stub (obj->ior_->type_id.in (), mp); 00780 } 00781 catch (const ::CORBA::Exception& ex) 00782 { 00783 if (TAO_debug_level > 0) 00784 ex._tao_print_exception ( 00785 ACE_TEXT ("TAO - ERROR creating stub ") 00786 ACE_TEXT ("object when demarshaling object ") 00787 ACE_TEXT ("reference.")); 00788 00789 return; 00790 } 00791 00792 TAO_Stub_Auto_Ptr safe_objdata (objdata); 00793 00794 // This call will set the stub proxy broker if necessary 00795 if (orb_core->initialize_object (safe_objdata.get (), obj) == -1) 00796 return; 00797 00798 obj->protocol_proxy_ = objdata; 00799 00800 obj->is_evaluated_ = true; 00801 00802 // Release the contents of the ior to keep memory consumption down. 00803 obj->ior_ = 0; 00804 00805 // Transfer ownership to the CORBA::Object 00806 (void) safe_objdata.release (); 00807 return; 00808 }
IOP::IOR_var CORBA::Object::ior_ [private] |
CORBA::Boolean CORBA::Object::is_evaluated_ [private] |
CORBA::Boolean CORBA::Object::is_local_ [private] |
ACE_Lock* CORBA::Object::object_init_lock_ [private] |
Protect reference count manipulation from race conditions.
This lock is only instantiated for unconstrained objects. The reason for this is that locality-constrained objects that do not require reference counting (the default) may be instantiated in the critical path.
TAO_ORB_Core* CORBA::Object::orb_core_ [private] |
Cached pointer of our ORB_Core.
Be aware that this pointer can be zero or not. In fact there are two ways to get this pointer filled:
TAO_Stub* CORBA::Object::protocol_proxy_ [private] |
TAO_Configurable_Refcount CORBA::Object::refcount_ [protected] |
1.6.1