1 #include "Client_ORBInitializer.h"
2 #include "tao/ORBInitializer_Registry.h"
5 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
7 Client_ORBInitializer
* initializer1
= 0;
8 Client_ORBInitializer
* initializer2
= 0;
10 ACE_NEW_RETURN (initializer2
,
11 Client_ORBInitializer (0),
12 -1); // No exceptions yet!
14 ACE_NEW_RETURN (initializer1
,
15 Client_ORBInitializer (initializer2
),
16 -1); // No exceptions yet!
18 PortableInterceptor::ORBInitializer_var initializer_var1
=
21 PortableInterceptor::ORBInitializer_var initializer_var2
=
26 PortableInterceptor::register_orb_initializer (initializer_var1
.in ());
29 CORBA::ORB_init (argc
, argv
);
32 CORBA::ORB_init (argc
, argv
, "SecondORB");
34 catch (const CORBA::Exception
& ex
)
36 ex
._tao_print_exception ("Caught exception in client:");
40 // The first ORBInitializer should be called twice, the second only once
41 ACE_ASSERT (initializer1
->pre_init_called
== 2);
42 ACE_ASSERT (initializer2
->pre_init_called
== 1);
43 ACE_ASSERT (initializer1
->post_init_called
== 2);
44 ACE_ASSERT (initializer2
->post_init_called
== 1);