TAO提供的initial reference

应用程序需要可移值意味着它可以获取初始化对象引用。TAO提供了哪些初始化应用呢?我们可以通过程序来获取。

版本OCI TAO 1.6a

Windows XP

源代码:

#include "ace/OS_main.h"
#include "ace/Log_Msg.h"
#include "tao/tao/ObjectIdListC.h"
#include "tao/ORB.h"
#include "ace/streams.h"
int ACE_TMAIN(int argc, ACE_TCHAR *argv[])
{
	ACE_DEBUG((LM_DEBUG,ACE_TEXT("(%t) test start here./n")));
	try
	{
		CORBA::ORB_var orb = CORBA::ORB_init(argc,argv,"test");
	    CORBA::ORB_ObjectIdList_var lis = orb->list_initial_services();

		CORBA::ULong n = lis->length();
		for(CORBA::ULong index = 0UL; index < n; index ++)
		{
			 const char* name  = lis[index];
			 cout << index << "  " << name << endl;
		}
		orb->shutdown();
		orb->destroy();
	}	
	catch (CORBA::Exception& ex)
	{
		ex._tao_print_exception("main");
	}
	return 0;
}
 输出结果

0  NameService
1  TradingService
2  ImplRepoService
3  RootPOA
4  POACurrent
5  InterfaceRepository
6  ORBPolicyManager
7  PolicyCurrent
8  IORManipulation
9  IORTable
10  DynAnyFactory
11  TypeCodeFactory
12  CompressionManager
13  Monitor

你可能感兴趣的:(exception,XP,reference)