2 //=============================================================================
6 * Server application to test the Servant Activator and Servant Locator.
8 * @author Kirthika Parameswaran <kirthika@cs.wustl.edu>
10 //=============================================================================
13 #include "Server_Manager.h"
16 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
20 if (server
.init (argc
, argv
) != 0)
21 ACE_ERROR_RETURN ((LM_ERROR
,
22 "Failure during Initialisation: init ()\n"),
25 // This POA is used to test the Servant Activator interface and
26 // hence has an RETAIN policy.
27 PortableServer::POA_var first_poa
=
28 server
.create_poa ("firstPOA", 1);
30 if (first_poa
.in () == 0)
31 ACE_ERROR_RETURN ((LM_ERROR
,
32 "Failure during first POA creation: create_poa ()\n"),
35 // This poa is used to test the Servant Activator interface and
36 // hence has an NONRETAIN policy.
37 PortableServer::POA_var second_poa
=
38 server
.create_poa ("secondPOA", 0);
40 if (second_poa
.in () == 0)
41 ACE_ERROR_RETURN ((LM_ERROR
,
42 "Failure during second POA creation: create_poa ()\n"),
45 // The Servant Activator interface is created and initialised.
46 if (server
.create_activator (first_poa
) != 0)
47 ACE_ERROR_RETURN ((LM_ERROR
,
48 "Failure during first Servant Activator creation: create_activator()\n"),
51 // The Servant Locator interface is created and initialised.
52 if (server
.create_locator (second_poa
) !=0)
53 ACE_ERROR_RETURN ((LM_ERROR
,
54 "Failure during first Servant Locator creation: create_activator()\n"),
57 // The server begins processing requests.
58 if (server
.run () != 0)
59 ACE_ERROR_RETURN ((LM_ERROR
,
60 "Failure during request processing: run ()\n"),