2 #include "Foo_A_ClientEngine.h"
4 #include "TestAppExceptionC.h"
5 #include "ace/Get_Opt.h"
6 #include "ace/Log_Msg.h"
7 // To force static load the service.
9 #include "tao/CSD_ThreadPool/CSD_ThreadPool.h"
11 ClientApp::ClientApp()
12 : TestAppBase("TP_Test_1_Client"),
13 ior_ (ACE_TEXT("file://test.ior"))
18 ClientApp::~ClientApp()
24 ClientApp::run_i(int argc
, ACE_TCHAR
* argv
[])
26 // Initialize the ORB before parsing our own args.
27 CORBA::ORB_var orb
= CORBA::ORB_init(argc
, argv
);
29 // Parse the command-line args for this application.
30 // * Returns -1 if problems are encountered.
31 // * Returns 1 if the usage statement was explicitly requested.
32 // * Returns 0 otherwise.
33 int result
= this->parse_args(argc
, argv
);
38 // Convert the IOR string to a Foo_A object reference.
39 Foo_A_var foo
= RefHelper
<Foo_A
>::string_to_ref(orb
.in(),
42 // Create the appropriate client "engine" object.
43 Foo_A_ClientEngine
engine(foo
.in());
45 // Execute the client algorithm
46 result
= engine
.execute() ? 0 : -1;
53 ClientApp::parse_args(int argc
, ACE_TCHAR
* argv
[])
55 ACE_Get_Opt
get_opts(argc
, argv
, ACE_TEXT("k:"));
59 while ((c
= get_opts()) != -1)
64 this->ior_
= get_opts
.opt_arg();
69 "(%P|%t) usage: %s -k <ior_string>\n",
75 "(%P|%t) usage: %s -k <ior_string>\n",