2 #include "ace/Get_Opt.h"
5 // Name of file contains ior.
6 static const ACE_TCHAR
*IOR
= ACE_TEXT ("file://ior");
9 parse_args (int argc
, ACE_TCHAR
**argv
)
11 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("k:i:d:x"));
14 while ((c
= get_opts ()) != -1)
18 IOR
= get_opts
.opt_arg ();
22 ACE_ERROR_RETURN ((LM_ERROR
,
31 ACE_ERROR_RETURN ((LM_ERROR
,
32 "Please specify the IOR for the servant\n"), -1);
34 // Indicates successful parsing of command line.
40 ACE_TMAIN (int argc
, ACE_TCHAR
*argv
[])
44 // Initialize the ORB.
46 CORBA::ORB_init (argc
, argv
);
48 // Initialize options based on command-line arguments.
49 int parse_args_result
= parse_args (argc
, argv
);
50 if (parse_args_result
!= 0)
51 return parse_args_result
;
53 // Get an object reference from the argument string.
54 CORBA::Object_var object
=
55 orb
->string_to_object (IOR
);
57 // Try to narrow the object reference to a <test> reference.
58 test_var test_object
= test::_narrow (object
.in ());
61 "(%P|%t) Sending a shutdown call..\n"));
62 test_object
->shutdown ();
66 catch (const CORBA::Exception
& ex
)
68 ex
._tao_print_exception ("Exception caught:");