blob: 11d2a656315810594f80c49c077ce6c92c1a2982 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
#include "IORInterceptor.h"
#include "testC.h"
IORInterceptor::IORInterceptor ()
: success_ (false)
{
}
IORInterceptor::~IORInterceptor ()
{
ACE_ASSERT (this->success_);
}
char *
IORInterceptor::name ()
{
return CORBA::string_dup ("");
}
void
IORInterceptor::destroy ()
{
ACE_ASSERT (this->success_);
}
void
IORInterceptor::establish_components (
PortableInterceptor::IORInfo_ptr info)
{
try
{
PortableInterceptor::ObjectReferenceTemplate_var t =
info->adapter_template ();
PortableInterceptor::AdapterName_var a =
t->adapter_name ();
// Only execute if POA is not RootPOA. The RootPOA will not
// have our custom policy, but the child POA we created will.
if (a->length () > 1)
{
CORBA::Policy_var policy (
info->get_effective_policy (Test::POLICY_TYPE));
Test::Policy_var test_policy (Test::Policy::_narrow (
policy.in ()));
this->success_ = true;
}
}
catch (const CORBA::Exception& ex)
{
ex._tao_print_exception (
"EXCEPTION: ""IORInterceptor::establish_components:");
ACE_ASSERT (false);
}
}
|