Go to the documentation of this file.00001
00002
00003 #include "tao/ObjRefTemplate/ORT_Adapter_Impl.h"
00004 #include "tao/PortableServer/Root_POA.h"
00005 #include "tao/CORBA_String.h"
00006 #include "tao/ORB_Constants.h"
00007 #include "tao/CORBA_methods.h"
00008
00009
00010 ACE_RCSID (ObjRefTemplate,
00011 ORT_Adapter_Impl,
00012 "$Id: ORT_Adapter_Impl.cpp 76995 2007-02-11 12:51:42Z johnnyw $")
00013
00014 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00015
00016 char *
00017 TAO::ORT_Adapter_Impl::tao_server_id (void)
00018 {
00019
00020 return this->ort_template_->server_id ();
00021 }
00022
00023 char *
00024 TAO::ORT_Adapter_Impl::tao_orb_id (void)
00025 {
00026
00027 return this->ort_template_->orb_id ();
00028 }
00029
00030 PortableInterceptor::AdapterName *
00031 TAO::ORT_Adapter_Impl::tao_adapter_name (void)
00032 {
00033
00034 return this->ort_template_->adapter_name ();
00035 }
00036
00037 CORBA::Object_ptr
00038 TAO::ORT_Adapter_Impl::make_object (const char *repo_id,
00039 const PortableInterceptor::ObjectId &id)
00040 {
00041 return this->ort_factory_->make_object (repo_id, id);
00042 }
00043
00044 PortableInterceptor::ObjectReferenceTemplate *
00045 TAO::ORT_Adapter_Impl::get_adapter_template (void)
00046 {
00047 CORBA::add_ref (this->ort_template_.in ());
00048
00049 return this->ort_template_;
00050 }
00051
00052 PortableInterceptor::ObjectReferenceFactory *
00053 TAO::ORT_Adapter_Impl::get_obj_ref_factory (void)
00054 {
00055 CORBA::add_ref (this->ort_factory_.in ());
00056
00057 return this->ort_factory_;
00058 }
00059
00060 int
00061 TAO::ORT_Adapter_Impl::set_obj_ref_factory (
00062 PortableInterceptor::ObjectReferenceFactory *cf)
00063 {
00064 this->ort_factory_ = cf;
00065
00066 CORBA::add_ref (this->ort_factory_.in ());
00067
00068 return 0;
00069 }
00070
00071 void
00072 TAO::ORT_Adapter_Impl::release (
00073 PortableInterceptor::ObjectReferenceTemplate * t)
00074 {
00075 CORBA::remove_ref (t);
00076 }
00077
00078 int
00079 TAO::ORT_Adapter_Impl::activate (
00080 const char *server_id,
00081 const char *orb_id,
00082 PortableInterceptor::AdapterName *adapter_name,
00083 PortableServer::POA_ptr poa)
00084 {
00085
00086
00087
00088
00089 ObjectReferenceTemplate * t = 0;
00090 ACE_NEW_THROW_EX (t,
00091 ObjectReferenceTemplate (server_id,
00092 orb_id,
00093 adapter_name,
00094 poa),
00095 CORBA::NO_MEMORY ());
00096
00097 this->ort_template_ = t;
00098
00099
00100
00101 CORBA::add_ref (t);
00102 this->ort_factory_ = t;
00103
00104 return 0;
00105 }
00106
00107 TAO_END_VERSIONED_NAMESPACE_DECL