Search in sources :

Example 16 with POAManager

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;
    }
}
Also used : POAManager(org.omg.PortableServer.POAManager)

Example 17 with POAManager

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;
    }
}
Also used : POAManager(org.omg.PortableServer.POAManager)

Example 18 with POAManager

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;
}
Also used : POA(org.omg.PortableServer.POA) POAManager(org.omg.PortableServer.POAManager) NameComponent(org.omg.CosNaming.NameComponent) NamingContextExt(org.omg.CosNaming.NamingContextExt)

Aggregations

POAManager (org.omg.PortableServer.POAManager)18 POA (org.omg.PortableServer.POA)12 Properties (java.util.Properties)5 ClientPOA (si.ijs.maci.ClientPOA)5 ORB (org.omg.CORBA.ORB)3 HandleDataStore (com.cosylab.acs.maci.manager.HandleDataStore)2 ManagerImpl (com.cosylab.acs.maci.manager.ManagerImpl)2 CBstringPOA (alma.ACS.CBstringPOA)1 CBstringSeqPOA (alma.ACS.CBstringSeqPOA)1 AcsJException (alma.acs.exceptions.AcsJException)1 AcsORBProfilerImplBase (alma.acs.profiling.orb.AcsORBProfilerImplBase)1 StopWatch (alma.acs.util.StopWatch)1 ClientProxyImpl (com.cosylab.acs.maci.plug.ClientProxyImpl)1 IOException (java.io.IOException)1 URI (java.net.URI)1 ArrayList (java.util.ArrayList)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 CorbaDSIServant (org.apache.cxf.binding.corba.runtime.CorbaDSIServant)1 AcsORBProfiler (org.jacorb.orb.acs.AcsORBProfiler)1 AcsProfilingORB (org.jacorb.orb.acs.AcsProfilingORB)1