00001
00002
00003 #include "tao/TAO_Internal.h"
00004 #include "tao/TAO_Singleton.h"
00005 #include "tao/default_server.h"
00006 #include "tao/default_client.h"
00007 #include "tao/default_resource.h"
00008 #include "tao/IIOP_Factory.h"
00009 #include "tao/MCAST_Parser.h"
00010 #include "tao/CORBANAME_Parser.h"
00011 #include "tao/CORBALOC_Parser.h"
00012 #include "tao/FILE_Parser.h"
00013 #include "tao/HTTP_Parser.h"
00014 #include "tao/DLL_Parser.h"
00015 #include "tao/ORB_Core.h"
00016 #include "tao/Adapter_Factory.h"
00017 #include "tao/Default_Stub_Factory.h"
00018 #include "tao/Default_Endpoint_Selector_Factory.h"
00019 #include "tao/Default_Thread_Lane_Resources_Manager.h"
00020 #include "tao/Default_Collocation_Resolver.h"
00021 #include "tao/Codeset_Manager_Factory_Base.h"
00022 #include "tao/Codeset_Manager.h"
00023 #include "tao/debug.h"
00024 #include "tao/StringSeqC.h"
00025
00026 #include "ace/Dynamic_Service.h"
00027 #include "ace/Arg_Shifter.h"
00028 #include "ace/Argv_Type_Converter.h"
00029 #include "ace/Env_Value_T.h"
00030 #include "ace/ACE.h"
00031 #include "ace/OS_NS_stdio.h"
00032 #include "ace/Static_Object_Lock.h"
00033
00034 ACE_RCSID (tao,
00035 TAO_Internal,
00036 "$Id: TAO_Internal.cpp 79495 2007-08-24 15:22:50Z mesnier_p $")
00037
00038 #ifndef TAO_DEFAULT_RESOURCE_FACTORY_ARGS
00039 # define TAO_DEFAULT_RESOURCE_FACTORY_ARGS 0
00040 #endif
00041
00042 #ifndef TAO_DEFAULT_SERVER_STRATEGY_FACTORY_ARGS
00043 # define TAO_DEFAULT_SERVER_STRATEGY_FACTORY_ARGS 0
00044 #endif
00045
00046 #ifndef TAO_DEFAULT_CLIENT_STRATEGY_FACTORY_ARGS
00047 # define TAO_DEFAULT_CLIENT_STRATEGY_FACTORY_ARGS 0
00048 #endif
00049
00050
00051 namespace
00052 {
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068 int
00069 parse_global_args_i (int &argc,
00070 ACE_TCHAR **argv,
00071 CORBA::StringSeq &svc_config_argv,
00072 bool apply_values);
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084 int
00085 parse_svcconf_args_i (int &argc,
00086 ACE_TCHAR **argv,
00087 CORBA::StringSeq &svc_config_argv);
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106 void register_global_services_i (ACE_Service_Gestalt * pcfg);
00107 void register_additional_services_i (ACE_Service_Gestalt * pcfg);
00108
00109
00110
00111
00112
00113
00114
00115
00116 int
00117 parse_private_args_i (int &argc,
00118 ACE_TCHAR **argv,
00119 CORBA::StringSeq & svc_config_argv,
00120 bool & skip_service_config_open);
00121
00122
00123
00124
00125
00126
00127
00128
00129 int open_private_services_i (ACE_Service_Gestalt* pcfg,
00130 int & argc,
00131 char ** argv,
00132 bool skip_service_config_open = false,
00133 bool ignore_default_svc_conf_file = false);
00134
00135
00136
00137
00138
00139
00140
00141 long service_open_count = 0;
00142
00143
00144
00145
00146
00147
00148
00149
00150 bool is_ubergestalt_ready = false;
00151
00152 char const * resource_factory_args =
00153 TAO_DEFAULT_RESOURCE_FACTORY_ARGS;
00154 char const * server_strategy_factory_args =
00155 TAO_DEFAULT_SERVER_STRATEGY_FACTORY_ARGS;
00156 char const * client_strategy_factory_args =
00157 TAO_DEFAULT_CLIENT_STRATEGY_FACTORY_ARGS;
00158
00159 #if (TAO_NEGOTIATE_CODESETS == 1)
00160 bool negotiate_codesets = true;
00161 #else
00162 bool negotiate_codesets = false;
00163 #endif
00164 }
00165
00166 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00167
00168 #if defined (ACE_HAS_THREADS)
00169
00170
00171
00172
00173 class TAO_Ubergestalt_Ready_Condition
00174 : public ACE_SYNCH_RECURSIVE_CONDITION
00175 {
00176 public:
00177 static TAO_Ubergestalt_Ready_Condition* instance (void)
00178 {
00179 return TAO_Singleton <TAO_Ubergestalt_Ready_Condition,
00180 TAO_SYNCH_RECURSIVE_MUTEX>::instance ();
00181 };
00182
00183 TAO_Ubergestalt_Ready_Condition (void)
00184 : ACE_SYNCH_RECURSIVE_CONDITION
00185 (this->mutex_)
00186 {
00187
00188 };
00189
00190 private:
00191
00192
00193
00194 ACE_Recursive_Thread_Mutex mutex_;
00195 };
00196 #endif // ACE_HAS_THREADS
00197
00198 int
00199 TAO::ORB::open_services (ACE_Service_Gestalt* pcfg,
00200 int &argc,
00201 ACE_TCHAR **argv)
00202 {
00203 {
00204 ACE_MT (ACE_GUARD_RETURN (TAO_SYNCH_RECURSIVE_MUTEX,
00205 guard,
00206 TAO_Ubergestalt_Ready_Condition::instance ()->mutex (),
00207 -1));
00208
00209
00210
00211 if (service_open_count == 1)
00212 {
00213 if (TAO_debug_level > 4)
00214 ACE_DEBUG ((LM_DEBUG,
00215 ACE_TEXT ("TAO (%P|%t) Waiting for the default ")
00216 ACE_TEXT ("ORB to complete the global ")
00217 ACE_TEXT ("initialization\n")));
00218
00219 ACE_MT (while (!is_ubergestalt_ready)
00220 TAO_Ubergestalt_Ready_Condition::instance ()->wait ());
00221
00222 if (TAO_debug_level > 4)
00223 ACE_DEBUG ((LM_DEBUG,
00224 ACE_TEXT ("TAO (%P|%t) The default ")
00225 ACE_TEXT ("ORB must have completed the global ")
00226 ACE_TEXT ("initialization...\n")));
00227
00228 }
00229 else
00230 {
00231 if (TAO_debug_level > 4)
00232 ACE_DEBUG ((LM_DEBUG,
00233 ACE_TEXT ("TAO (%P|%t) We are %sthe default ")
00234 ACE_TEXT ("ORB ...\n"),
00235 (service_open_count == 0) ? "" : "not "));
00236 }
00237
00238 ++service_open_count;
00239 }
00240
00241
00242
00243 CORBA::StringSeq svc_config_argv;
00244
00245
00246
00247 ACE_CString argv0 ("");
00248
00249 if (argc > 0 && argv != 0)
00250 {
00251 argv0 = ACE_TEXT_ALWAYS_CHAR (argv[0]);
00252 }
00253
00254 svc_config_argv.length (1);
00255 svc_config_argv[0] = argv0.c_str ();
00256
00257
00258
00259
00260
00261
00262
00263
00264 bool skip_service_config_open = false;
00265
00266
00267 if (parse_private_args_i (argc,
00268 argv,
00269 svc_config_argv,
00270 skip_service_config_open) == -1)
00271 {
00272 return -1;
00273 }
00274
00275
00276
00277 CORBA::StringSeq global_svc_config_argv;
00278
00279 ACE_Service_Gestalt * theone = ACE_Service_Config::global ();
00280
00281 if (service_open_count == 1)
00282 {
00283 ACE_Service_Config_Guard config_guard (theone);
00284
00285 if (TAO_debug_level > 2)
00286 {
00287 ACE_DEBUG ((LM_DEBUG,
00288 ACE_TEXT ("TAO (%P|%t) Initializing the ")
00289 ACE_TEXT ("process-wide services\n")));
00290 }
00291
00292 register_global_services_i (theone);
00293
00294
00295
00296 ACE_CString gargv0 ("");
00297
00298 if (argc > 0 && argv != 0)
00299 {
00300 gargv0 = ACE_TEXT_ALWAYS_CHAR (argv[0]);
00301 }
00302
00303 global_svc_config_argv.length (1);
00304 global_svc_config_argv[0] = gargv0.c_str ();
00305
00306 if (parse_global_args_i (argc, argv, global_svc_config_argv, true) == -1)
00307 {
00308 return -1;
00309 }
00310
00311 if (parse_svcconf_args_i (argc, argv, global_svc_config_argv) == -1)
00312 {
00313 return -1;
00314 }
00315
00316
00317
00318 if (pcfg == theone && svc_config_argv.length() > 1)
00319 {
00320 CORBA::ULong glen = global_svc_config_argv.length();
00321 global_svc_config_argv.length(glen + svc_config_argv.length() - 1);
00322 for (CORBA::ULong i = 1; i < svc_config_argv.length(); i++)
00323 global_svc_config_argv[glen++] = svc_config_argv[i];
00324 svc_config_argv.length(1);
00325 }
00326
00327 int global_svc_config_argc = global_svc_config_argv.length ();
00328 int status =
00329 open_private_services_i (theone,
00330 global_svc_config_argc,
00331 global_svc_config_argv.get_buffer (),
00332 skip_service_config_open);
00333
00334 if (status == -1)
00335 {
00336 if (TAO_debug_level > 0)
00337 {
00338 ACE_ERROR ((LM_DEBUG,
00339 ACE_TEXT ("TAO (%P|%t) Failed to open process-")
00340 ACE_TEXT ("wide service configuration\n")));
00341 }
00342
00343 return -1;
00344 }
00345
00346 register_additional_services_i (theone);
00347
00348 if (TAO_debug_level > 4)
00349 ACE_DEBUG ((LM_DEBUG,
00350 ACE_TEXT ("TAO (%P|%t) Default ORB - global ")
00351 ACE_TEXT ("initialization completed.\n")));
00352
00353
00354
00355 {
00356 ACE_MT (ACE_GUARD_RETURN (TAO_SYNCH_RECURSIVE_MUTEX,
00357 guard,
00358 TAO_Ubergestalt_Ready_Condition::instance ()->mutex (),
00359 -1));
00360
00361 is_ubergestalt_ready = true;
00362 ACE_MT (if (TAO_Ubergestalt_Ready_Condition::instance ()->
00363 broadcast () == -1)
00364 return -1);
00365 }
00366
00367 }
00368 else
00369 {
00370 int status =
00371 parse_global_args_i(argc, argv,global_svc_config_argv, false);
00372 if (status == -1 && TAO_debug_level > 0)
00373 ACE_DEBUG ((LM_DEBUG,
00374 ACE_TEXT ("TAO (%P|%t) Skipping the process-wide ")
00375 ACE_TEXT ("service configuration, service_open_count ")
00376 ACE_TEXT ("= %d, status = %d\n"),
00377 service_open_count,
00378 status));
00379 }
00380
00381 if (TAO_debug_level > 2)
00382 {
00383 ACE_DEBUG ((LM_DEBUG,
00384 ACE_TEXT ("TAO (%P|%t) Initializing the ")
00385 ACE_TEXT ("orb-specific services\n")));
00386 }
00387
00388 if (parse_svcconf_args_i (argc, argv, svc_config_argv) == -1)
00389 {
00390 return -1;
00391 }
00392
00393 int status = 0;
00394
00395 if (pcfg != ACE_Service_Config::global())
00396 {
00397 int svc_config_argc = svc_config_argv.length ();
00398 status =
00399 open_private_services_i (pcfg,
00400 svc_config_argc,
00401 svc_config_argv.get_buffer (),
00402 skip_service_config_open);
00403 }
00404
00405 if (status >= 0)
00406 {
00407 return 0;
00408 }
00409
00410 if (TAO_debug_level > 0)
00411 {
00412 ACE_ERROR_RETURN ((LM_DEBUG,
00413 ACE_TEXT ("TAO (%P|%t) Failed to ")
00414 ACE_TEXT ("open orb service configuration\n")),
00415 -1);
00416 }
00417
00418 return -1;
00419 }
00420
00421 int
00422 TAO::ORB::close_services (ACE_Service_Gestalt* pcfg)
00423 {
00424 ACE_MT (ACE_GUARD_RETURN (TAO_SYNCH_RECURSIVE_MUTEX,
00425 guard,
00426 *ACE_Static_Object_Lock::instance (),
00427 -1));
00428 service_open_count--;
00429
00430 if (pcfg == ACE_Service_Config::global())
00431 return 0;
00432 return pcfg->close ();
00433 }
00434
00435 void
00436 TAO::ORB::default_svc_conf_entries (char const * rf_args,
00437 char const * ssf_args,
00438 char const * csf_args)
00439 {
00440 resource_factory_args = rf_args;
00441 server_strategy_factory_args = ssf_args;
00442 client_strategy_factory_args = csf_args;
00443 }
00444
00445 TAO_END_VERSIONED_NAMESPACE_DECL
00446
00447
00448 namespace
00449 {
00450
00451
00452 int
00453 open_private_services_i (ACE_Service_Gestalt * pcfg,
00454 int & argc,
00455 char ** argv,
00456 bool skip_service_config_open,
00457 bool ignore_default_svc_conf_file)
00458 {
00459
00460 if (skip_service_config_open)
00461 {
00462 return 0;
00463 }
00464
00465 #if defined (TAO_PLATFORM_SVC_CONF_FILE_NOTSUP)
00466 ignore_default_svc_conf_file = true;
00467 #endif
00468
00469
00470 ACE_Argv_Type_Converter command_line (argc, argv);
00471
00472 return pcfg->open (command_line.get_argc (),
00473 command_line.get_TCHAR_argv (),
00474 ACE_DEFAULT_LOGGER_KEY,
00475 0,
00476 ignore_default_svc_conf_file);
00477 }
00478
00479
00480
00481 void
00482 register_global_services_i (ACE_Service_Gestalt * pcfg)
00483 {
00484
00485
00486
00487 if (negotiate_codesets)
00488 {
00489 TAO_Codeset_Manager_Factory_Base *factory =
00490 ACE_Dynamic_Service<TAO_Codeset_Manager_Factory_Base>::instance (
00491 "TAO_Codeset");
00492
00493 if (factory == 0 || factory->is_default ())
00494 {
00495 #if !defined (TAO_AS_STATIC_LIBS)
00496
00497
00498 ACE_Service_Config::process_directive (
00499 ACE_REMOVE_SERVICE_DIRECTIVE ("TAO_Codeset"));
00500
00501 ACE_Service_Config::process_directive (
00502 ACE_DYNAMIC_SERVICE_DIRECTIVE (
00503 "TAO_Codeset",
00504 "TAO_Codeset",
00505 "_make_TAO_Codeset_Manager_Factory",
00506 ""));
00507
00508 factory =
00509 ACE_Dynamic_Service<
00510 TAO_Codeset_Manager_Factory_Base
00511 >::instance ("TAO_Codeset");
00512 #endif
00513 }
00514
00515 if (factory == 0)
00516 {
00517 if (TAO_debug_level > 0)
00518 {
00519 ACE_ERROR ((LM_ERROR,
00520 ACE_TEXT ("(%P|%t) ORB_Core: ")
00521 ACE_TEXT ("Unable to initialize ")
00522 ACE_TEXT ("Codeset Manager\n")));
00523 }
00524 }
00525 }
00526
00527 pcfg->process_directive (
00528 ace_svc_desc_TAO_Default_Resource_Factory);
00529 pcfg->process_directive (
00530 ace_svc_desc_TAO_Default_Client_Strategy_Factory);
00531 pcfg->process_directive (
00532 ace_svc_desc_TAO_Default_Server_Strategy_Factory);
00533
00534
00535
00536
00537
00538
00539
00540
00541
00542
00543
00544 #if defined (TAO_HAS_IIOP) && (TAO_HAS_IIOP != 0)
00545 pcfg->process_directive (ace_svc_desc_TAO_IIOP_Protocol_Factory);
00546 #endif
00547
00548
00549 #if (TAO_HAS_MCAST_PARSER == 1)
00550 pcfg->process_directive (ace_svc_desc_TAO_MCAST_Parser);
00551 #endif
00552 #if (TAO_HAS_CORBANAME_PARSER == 1)
00553 pcfg->process_directive (ace_svc_desc_TAO_CORBANAME_Parser);
00554 #endif
00555 #if (TAO_HAS_CORBALOC_PARSER == 1)
00556 pcfg->process_directive (ace_svc_desc_TAO_CORBALOC_Parser);
00557 #endif
00558 #if (TAO_HAS_FILE_PARSER == 1)
00559 pcfg->process_directive (ace_svc_desc_TAO_FILE_Parser);
00560 #endif
00561 #if (TAO_HAS_DDL_PARSER == 1)
00562 pcfg->process_directive (ace_svc_desc_TAO_DLL_Parser);
00563 #endif
00564 #if (TAO_HAS_HTTP_PARSER == 1)
00565 pcfg->process_directive (ace_svc_desc_TAO_HTTP_Parser);
00566 #endif
00567 pcfg->process_directive (ace_svc_desc_TAO_Default_Stub_Factory);
00568 pcfg->process_directive (
00569 ace_svc_desc_TAO_Default_Endpoint_Selector_Factory);
00570 pcfg->process_directive (
00571 ace_svc_desc_TAO_Default_Thread_Lane_Resources_Manager_Factory);
00572 pcfg->process_directive (ace_svc_desc_TAO_Default_Collocation_Resolver);
00573
00574 }
00575
00576 void
00577 register_additional_services_i (ACE_Service_Gestalt * pcfg)
00578 {
00579
00580
00581
00582
00583
00584 if (resource_factory_args != 0)
00585 {
00586 pcfg->process_directive(
00587 ACE_TEXT_CHAR_TO_TCHAR (resource_factory_args));
00588 }
00589
00590 if (client_strategy_factory_args != 0)
00591 {
00592 pcfg->process_directive
00593 (ACE_TEXT_CHAR_TO_TCHAR (client_strategy_factory_args));
00594 }
00595
00596 if (server_strategy_factory_args != 0)
00597 {
00598 pcfg->process_directive
00599 (ACE_TEXT_CHAR_TO_TCHAR (server_strategy_factory_args));
00600 }
00601
00602 ACE_Service_Object * const pi_server_loader =
00603 ACE_Dynamic_Service<ACE_Service_Object>::instance (
00604 pcfg,
00605 "PI_Server_Loader");
00606
00607 if (pi_server_loader != 0)
00608 {
00609 pi_server_loader->init (0, 0);
00610 }
00611
00612 ACE_Service_Object * const bidir_loader =
00613 ACE_Dynamic_Service<ACE_Service_Object>::instance (
00614 pcfg,
00615 "BiDirGIOP_Loader");
00616
00617 if (bidir_loader != 0)
00618 {
00619 bidir_loader->init (0, 0);
00620 }
00621
00622 ACE_Service_Object * const messaging_loader =
00623 ACE_Dynamic_Service<ACE_Service_Object>::instance (
00624 pcfg,
00625 "Messaging_Loader");
00626
00627 if (messaging_loader != 0)
00628 {
00629 messaging_loader->init (0, 0);
00630 }
00631
00632
00633
00634
00635 ACE_Service_Object * const rt_loader =
00636 ACE_Dynamic_Service<ACE_Service_Object>::instance (
00637 pcfg,
00638 "RT_ORB_Loader");
00639
00640 if (rt_loader != 0)
00641 {
00642 rt_loader->init (0, 0);
00643 }
00644
00645 ACE_Service_Object * const rtscheduler_loader =
00646 ACE_Dynamic_Service<ACE_Service_Object>::instance (
00647 pcfg,
00648 "RTScheduler_Loader");
00649
00650 if (rtscheduler_loader != 0)
00651 {
00652 rtscheduler_loader->init (0, 0);
00653 }
00654
00655 ACE_Service_Object * const csd_framework_loader =
00656 ACE_Dynamic_Service<ACE_Service_Object>::instance (
00657 pcfg,
00658 "CSD_Framework_Loader");
00659
00660 if (csd_framework_loader != 0)
00661 {
00662 csd_framework_loader->init (0, 0);
00663 }
00664
00665 ACE_Service_Object * const endpoint_policy_loader =
00666 ACE_Dynamic_Service<ACE_Service_Object>::instance (
00667 pcfg,
00668 "EndpointPolicy_Initializer");
00669
00670 if (endpoint_policy_loader != 0)
00671 {
00672 endpoint_policy_loader->init (0, 0);
00673 }
00674
00675 ACE_Service_Object * const diffserv_policy_loader =
00676 ACE_Dynamic_Service<ACE_Service_Object>::instance (
00677 pcfg,
00678 "DiffservPolicy_Initializer");
00679
00680 if (diffserv_policy_loader != 0)
00681 {
00682 diffserv_policy_loader->init (0, 0);
00683 }
00684 }
00685
00686 int
00687 parse_svcconf_args_i (int &argc,
00688 ACE_TCHAR **argv,
00689 CORBA::StringSeq &svc_config_argv)
00690 {
00691
00692
00693 ACE_Arg_Shifter arg_shifter (argc, argv);
00694 CORBA::ULong len = 0;
00695
00696 while (arg_shifter.is_anything_left ())
00697 {
00698 const ACE_TCHAR *current_arg =
00699 arg_shifter.get_the_parameter (ACE_TEXT ("-ORBSvcConf"));
00700
00701 if (0 != current_arg)
00702 {
00703
00704
00705
00706 FILE * const conf_file =
00707 ACE_OS::fopen (current_arg, ACE_TEXT ("r"));
00708
00709 if (0 == conf_file)
00710 {
00711
00712
00713
00714 errno = EINVAL;
00715
00716 ACE_ERROR_RETURN ((LM_ERROR,
00717 ACE_TEXT ("TAO (%P|%t) Service ")
00718 ACE_TEXT ("Configurator ")
00719 ACE_TEXT ("unable to open file %s\n"),
00720 current_arg),
00721 -1);
00722 }
00723 else
00724 {
00725 ACE_OS::fclose (conf_file);
00726 }
00727
00728 len = svc_config_argv.length ();
00729 svc_config_argv.length (len + 2);
00730
00731 svc_config_argv[len] = CORBA::string_dup ("-f");
00732 svc_config_argv[len + 1] =
00733 CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (current_arg));
00734
00735 arg_shifter.consume_arg ();
00736 }
00737
00738 else
00739 {
00740
00741
00742 arg_shifter.ignore_arg ();
00743 }
00744 }
00745
00746 return 0;
00747 }
00748
00749 int
00750 parse_private_args_i (int &argc,
00751 ACE_TCHAR **argv,
00752 CORBA::StringSeq &svc_config_argv,
00753 bool & skip_service_config_open)
00754 {
00755
00756
00757 ACE_Arg_Shifter arg_shifter (argc, argv);
00758 CORBA::ULong len = 0;
00759
00760 while (arg_shifter.is_anything_left ())
00761 {
00762 const ACE_TCHAR *current_arg = 0;
00763 if (0 == arg_shifter.cur_arg_strncasecmp
00764 (ACE_TEXT ("-ORBSkipServiceConfigOpen")))
00765 {
00766 skip_service_config_open = true;
00767
00768 arg_shifter.consume_arg ();
00769 }
00770 else if (0 != (current_arg = arg_shifter.get_the_parameter
00771 (ACE_TEXT ("-ORBSvcConfDirective"))))
00772 {
00773 len = svc_config_argv.length ();
00774 svc_config_argv.length (len + 2);
00775
00776
00777
00778
00779
00780 svc_config_argv[len] = CORBA::string_dup ("-S");
00781 svc_config_argv[len + 1] =
00782 CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (current_arg));
00783
00784 arg_shifter.consume_arg ();
00785 }
00786 else if (0 != (current_arg = arg_shifter.get_the_parameter
00787 (ACE_TEXT ("-ORBServiceConfigLoggerKey"))))
00788 {
00789 len = svc_config_argv.length ();
00790 svc_config_argv.length (len + 2);
00791
00792 svc_config_argv[len] = CORBA::string_dup ("-k");
00793 svc_config_argv[len + 1] =
00794 CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (current_arg));
00795
00796 arg_shifter.consume_arg ();
00797 }
00798 else if (0 == arg_shifter.cur_arg_strncasecmp
00799 (ACE_TEXT ("-ORBNegotiateCodesets")))
00800 {
00801
00802
00803
00804
00805 arg_shifter.ignore_arg();
00806
00807 if (0 != (current_arg = arg_shifter.get_current()))
00808 negotiate_codesets = (ACE_OS::atoi (current_arg));
00809 arg_shifter.ignore_arg();
00810 }
00811 else if (0 != (current_arg =
00812 arg_shifter.get_the_parameter
00813 (ACE_TEXT ("-ORBDebugLevel"))))
00814 {
00815
00816
00817 TAO_debug_level = ACE_OS::atoi (current_arg);
00818
00819 arg_shifter.consume_arg ();
00820 }
00821 else
00822 {
00823
00824
00825
00826 arg_shifter.ignore_arg ();
00827 }
00828 }
00829
00830 return 0;
00831 }
00832
00833 int
00834 parse_global_args_i (int &argc,
00835 ACE_TCHAR **argv,
00836 CORBA::StringSeq &svc_config_argv,
00837 bool apply_values)
00838 {
00839
00840
00841
00842 #if defined (TAO_DEBUG) && !defined (ACE_HAS_WINCE)
00843
00844 if (apply_values)
00845 {
00846 TAO_debug_level = ACE_Env_Value<u_int> ("TAO_ORB_DEBUG", 0);
00847
00848 char * const value = ACE_OS::getenv ("TAO_ORB_DEBUG");
00849
00850 if (value != 0)
00851 {
00852 TAO_debug_level = ACE_OS::atoi (value);
00853
00854 if (TAO_debug_level <= 0)
00855 {
00856 TAO_debug_level = 1;
00857 }
00858
00859 ACE_DEBUG ((LM_DEBUG,
00860 ACE_TEXT ("TAO_debug_level == %d\n"),
00861 TAO_debug_level));
00862 }
00863 }
00864 #endif
00865
00866
00867
00868 ACE_Arg_Shifter arg_shifter (argc, argv);
00869 CORBA::ULong len = 0;
00870
00871 while (arg_shifter.is_anything_left ())
00872 {
00873 if (0 == arg_shifter.cur_arg_strncasecmp (ACE_TEXT ("-ORBDebug")))
00874 {
00875 if (apply_values)
00876 {
00877
00878
00879 ACE::debug (1);
00880 }
00881
00882 arg_shifter.consume_arg ();
00883 }
00884 else if (0 == arg_shifter.cur_arg_strncasecmp
00885 (ACE_TEXT ("-ORBDaemon")))
00886 {
00887
00888 if (apply_values)
00889 {
00890 len = svc_config_argv.length ();
00891 svc_config_argv.length (len + 1);
00892
00893 svc_config_argv[len] =
00894 CORBA::string_dup ("-b");
00895 }
00896
00897 arg_shifter.consume_arg ();
00898 }
00899
00900
00901 else
00902 {
00903
00904
00905 arg_shifter.ignore_arg ();
00906 }
00907 }
00908 return 0;
00909 }
00910 }