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
00025 #include "ace/Dynamic_Service.h"
00026 #include "ace/Arg_Shifter.h"
00027 #include "ace/Argv_Type_Converter.h"
00028 #include "ace/ARGV.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 81658 2008-05-09 10:40:45Z johnnyw $")
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 ACE_ARGV &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 ACE_ARGV &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 ACE_ARGV & svc_config_argv,
00120 bool & skip_service_config_open);
00121
00122
00123
00124
00125
00126
00127
00128
00129 int open_private_services_i (ACE_Intrusive_Auto_Ptr<ACE_Service_Gestalt> pcfg,
00130 int & argc,
00131 ACE_TCHAR **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 (mutex_)
00185 {
00186 }
00187
00188
00189 private:
00190
00191
00192
00193 ACE_Recursive_Thread_Mutex mutex_;
00194 };
00195 #endif // ACE_HAS_THREADS
00196
00197
00198
00199
00200
00201
00202 int
00203 TAO::ORB::open_global_services (int argc,
00204 ACE_TCHAR **argv)
00205 {
00206 {
00207
00208 static int orb_init_count = 0;
00209
00210
00211
00212 ACE_MT (ACE_GUARD_RETURN (TAO_SYNCH_RECURSIVE_MUTEX,
00213 guard,
00214 *ACE_Static_Object_Lock::instance (),
00215 -1));
00216
00217
00218
00219
00220 if (TAO_Singleton_Manager::instance ()->init () == -1)
00221 return -1;
00222
00223
00224 if (++orb_init_count > 1)
00225 return 0;
00226
00227 }
00228
00229
00230
00231 ACE_MT (ACE_GUARD_RETURN (TAO_SYNCH_RECURSIVE_MUTEX,
00232 guard,
00233 TAO_Ubergestalt_Ready_Condition::instance ()->mutex (),
00234 -1));
00235
00236 if (TAO_debug_level > 2)
00237 {
00238 ACE_DEBUG ((LM_DEBUG,
00239 ACE_TEXT ("TAO (%P|%t) Initializing the ")
00240 ACE_TEXT ("process-wide service context\n")));
00241 }
00242
00243 ACE_Service_Gestalt* theone = ACE_Service_Config::global ();
00244 ACE_Service_Config_Guard auto_config_guard (theone);
00245
00246 register_global_services_i (theone);
00247
00248
00249
00250
00251
00252
00253 ACE_ARGV global_svc_config_argv (true);
00254 global_svc_config_argv.add ((argc <= 0 || argv == 0) ? ACE_TEXT ("") : argv[0]);
00255
00256
00257
00258
00259 ACE_ARGV copyargv (argc, argv, true, true);
00260
00261
00262 int tmpargc = argc;
00263 ACE_Argv_Type_Converter cvtargv (tmpargc, copyargv.argv());
00264
00265 tmpargc = cvtargv.get_argc ();
00266 ACE_TCHAR **tmpargv = cvtargv.get_TCHAR_argv ();
00267
00268
00269
00270 if (parse_global_args_i (tmpargc,
00271 tmpargv,
00272 global_svc_config_argv,
00273 true) == -1)
00274 return -1;
00275
00276 bool skip_service_config_open = false;
00277
00278 if (parse_svcconf_args_i (tmpargc,
00279 tmpargv,
00280 global_svc_config_argv) == -1)
00281 return -1;
00282
00283 if (parse_private_args_i (tmpargc,
00284 tmpargv,
00285 global_svc_config_argv,
00286 skip_service_config_open) == -1)
00287 return -1;
00288
00289
00290 int global_svc_config_argc = global_svc_config_argv.argc ();
00291 int status = open_private_services_i (theone,
00292 global_svc_config_argc,
00293 global_svc_config_argv.argv (),
00294 skip_service_config_open);
00295
00296
00297 if (status == -1)
00298 {
00299 if (TAO_debug_level > 0)
00300 {
00301 ACE_ERROR ((LM_DEBUG,
00302 ACE_TEXT ("TAO (%P|%t) Failed to open process-")
00303 ACE_TEXT ("wide service configuration context\n")));
00304 }
00305
00306 return -1;
00307 }
00308
00309 if (TAO_debug_level > 2)
00310 ACE_DEBUG ((LM_DEBUG,
00311 ACE_TEXT ("TAO (%P|%t) Completed initializing the ")
00312 ACE_TEXT ("process-wide service context\n")));
00313
00314 if (TAO_debug_level > 4)
00315 ACE_DEBUG ((LM_DEBUG,
00316 ACE_TEXT ("TAO (%P|%t) Default ORB services initialization begins\n")));
00317
00318
00319 register_additional_services_i (theone);
00320
00321 if (TAO_debug_level > 4)
00322 ACE_DEBUG ((LM_DEBUG,
00323 ACE_TEXT ("TAO (%P|%t) Default ORB services initialization completed\n")));
00324
00325
00326
00327 is_ubergestalt_ready = true;
00328 ACE_MT (if (TAO_Ubergestalt_Ready_Condition::instance ()->
00329 broadcast () == -1)
00330 return -1);
00331
00332 return 0;
00333 }
00334
00335
00336
00337 int
00338 TAO::ORB::open_services (ACE_Intrusive_Auto_Ptr<ACE_Service_Gestalt> pcfg,
00339 int &argc,
00340 ACE_TCHAR **argv)
00341 {
00342 {
00343 ACE_MT (ACE_GUARD_RETURN (TAO_SYNCH_RECURSIVE_MUTEX,
00344 guard,
00345 TAO_Ubergestalt_Ready_Condition::instance ()->mutex (),
00346 -1));
00347
00348
00349
00350 if (service_open_count == 1)
00351 {
00352 if (TAO_debug_level > 4)
00353 ACE_DEBUG ((LM_DEBUG,
00354 ACE_TEXT ("TAO (%P|%t) Waiting for the default ")
00355 ACE_TEXT ("ORB to complete the global ")
00356 ACE_TEXT ("initialization\n")));
00357
00358 ACE_MT (while (!is_ubergestalt_ready)
00359 TAO_Ubergestalt_Ready_Condition::instance ()->wait ());
00360
00361 if (TAO_debug_level > 4)
00362 ACE_DEBUG ((LM_DEBUG,
00363 ACE_TEXT ("TAO (%P|%t) The default ")
00364 ACE_TEXT ("ORB must have completed the global ")
00365 ACE_TEXT ("initialization...\n")));
00366
00367 }
00368 else
00369 {
00370 if (TAO_debug_level > 4)
00371 ACE_DEBUG ((LM_DEBUG,
00372 ACE_TEXT ("TAO (%P|%t) We are %sthe default ")
00373 ACE_TEXT ("ORB ...\n"),
00374 (service_open_count == 0) ? "" : "not "));
00375 }
00376
00377 ++service_open_count;
00378 }
00379
00380
00381
00382
00383
00384 ACE_ARGV svc_config_argv (true);
00385 svc_config_argv.add ((argc <= 0 || argv == 0) ? ACE_TEXT ("") : argv[0]);
00386
00387
00388
00389 bool skip_service_config_open = false;
00390
00391
00392 if (parse_private_args_i (argc,
00393 argv,
00394 svc_config_argv,
00395 skip_service_config_open) == -1)
00396 {
00397 return -1;
00398 }
00399
00400
00401
00402 ACE_ARGV global_svc_config_argv;
00403
00404
00405
00406
00407 int status = parse_global_args_i(argc, argv, global_svc_config_argv, false);
00408
00409 if (status == -1 && TAO_debug_level > 0)
00410 ACE_DEBUG ((LM_DEBUG,
00411 ACE_TEXT ("TAO (%P|%t) Skipping the process-wide ")
00412 ACE_TEXT ("service configuration, service_open_count ")
00413 ACE_TEXT ("= %d, status = %d\n"),
00414 service_open_count,
00415 status));
00416
00417 if (TAO_debug_level > 2)
00418 ACE_DEBUG ((LM_DEBUG,
00419 ACE_TEXT ("TAO (%P|%t) Initializing the ")
00420 ACE_TEXT ("orb-specific services\n")));
00421
00422 if (parse_svcconf_args_i (argc, argv, svc_config_argv) == -1)
00423 return -1;
00424
00425
00426 if (pcfg != ACE_Service_Config::global())
00427 {
00428 int svc_config_argc = svc_config_argv.argc ();
00429 status =
00430 open_private_services_i (pcfg,
00431 svc_config_argc,
00432 svc_config_argv.argv (),
00433 skip_service_config_open);
00434 }
00435
00436 if (status < 0 && TAO_debug_level > 0)
00437 {
00438 ACE_ERROR_RETURN ((LM_DEBUG,
00439 ACE_TEXT ("TAO (%P|%t) Failed to ")
00440 ACE_TEXT ("open orb service configuration\n")),
00441 -1);
00442 }
00443
00444 return status;
00445 }
00446
00447 int
00448 TAO::ORB::close_services (ACE_Intrusive_Auto_Ptr<ACE_Service_Gestalt> pcfg)
00449 {
00450 ACE_MT (ACE_GUARD_RETURN (TAO_SYNCH_RECURSIVE_MUTEX,
00451 guard,
00452 *ACE_Static_Object_Lock::instance (),
00453 -1));
00454 --service_open_count;
00455
00456 if (pcfg == ACE_Service_Config::global())
00457 return 0;
00458
00459 return pcfg->close ();
00460 }
00461
00462 void
00463 TAO::ORB::default_svc_conf_entries (char const * rf_args,
00464 char const * ssf_args,
00465 char const * csf_args)
00466 {
00467 resource_factory_args = rf_args;
00468 server_strategy_factory_args = ssf_args;
00469 client_strategy_factory_args = csf_args;
00470 }
00471
00472 TAO_END_VERSIONED_NAMESPACE_DECL
00473
00474
00475 namespace
00476 {
00477
00478
00479 int
00480 open_private_services_i (ACE_Intrusive_Auto_Ptr<ACE_Service_Gestalt> pcfg,
00481 int & argc,
00482 ACE_TCHAR ** argv,
00483 bool skip_service_config_open,
00484 bool ignore_default_svc_conf_file)
00485 {
00486
00487 if (skip_service_config_open)
00488 {
00489 return 0;
00490 }
00491
00492 #if defined (TAO_PLATFORM_SVC_CONF_FILE_NOTSUP)
00493 ignore_default_svc_conf_file = true;
00494 #endif
00495
00496
00497 ACE_Argv_Type_Converter command_line (argc, argv);
00498
00499 return pcfg->open (command_line.get_argc (),
00500 command_line.get_TCHAR_argv (),
00501 ACE_DEFAULT_LOGGER_KEY,
00502 0,
00503 ignore_default_svc_conf_file);
00504 }
00505
00506
00507
00508 void
00509 register_global_services_i (ACE_Service_Gestalt * pcfg)
00510 {
00511
00512
00513
00514 if (negotiate_codesets)
00515 {
00516 TAO_Codeset_Manager_Factory_Base *factory =
00517 ACE_Dynamic_Service<TAO_Codeset_Manager_Factory_Base>::instance (
00518 "TAO_Codeset");
00519
00520 if (factory == 0 || factory->is_default ())
00521 {
00522 #if !defined (TAO_AS_STATIC_LIBS) && !(defined (ACE_VXWORKS) && !defined (__RTP__))
00523
00524
00525 ACE_Service_Config::process_directive (
00526 ACE_REMOVE_SERVICE_DIRECTIVE ("TAO_Codeset"));
00527
00528 ACE_Service_Config::process_directive (
00529 ACE_DYNAMIC_SERVICE_DIRECTIVE (
00530 "TAO_Codeset",
00531 "TAO_Codeset",
00532 "_make_TAO_Codeset_Manager_Factory",
00533 ""));
00534
00535 factory =
00536 ACE_Dynamic_Service<
00537 TAO_Codeset_Manager_Factory_Base
00538 >::instance ("TAO_Codeset");
00539 #endif
00540 }
00541
00542 if (factory == 0)
00543 {
00544 if (TAO_debug_level > 0)
00545 {
00546 ACE_ERROR ((LM_ERROR,
00547 ACE_TEXT ("(%P|%t) ORB_Core: ")
00548 ACE_TEXT ("Unable to initialize ")
00549 ACE_TEXT ("Codeset Manager\n")));
00550 }
00551 }
00552 }
00553
00554 pcfg->process_directive (
00555 ace_svc_desc_TAO_Default_Resource_Factory);
00556 pcfg->process_directive (
00557 ace_svc_desc_TAO_Default_Client_Strategy_Factory);
00558 pcfg->process_directive (
00559 ace_svc_desc_TAO_Default_Server_Strategy_Factory);
00560
00561
00562
00563
00564
00565
00566
00567
00568
00569
00570
00571 #if defined (TAO_HAS_IIOP) && (TAO_HAS_IIOP != 0)
00572 pcfg->process_directive (ace_svc_desc_TAO_IIOP_Protocol_Factory);
00573 #endif
00574
00575
00576 #if (TAO_HAS_MCAST_PARSER == 1)
00577 pcfg->process_directive (ace_svc_desc_TAO_MCAST_Parser);
00578 #endif
00579 #if (TAO_HAS_CORBANAME_PARSER == 1)
00580 pcfg->process_directive (ace_svc_desc_TAO_CORBANAME_Parser);
00581 #endif
00582 #if (TAO_HAS_CORBALOC_PARSER == 1)
00583 pcfg->process_directive (ace_svc_desc_TAO_CORBALOC_Parser);
00584 #endif
00585 #if (TAO_HAS_FILE_PARSER == 1)
00586 pcfg->process_directive (ace_svc_desc_TAO_FILE_Parser);
00587 #endif
00588 #if (TAO_HAS_DDL_PARSER == 1)
00589 pcfg->process_directive (ace_svc_desc_TAO_DLL_Parser);
00590 #endif
00591 #if (TAO_HAS_HTTP_PARSER == 1)
00592 pcfg->process_directive (ace_svc_desc_TAO_HTTP_Parser);
00593 #endif
00594 pcfg->process_directive (ace_svc_desc_TAO_Default_Stub_Factory);
00595 pcfg->process_directive (
00596 ace_svc_desc_TAO_Default_Endpoint_Selector_Factory);
00597 pcfg->process_directive (
00598 ace_svc_desc_TAO_Default_Thread_Lane_Resources_Manager_Factory);
00599 pcfg->process_directive (ace_svc_desc_TAO_Default_Collocation_Resolver);
00600
00601 }
00602
00603 void
00604 register_additional_services_i (ACE_Service_Gestalt * pcfg)
00605 {
00606
00607
00608
00609
00610
00611 if (resource_factory_args != 0)
00612 {
00613 pcfg->process_directive(
00614 ACE_TEXT_CHAR_TO_TCHAR (resource_factory_args));
00615 }
00616
00617 if (client_strategy_factory_args != 0)
00618 {
00619 pcfg->process_directive
00620 (ACE_TEXT_CHAR_TO_TCHAR (client_strategy_factory_args));
00621 }
00622
00623 if (server_strategy_factory_args != 0)
00624 {
00625 pcfg->process_directive
00626 (ACE_TEXT_CHAR_TO_TCHAR (server_strategy_factory_args));
00627 }
00628
00629 ACE_Service_Object * const pi_server_loader =
00630 ACE_Dynamic_Service<ACE_Service_Object>::instance (
00631 pcfg,
00632 "PI_Server_Loader");
00633
00634 if (pi_server_loader != 0)
00635 {
00636 pi_server_loader->init (0, 0);
00637 }
00638
00639 ACE_Service_Object * const bidir_loader =
00640 ACE_Dynamic_Service<ACE_Service_Object>::instance (
00641 pcfg,
00642 "BiDirGIOP_Loader");
00643
00644 if (bidir_loader != 0)
00645 {
00646 bidir_loader->init (0, 0);
00647 }
00648
00649 ACE_Service_Object * const messaging_loader =
00650 ACE_Dynamic_Service<ACE_Service_Object>::instance (
00651 pcfg,
00652 "Messaging_Loader");
00653
00654 if (messaging_loader != 0)
00655 {
00656 messaging_loader->init (0, 0);
00657 }
00658
00659
00660
00661
00662 ACE_Service_Object * const rt_loader =
00663 ACE_Dynamic_Service<ACE_Service_Object>::instance (
00664 pcfg,
00665 "RT_ORB_Loader");
00666
00667 if (rt_loader != 0)
00668 {
00669 rt_loader->init (0, 0);
00670 }
00671
00672 ACE_Service_Object * const rtscheduler_loader =
00673 ACE_Dynamic_Service<ACE_Service_Object>::instance (
00674 pcfg,
00675 "RTScheduler_Loader");
00676
00677 if (rtscheduler_loader != 0)
00678 {
00679 rtscheduler_loader->init (0, 0);
00680 }
00681
00682 ACE_Service_Object * const csd_framework_loader =
00683 ACE_Dynamic_Service<ACE_Service_Object>::instance (
00684 pcfg,
00685 "CSD_Framework_Loader");
00686
00687 if (csd_framework_loader != 0)
00688 {
00689 csd_framework_loader->init (0, 0);
00690 }
00691
00692 ACE_Service_Object * const endpoint_policy_loader =
00693 ACE_Dynamic_Service<ACE_Service_Object>::instance (
00694 pcfg,
00695 "EndpointPolicy_Initializer");
00696
00697 if (endpoint_policy_loader != 0)
00698 {
00699 endpoint_policy_loader->init (0, 0);
00700 }
00701
00702 ACE_Service_Object * const diffserv_policy_loader =
00703 ACE_Dynamic_Service<ACE_Service_Object>::instance (
00704 pcfg,
00705 "DiffservPolicy_Initializer");
00706
00707 if (diffserv_policy_loader != 0)
00708 {
00709 diffserv_policy_loader->init (0, 0);
00710 }
00711 }
00712
00713 int
00714 parse_svcconf_args_i (int &argc,
00715 ACE_TCHAR **argv,
00716 ACE_ARGV &svc_config_argv)
00717 {
00718
00719
00720 ACE_Arg_Shifter arg_shifter (argc, argv);
00721
00722 while (arg_shifter.is_anything_left ())
00723 {
00724
00725 if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT ("-ORBSvcConf")) == 0)
00726 {
00727 const ACE_TCHAR *current_arg =
00728 arg_shifter.get_the_parameter (ACE_TEXT ("-ORBSvcConf"));
00729 arg_shifter.consume_arg ();
00730
00731
00732 FILE * const conf_file =
00733 ACE_OS::fopen (current_arg, ACE_TEXT ("r"));
00734 if (0 == conf_file)
00735 {
00736
00737
00738
00739 errno = EINVAL;
00740
00741 ACE_ERROR_RETURN ((LM_ERROR,
00742 ACE_TEXT ("TAO (%P|%t) Unable to open file %s")
00743 ACE_TEXT (", referenced by -ORBSvcConf option\n"),
00744 current_arg),
00745 -1);
00746 }
00747 else
00748 {
00749 ACE_OS::fclose (conf_file);
00750 }
00751
00752 svc_config_argv.add (ACE_TEXT ("-f"));
00753 svc_config_argv.add (current_arg);
00754 }
00755 else
00756 {
00757
00758
00759 arg_shifter.ignore_arg ();
00760 }
00761 }
00762
00763 return 0;
00764 }
00765
00766 int
00767 parse_private_args_i (int &argc,
00768 ACE_TCHAR **argv,
00769 ACE_ARGV &svc_config_argv,
00770 bool & skip_service_config_open)
00771 {
00772
00773
00774 ACE_Arg_Shifter arg_shifter (argc, argv);
00775
00776 while (arg_shifter.is_anything_left ())
00777 {
00778 const ACE_TCHAR *current_arg = 0;
00779 if (0 == arg_shifter.cur_arg_strncasecmp
00780 (ACE_TEXT ("-ORBSkipServiceConfigOpen")))
00781 {
00782 skip_service_config_open = true;
00783
00784 arg_shifter.consume_arg ();
00785 }
00786 else if (0 != (current_arg = arg_shifter.get_the_parameter
00787 (ACE_TEXT ("-ORBSvcConfDirective"))))
00788 {
00789
00790
00791
00792
00793 svc_config_argv.add (ACE_TEXT ("-S"));
00794 svc_config_argv.add (current_arg, true);
00795
00796 arg_shifter.consume_arg ();
00797 }
00798 else if (0 != (current_arg = arg_shifter.get_the_parameter
00799 (ACE_TEXT ("-ORBServiceConfigLoggerKey"))))
00800 {
00801 svc_config_argv.add (ACE_TEXT ("-k"));
00802 svc_config_argv.add (current_arg, true);
00803
00804 arg_shifter.consume_arg ();
00805 }
00806 else if (0 == arg_shifter.cur_arg_strncasecmp
00807 (ACE_TEXT ("-ORBNegotiateCodesets")))
00808 {
00809
00810
00811
00812
00813 arg_shifter.ignore_arg();
00814
00815 if (0 != (current_arg = arg_shifter.get_current()))
00816 negotiate_codesets = (ACE_OS::atoi (current_arg));
00817
00818 arg_shifter.ignore_arg();
00819 }
00820 else if (0 != (current_arg =
00821 arg_shifter.get_the_parameter
00822 (ACE_TEXT ("-ORBDebugLevel"))))
00823 {
00824
00825
00826 TAO_debug_level = ACE_OS::atoi (current_arg);
00827
00828 arg_shifter.consume_arg ();
00829 }
00830 else
00831 {
00832
00833
00834
00835 arg_shifter.ignore_arg ();
00836 }
00837 }
00838
00839 return 0;
00840 }
00841
00842 int
00843 parse_global_args_i (int &argc,
00844 ACE_TCHAR **argv,
00845 ACE_ARGV &svc_config_argv,
00846 bool apply_values)
00847 {
00848
00849
00850
00851 #if defined (TAO_DEBUG) && !defined (ACE_HAS_WINCE)
00852
00853 if (apply_values)
00854 {
00855 TAO_debug_level = ACE_Env_Value<u_int> ("TAO_ORB_DEBUG", 0);
00856
00857 char * const value = ACE_OS::getenv ("TAO_ORB_DEBUG");
00858
00859 if (value != 0)
00860 {
00861 TAO_debug_level = ACE_OS::atoi (value);
00862
00863 if (TAO_debug_level <= 0)
00864 {
00865 TAO_debug_level = 1;
00866 }
00867
00868 ACE_DEBUG ((LM_DEBUG,
00869 ACE_TEXT ("TAO_debug_level == %d\n"),
00870 TAO_debug_level));
00871 }
00872 }
00873 #endif
00874
00875
00876
00877 ACE_Arg_Shifter arg_shifter (argc, argv);
00878
00879 while (arg_shifter.is_anything_left ())
00880 {
00881 if (0 == arg_shifter.cur_arg_strncasecmp (ACE_TEXT ("-ORBDebug")))
00882 {
00883 if (apply_values)
00884 {
00885
00886
00887 ACE::debug (1);
00888 }
00889
00890 arg_shifter.consume_arg ();
00891 }
00892 else if (0 == arg_shifter.cur_arg_strncasecmp
00893 (ACE_TEXT ("-ORBDaemon")))
00894 {
00895
00896 if (apply_values)
00897 {
00898 svc_config_argv.add (ACE_TEXT("-b"));
00899 }
00900
00901 arg_shifter.consume_arg ();
00902 }
00903
00904
00905 else
00906 {
00907
00908
00909 arg_shifter.ignore_arg ();
00910 }
00911 }
00912 return 0;
00913 }
00914 }