Merge pull request #2222 from jwillemsen/jwi-dllexportwarning
[ACE_TAO.git] / TAO / tests / ORT / ORT_test_IORInterceptor.cpp
blob304a23bc09b29d79b17644a56fc259c44a9e34eb
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)
12 char *
13 ORT_test_IORInterceptor::name ()
15 return CORBA::string_dup ("ORT_IORInterceptor");
18 void
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_);
26 void
27 ORT_test_IORInterceptor::establish_components (
28 PortableInterceptor::IORInfo_ptr /* info */)
30 ++this->establish_count_;
32 ACE_DEBUG ((LM_DEBUG,
33 "establish_components() has been invoked %d times\n",
34 this->establish_count_));
37 void
38 ORT_test_IORInterceptor::components_established (
39 PortableInterceptor::IORInfo_ptr info)
41 ++this->components_establish_count_;
43 ACE_DEBUG ((LM_DEBUG,
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 ()),
57 CORBA::NO_MEMORY (
58 CORBA::SystemException::_tao_minor_code (
59 TAO::VMCID,
60 ENOMEM),
61 CORBA::COMPLETED_NO));
63 PortableInterceptor::ObjectReferenceFactory_var orf = tmp;
65 info->current_factory (orf.in ());
68 void
69 ORT_test_IORInterceptor::adapter_manager_state_changed (
70 const char * id,
71 PortableInterceptor::AdapterState)
73 ACE_DEBUG ((LM_DEBUG,
74 "The AdapterManager [id=%C] state has changed.\n", id));
77 void
78 ORT_test_IORInterceptor:: adapter_state_changed (
79 const PortableInterceptor::ObjectReferenceTemplateSeq &,
80 PortableInterceptor::AdapterState)