1 #include "ORT_test_IORInterceptor.h"
2 #include "ObjectReferenceFactory.h"
4 #include "tao/ORB_Constants.h"
6 ORT_test_IORInterceptor::ORT_test_IORInterceptor ()
7 : establish_count_ (0),
8 components_establish_count_ (0)
13 ORT_test_IORInterceptor::name ()
15 return CORBA::string_dup ("ORT_IORInterceptor");
19 ORT_test_IORInterceptor::destroy ()
21 ACE_ASSERT (this->establish_count_
> 0
22 && this->components_establish_count_
> 0
23 && this->establish_count_
== this->components_establish_count_
);
27 ORT_test_IORInterceptor::establish_components (
28 PortableInterceptor::IORInfo_ptr
/* info */)
30 ++this->establish_count_
;
33 "establish_components() has been invoked %d times\n",
34 this->establish_count_
));
38 ORT_test_IORInterceptor::components_established (
39 PortableInterceptor::IORInfo_ptr info
)
41 ++this->components_establish_count_
;
44 "components_established() has been invoked %d times\n",
45 this->establish_count_
));
48 // Swap out the current ObjectReferenceFactory with our own.
50 // Save a copy of the current ObjectReferenceFactory.
51 PortableInterceptor::ObjectReferenceFactory_var old_orf
=
52 info
->current_factory ();
54 PortableInterceptor::ObjectReferenceFactory
* tmp
;
55 ACE_NEW_THROW_EX (tmp
,
56 ObjectReferenceFactory (old_orf
.in ()),
58 CORBA::SystemException::_tao_minor_code (
61 CORBA::COMPLETED_NO
));
63 PortableInterceptor::ObjectReferenceFactory_var orf
= tmp
;
65 info
->current_factory (orf
.in ());
69 ORT_test_IORInterceptor::adapter_manager_state_changed (
71 PortableInterceptor::AdapterState
)
74 "The AdapterManager [id=%C] state has changed.\n", id
));
78 ORT_test_IORInterceptor:: adapter_state_changed (
79 const PortableInterceptor::ObjectReferenceTemplateSeq
&,
80 PortableInterceptor::AdapterState
)