2 #include "ace/Get_Opt.h"
3 #include "ace/Service_Config.h"
4 #include "ace/Log_Msg.h"
6 static const ACE_TCHAR
* server_strat
=
7 ACE_STATIC_SERVICE_DIRECTIVE ("Server_Strategy_Factory",
8 "-ORBConcurrency thread-per-connection");
9 static const ACE_TCHAR
* foo_strat
=
10 ACE_STATIC_SERVICE_DIRECTIVE ("Foo_Strategy_Factory", "");
12 enum Factory_Strategy
{ SERVER_STRATEGY
, FOO_STRATEGY
};
14 static Factory_Strategy factory_strategy
= SERVER_STRATEGY
;
17 parse_args (int argc
, ACE_TCHAR
*argv
[])
19 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT ("fs"));
22 while ((c
= get_opts ()) != -1)
26 factory_strategy
= FOO_STRATEGY
;
29 factory_strategy
= SERVER_STRATEGY
;
33 ACE_ERROR_RETURN ((LM_ERROR
,
46 ACE_TMAIN (int argc
, ACE_TCHAR
*argv
[])
50 if (parse_args (argc
, argv
) == -1)
54 const ACE_TCHAR
*targv
[] =
55 { ACE_TEXT ("server"), ACE_TEXT ("-ORBSvcConfDirective"), 0, 0 }; // null-terminated!
56 switch (factory_strategy
)
62 targv
[2] = server_strat
;
65 CORBA::ORB_var orb
= CORBA::ORB_init (targc
, const_cast<ACE_TCHAR
**> (targv
));
68 catch (const CORBA::Exception
& ex
)
70 ex
._tao_print_exception ("Exception caught:");