1 #include "tao/ObjRefTemplate/ORT_Adapter_Impl.h"
2 #include "tao/PortableServer/Root_POA.h"
3 #include "tao/CORBA_String.h"
4 #include "tao/ORB_Constants.h"
5 #include "tao/CORBA_methods.h"
7 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
10 TAO::ORT_Adapter_Impl::tao_server_id ()
12 // No need to duplicate, the ort_template_ method has to do the duplicate
13 return this->ort_template_
->server_id ();
17 TAO::ORT_Adapter_Impl::tao_orb_id ()
19 // No need to duplicate, the ort_template_ method has to do the duplicate
20 return this->ort_template_
->orb_id ();
23 PortableInterceptor::AdapterName
*
24 TAO::ORT_Adapter_Impl::tao_adapter_name ()
26 // No need to duplicate, the ort_template_ method has to do the duplicate
27 return this->ort_template_
->adapter_name ();
31 TAO::ORT_Adapter_Impl::make_object (const char *repo_id
,
32 const PortableInterceptor::ObjectId
&id
)
34 return this->ort_factory_
->make_object (repo_id
, id
);
37 PortableInterceptor::ObjectReferenceTemplate
*
38 TAO::ORT_Adapter_Impl::get_adapter_template ()
40 CORBA::add_ref (this->ort_template_
.in ());
42 return this->ort_template_
;
45 PortableInterceptor::ObjectReferenceFactory
*
46 TAO::ORT_Adapter_Impl::get_obj_ref_factory ()
48 CORBA::add_ref (this->ort_factory_
.in ());
50 return this->ort_factory_
;
54 TAO::ORT_Adapter_Impl::set_obj_ref_factory (
55 PortableInterceptor::ObjectReferenceFactory
*cf
)
57 this->ort_factory_
= cf
;
59 CORBA::add_ref (this->ort_factory_
.in ());
65 TAO::ORT_Adapter_Impl::release (
66 PortableInterceptor::ObjectReferenceTemplate
* t
)
68 CORBA::remove_ref (t
);
72 TAO::ORT_Adapter_Impl::activate (
73 const char *server_id
,
75 PortableInterceptor::AdapterName
*adapter_name
,
76 PortableServer::POA_ptr poa
)
78 // No need to lock here, there is one instance for each POA and
79 // when the POA creates and actives an ORT_Adapter it will lock
80 // itself. Create an ObjectReferenceTemplate for this POA.
82 ObjectReferenceTemplate
* t
= 0;
84 ObjectReferenceTemplate (server_id
,
90 this->ort_template_
= t
;
92 // Must increase ref count since this->ort_factory_ will
93 // decrease it upon destruction.
95 this->ort_factory_
= t
;
100 TAO_END_VERSIONED_NAMESPACE_DECL