Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / tests / Portable_Interceptors / PolicyFactory / IORInterceptor.cpp
blobf33cdc51bb2a7469ade93581697438f1dac4e7ab
1 #include "IORInterceptor.h"
2 #include "testC.h"
4 IORInterceptor::IORInterceptor (void)
5 : success_ (false)
9 IORInterceptor::~IORInterceptor (void)
11 ACE_ASSERT (this->success_);
14 char *
15 IORInterceptor::name (void)
17 return CORBA::string_dup ("");
20 void
21 IORInterceptor::destroy (void)
23 ACE_ASSERT (this->success_);
26 void
27 IORInterceptor::establish_components (
28 PortableInterceptor::IORInfo_ptr info)
30 try
32 PortableInterceptor::ObjectReferenceTemplate_var t =
33 info->adapter_template ();
35 PortableInterceptor::AdapterName_var a =
36 t->adapter_name ();
38 // Only execute if POA is not RootPOA. The RootPOA will not
39 // have our custom policy, but the child POA we created will.
40 if (a->length () > 1)
42 CORBA::Policy_var policy (
43 info->get_effective_policy (Test::POLICY_TYPE));
45 Test::Policy_var test_policy (Test::Policy::_narrow (
46 policy.in ()));
48 this->success_ = true;
51 catch (const CORBA::Exception& ex)
53 ex._tao_print_exception (
54 "EXCEPTION: ""IORInterceptor::establish_components:");
56 ACE_ASSERT (false);