2 #include "ace/Get_Opt.h"
5 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
10 CORBA::ORB_init (argc
, argv
);
14 // Paranoia, we should have an auto_ptr-like gadget for
18 ACE_ERROR_RETURN ((LM_ERROR
,
23 CORBA::Object_var object
=
24 orb
->string_to_object (argv
[1]);
25 Test::Startup_Callback_var startup_callback
=
26 Test::Startup_Callback::_narrow (object
.in ());
27 if (CORBA::is_nil (startup_callback
.in ()))
29 ACE_ERROR_RETURN ((LM_ERROR
,
30 "ERROR: nil startup callback\n"),
34 CORBA::Object_var poa_object
=
35 orb
->resolve_initial_references("RootPOA");
37 PortableServer::POA_var root_poa
=
38 PortableServer::POA::_narrow (poa_object
.in ());
40 if (CORBA::is_nil (root_poa
.in ()))
41 ACE_ERROR_RETURN ((LM_ERROR
,
42 " (%P|%t) Panic: nil RootPOA\n"),
45 PortableServer::POAManager_var poa_manager
=
46 root_poa
->the_POAManager ();
48 Process
*process_impl
= 0;
49 ACE_NEW_RETURN (process_impl
,
52 PortableServer::ServantBase_var
owner_transfer(process_impl
);
54 PortableServer::ObjectId_var id
=
55 root_poa
->activate_object (process_impl
);
57 CORBA::Object_var object_act
= root_poa
->id_to_reference (id
.in ());
59 Test::Process_var process
=
60 Test::Process::_narrow (object_act
.in ());
62 poa_manager
->activate ();
64 startup_callback
->started (process
.in ());
66 ACE_Time_Value
tv (50, 0);
69 root_poa
->destroy (true, true);
73 catch (const CORBA::Exception
&)
75 // Do not print error messages, they only make the test output