diff options
Diffstat (limited to 'TAO/orbsvcs/Dump_Schedule/Dump_Schedule.cpp')
-rw-r--r-- | TAO/orbsvcs/Dump_Schedule/Dump_Schedule.cpp | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/TAO/orbsvcs/Dump_Schedule/Dump_Schedule.cpp b/TAO/orbsvcs/Dump_Schedule/Dump_Schedule.cpp index dfcd8010711..fc8372e0691 100644 --- a/TAO/orbsvcs/Dump_Schedule/Dump_Schedule.cpp +++ b/TAO/orbsvcs/Dump_Schedule/Dump_Schedule.cpp @@ -18,29 +18,39 @@ int main (int argc, char *argv[]) TAO_TRY { // Initialize ORB. - CORBA::ORB_ptr orb = - CORBA::ORB_init (argc, argv, "dump_schedule", TAO_TRY_ENV); + CORBA::ORB_var orb = + CORBA::ORB_init (argc, argv, "internet", TAO_TRY_ENV); TAO_CHECK_ENV; - CORBA::POA_ptr poa = - orb->POA_init(argc, argv, "POA"); - if (poa == 0) - { - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize the POA.\n"), - 1); - } + CORBA::Object_var poa_object = + orb->resolve_initial_references("RootPOA"); + if (poa_object == 0) + ACE_ERROR_RETURN ((LM_ERROR, + " (%P|%t) Unable to initialize the POA.\n"), + 1); - CORBA::Object_ptr objref = - orb->resolve_initial_references ("NameService"); + PortableServer::POA_var root_poa = + PortableServer::POA::_narrow (poa_object, TAO_TRY_ENV); + TAO_CHECK_ENV; + + PortableServer::POAManager_var poa_manager = + root_poa->the_POAManager (TAO_TRY_ENV); TAO_CHECK_ENV; + + CORBA::Object_var naming_obj = + orb->resolve_initial_references ("NameService"); + if (naming_obj == 0) + ACE_ERROR_RETURN ((LM_ERROR, + " (%P|%t) Unable to initialize the POA.\n"), + 1); + CosNaming::NamingContext_var naming_context = - CosNaming::NamingContext::_narrow (objref, TAO_TRY_ENV); + CosNaming::NamingContext::_narrow (naming_obj, TAO_TRY_ENV); TAO_CHECK_ENV; - ACE_Scheduler_Factory::use_config (naming_context.ptr ()); + ACE_Scheduler_Factory::use_config (naming_context.in ()); - RtecScheduler::RT_Info_Set* infos; + RtecScheduler::RT_Info_Set_var infos; ACE_Scheduler_Factory::server ()->compute_scheduling (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO, ACE_SCOPE_THREAD), @@ -49,9 +59,8 @@ int main (int argc, char *argv[]) infos, TAO_TRY_ENV); TAO_CHECK_ENV; - ACE_Scheduler_Factory::dump_schedule (*infos, + ACE_Scheduler_Factory::dump_schedule (infos.in (), "Scheduler_Runtime.cpp"); - delete infos; } TAO_CATCH (CORBA::SystemException, sys_ex) { |