Updated logging to include the class/method so that it is more obvious where these...
[ACE_TAO.git] / TAO / tao / ObjRefTemplate / ObjectReferenceTemplate_i.cpp
blobf056136bd0857d4e3ca7d84a4aad84f318c533b8
1 #include "tao/ObjRefTemplate/ObjectReferenceTemplate_i.h"
2 #include "tao/PortableServer/Root_POA.h"
4 #include "tao/CORBA_String.h"
5 #include "tao/ORB_Constants.h"
7 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
9 namespace TAO
11 ObjectReferenceTemplate::ObjectReferenceTemplate (
12 const char *server_id,
13 const char *orb_id,
14 PortableInterceptor::AdapterName *adapter_name,
15 PortableServer::POA_ptr poa)
16 : server_id_ (server_id),
17 orb_id_ (orb_id),
18 adapter_name_ (adapter_name),
19 poa_ (PortableServer::POA::_duplicate (poa))
23 ObjectReferenceTemplate::~ObjectReferenceTemplate (void)
27 ::CORBA::ValueBase *
28 ObjectReferenceTemplate::_copy_value (void)
30 ::CORBA::ValueBase *ret_val= 0;
31 ACE_NEW_THROW_EX (
32 ret_val,
33 ObjectReferenceTemplate (
34 server_id_,
35 orb_id_,
36 adapter_name_,
37 poa_.in ()
39 ::CORBA::NO_MEMORY ()
41 return ret_val;
44 char *
45 ObjectReferenceTemplate::server_id (void)
47 return CORBA::string_dup (this->server_id_);
50 char *
51 ObjectReferenceTemplate::orb_id (void)
53 return CORBA::string_dup (this->orb_id_);
56 PortableInterceptor::AdapterName *
57 ObjectReferenceTemplate::adapter_name (void)
59 PortableInterceptor::AdapterName *adapter_name = 0;
61 ACE_NEW_THROW_EX (adapter_name,
62 PortableInterceptor::AdapterName (
63 *(this->adapter_name_)),
64 CORBA::NO_MEMORY (
65 CORBA::SystemException::_tao_minor_code (
66 TAO::VMCID,
67 ENOMEM),
68 CORBA::COMPLETED_NO));
70 return adapter_name;
73 CORBA::Object_ptr
74 ObjectReferenceTemplate::make_object (
75 const char *,
76 const PortableInterceptor::ObjectId &)
78 if (CORBA::is_nil (this->poa_.in ()))
79 throw ::CORBA::BAD_INV_ORDER ();
81 TAO_Root_POA* const tao_poa =
82 dynamic_cast<TAO_Root_POA*> (this->poa_.in());
84 if (!tao_poa)
85 throw ::CORBA::INTERNAL ();
87 return tao_poa->invoke_key_to_object ();
91 TAO_END_VERSIONED_NAMESPACE_DECL