1 #include "tao/Dynamic_TP/DTP_Config.h"
2 #include "ace/OS_NS_stdio.h"
3 #include "ace/Service_Config.h"
4 #include "ace/Dynamic_Service.h"
7 show_tp_config (const ACE_CString
&name
, const TAO_DTP_Definition
&entry
)
9 ACE_DEBUG ((LM_DEBUG
, ACE_TEXT ("Config set for %C:\n"), name
.c_str()));
10 ACE_DEBUG ((LM_DEBUG
, ACE_TEXT (" Initial threads: %d:\n"), entry
.init_threads_
));
11 ACE_DEBUG ((LM_DEBUG
, ACE_TEXT (" Min threads: %d:\n"), entry
.min_threads_
));
12 ACE_DEBUG ((LM_DEBUG
, ACE_TEXT (" Max threads: %d:\n"), entry
.max_threads_
));
13 if (entry
.min_threads_
> -1)
14 ACE_DEBUG ((LM_DEBUG
, ACE_TEXT (" Idle Timeout: %d (sec)\n"), entry
.timeout_
.sec()));
15 ACE_DEBUG ((LM_DEBUG
, ACE_TEXT (" Stack Size: %d:\n"), entry
.stack_size_
));
16 ACE_DEBUG ((LM_DEBUG
, ACE_TEXT (" Request queue max depth: %d\n"), entry
.queue_depth_
));
20 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
22 ACE_Service_Config::open (argc
, argv
);
24 ACE_Service_Gestalt
*current
= ACE_Service_Config::current();
25 TAO_DTP_Config_Registry
* registry
=
26 ACE_Dynamic_Service
<TAO_DTP_Config_Registry
>::instance
27 (current
, "DTP_Config_Registry", true);
31 ACE_DEBUG ((LM_DEBUG
, ACE_TEXT("Unable to load configuration\n")));
35 TAO_DTP_Definition entry
;
37 const ACE_TCHAR
*name_list
[] =
41 ACE_TEXT ("defaults"),
52 for (int i
= 0; name_list
[i
] != 0; i
++)
54 bool found
= registry
->find (ACE_TEXT_ALWAYS_CHAR (name_list
[i
]), entry
);
55 if (!found
&& (i
!= 1))
57 ACE_DEBUG ((LM_DEBUG
, ACE_TEXT("Cannot find TP Config definition for %C\n"), name_list
[i
]));
64 ACE_DEBUG ((LM_DEBUG
, ACE_TEXT("Found TP Config definition for %C which should have failed\n"), name_list
[i
]));
69 ACE_DEBUG ((LM_DEBUG
, ACE_TEXT("TP definition for %C not found as expected\n"), name_list
[i
]));
74 show_tp_config (ACE_TEXT_ALWAYS_CHAR (name_list
[i
]), entry
);