blob: 5c9cae1b49259d2ead9f9ea8d04c357bdc73a7e1 (
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
#include "IORInterceptor.h"
#include "testC.h"
ACE_RCSID (PolicyFactory,
IORInterceptor,
"$Id$")
IORInterceptor::IORInterceptor (void)
: success_ (false)
{
}
IORInterceptor::~IORInterceptor (void)
{
ACE_ASSERT (this->success_);
}
char *
IORInterceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException))
{
return CORBA::string_dup ("");
}
void
IORInterceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException))
{
ACE_ASSERT (this->success_);
}
void
IORInterceptor::establish_components (
PortableInterceptor::IORInfo_ptr info
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
ACE_TRY
{
PortableInterceptor::ObjectReferenceTemplate_var t =
info->adapter_template (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
PortableInterceptor::AdapterName_var a =
t->adapter_name (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
// 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
ACE_ENV_ARG_PARAMETER));
ACE_TRY_CHECK;
Test::Policy_var test_policy (Test::Policy::_narrow (
policy.in ()
ACE_ENV_ARG_PARAMETER));
ACE_TRY_CHECK;
this->success_ = true;
}
}
ACE_CATCHANY
{
ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
"EXCEPTION: "
"IORInterceptor::establish_components:");
ACE_ASSERT (false);
}
ACE_ENDTRY;
ACE_CHECK;
}
|