use of org.omg.PortableServer.POAManager in project ACS by ACS-Community.
the class PropertyPrimTest method initCORBA.
/**
* Initialize CORBA.
*/
private void initCORBA() throws Exception {
orb = ORB.init(new String[0], System.getProperties());
// POA stanza, use rootPOA
try {
// resolve RootPOA
rootPOA = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
// activate POA
POAManager manager = rootPOA.the_POAManager();
manager.activate();
// spawn ORB thread
new Thread(new Runnable() {
public void run() {
orb.run();
}
}, "CORBA").start();
} catch (Exception e) {
throw e;
}
}
use of org.omg.PortableServer.POAManager in project ACS by ACS-Community.
the class EnumPropertyTest method initCORBA.
/**
* Initialize CORBA.
*/
private void initCORBA() throws Exception {
orb = ORB.init(new String[0], System.getProperties());
// POA stanza, use rootPOA
try {
// resolve RootPOA
rootPOA = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
// activate POA
POAManager manager = rootPOA.the_POAManager();
manager.activate();
// spawn ORB thread
new Thread(new Runnable() {
public void run() {
orb.run();
}
}, "CORBA").start();
} catch (Exception e) {
throw e;
}
}
use of org.omg.PortableServer.POAManager in project cxf by apache.
the class Server method run.
static int run(ORB orb, String[] args) throws UserException {
// Resolve Root POA
POA poa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
// Get a reference to the POA manager
POAManager manager = poa.the_POAManager();
// Create implementation object
HelloWorldImpl hwImpl = new HelloWorldImpl(poa);
byte[] oid = "HelloWorld".getBytes();
poa.activate_object_with_id(oid, hwImpl);
org.omg.CORBA.Object ref = poa.create_reference_with_id(oid, HelloWorldHelper.id());
// Register in NameService
org.omg.CORBA.Object nsObj = orb.resolve_initial_references("NameService");
NamingContextExt rootContext = NamingContextExtHelper.narrow(nsObj);
NameComponent[] nc = rootContext.to_name("HelloWorld");
rootContext.rebind(nc, ref);
// Run implementation
manager.activate();
System.out.println("Server ready...");
orb.run();
return 0;
}
Aggregations