How I can start POA server with OAD in VisiBroker 4.5
How I resgistreit (give me example).
This is my Server:
main(int argc, char* argv[])
{
try
{
// Initialize the ORB and BOA
CORBA::ORB_var orb = CORBA::ORB_init(argc,argv);
CORBA::Object_var objRes=orb-> resolve_initial_references("RootPOA"
PortableServer:OA_var rootPOA=PortableServer:OA::_narrow(objRes);
PortableServer:OAManager_var poaManager=rootPOA->the_POAManager();
CORBA:olicyList policyList;
policyList.length(1);
policyList[0]=rootPOA->create_lifespan_policy(PortableServer:ERSISTENT);
PortableServer:OA_var myPOA=rootPOA->create_POA("hayde",poaManager,policyList);
PortableServer::ObjectId_var objId=PortableServer::string_tbjectId("HaydeObject"
HaydeImpl *servant=new HaydeImpl;
myPOA->activate_object_with_id(objId,servant);
poaManager->activate();
orb->run();
}
catch(const CORBA::Exception& e)
{
Cerr << e << endl;
return(1);
}
return 0;
}
//---------------------------------------------------------------------------
This is my Client:
CORBA::ORB_var orb=CORBA::ORB_init();
PortableServer::ObjectId_var objId=PortableServer::string_tbjectId("HaydeObject"
Hayde_var pobj=Hayde::_bind("/hayde",objId);
pobj->fun();
How I resgistreit (give me example).
This is my Server:
main(int argc, char* argv[])
{
try
{
// Initialize the ORB and BOA
CORBA::ORB_var orb = CORBA::ORB_init(argc,argv);
CORBA::Object_var objRes=orb-> resolve_initial_references("RootPOA"
PortableServer:OA_var rootPOA=PortableServer:OA::_narrow(objRes);
PortableServer:OAManager_var poaManager=rootPOA->the_POAManager();
CORBA:olicyList policyList;
policyList.length(1);
policyList[0]=rootPOA->create_lifespan_policy(PortableServer:ERSISTENT);
PortableServer:OA_var myPOA=rootPOA->create_POA("hayde",poaManager,policyList);
PortableServer::ObjectId_var objId=PortableServer::string_tbjectId("HaydeObject"
HaydeImpl *servant=new HaydeImpl;
myPOA->activate_object_with_id(objId,servant);
poaManager->activate();
orb->run();
}
catch(const CORBA::Exception& e)
{
Cerr << e << endl;
return(1);
}
return 0;
}
//---------------------------------------------------------------------------
This is my Client:
CORBA::ORB_var orb=CORBA::ORB_init();
PortableServer::ObjectId_var objId=PortableServer::string_tbjectId("HaydeObject"
Hayde_var pobj=Hayde::_bind("/hayde",objId);
pobj->fun();