How to convert BOA to POA
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Dimonius_Severyanin
Posted On:   Sunday, December 10, 2006 05:44 AM

Hello Everyone I have a program implemented for older version of CORBA with using BOA adapters. Please, help me, and say how to convert program code from using BOA to using POA? Here is the part of code, which should be changed Register Server with Naming Service //Register ServerImpl object with Naming Service public void register( String serverName, String [] parameters ) throws NotFound, CannotProceed, org.omg.CosNaming.NamingContextPackage.InvalidName, org.omg.CORBA.ORBPackage.InvalidName { if ( serverName == null ) throw new IllegalArgumentException("Registration name can not be null" ); // Bind ServerImpl object to Naming Service   More>>

Hello Everyone


I have a program implemented for older version of CORBA with using BOA adapters. Please, help me, and say how to convert program code from using BOA to using POA?



Here is the part of code, which should be changed


Register Server with Naming Service



//Register ServerImpl object with Naming Service

public void register( String serverName, String [] parameters ) throws NotFound, CannotProceed,
org.omg.CosNaming.NamingContextPackage.InvalidName,
org.omg.CORBA.ORBPackage.InvalidName

{

if ( serverName == null )

throw new IllegalArgumentException("Registration name can not be null" );

// Bind ServerImpl object to Naming Service.

// Create and initialize ORB.

orb = ORB.init( parameters, null );

// create servant and register it with ORB

//with POA here is an error

orb.connect( this );



org.omg.CORBA.Object corbaObject = orb.resolve_initial_references( "NameService" );

NamingContext naming = NamingContextHelper.narrow( corbaObject );

NameComponent namingComponent = new NameComponent( serverName, "" );

NameComponent path[] = { namingComponent };

naming.rebind( path, this );

System.out.println( "Server bound to naming" );

}



Find server by client



// find Server remote object

ORB orb = ORB.init( configurationParameters, null );

org.omg.CORBA.Object corbaObject = orb.resolve_initial_references( "NameService" );

NamingContext naming = NamingContextHelper.narrow( corbaObject );



// Resolve the object reference in naming

NameComponent nameComponent = new NameComponent( Server.NAME, "" );

NameComponent path[] = { nameComponent };

myServer = ServerHelper.narrow( naming.resolve( path ) );



Maybe someone knew how to do it. Please HELP ME!!!

Or bring me a link, where described how to resolve this kind of problem

   <<Less

Re: How to convert BOA to POA

Posted By:   Anonymous  
Posted On:   Wednesday, January 10, 2007 10:18 AM

You need to first retrieve a special POA called the RootPOA:


ORB orb = ORB.init( args, null );

POA rootPOA = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));


For more info see Sun's doc

About | Sitemap | Contact