Java Code Examples for org.omg.PortableServer.POA#servant_to_reference()

The following examples show how to use org.omg.PortableServer.POA#servant_to_reference() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StubAdapter.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/** Use implicit activation to get an object reference for the servant.
 */
public static org.omg.CORBA.Object activateServant( Servant servant )
{
    POA poa = servant._default_POA() ;
    org.omg.CORBA.Object ref = null ;

    try {
        ref = poa.servant_to_reference( servant ) ;
    } catch (ServantNotActive sna) {
        throw wrapper.getDelegateServantNotActive( sna ) ;
    } catch (WrongPolicy wp) {
        throw wrapper.getDelegateWrongPolicy( wp ) ;
    }

    // Make sure that the POAManager is activated if no other
    // POAManager state management has taken place.
    POAManager mgr = poa.the_POAManager() ;
    if (mgr instanceof POAManagerImpl) {
        POAManagerImpl mgrImpl = (POAManagerImpl)mgr ;
        mgrImpl.implicitActivation() ;
    }

    return ref ;
}
 
Example 2
Source File: StubAdapter.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/** Use implicit activation to get an object reference for the servant.
 */
public static org.omg.CORBA.Object activateServant( Servant servant )
{
    POA poa = servant._default_POA() ;
    org.omg.CORBA.Object ref = null ;

    try {
        ref = poa.servant_to_reference( servant ) ;
    } catch (ServantNotActive sna) {
        throw wrapper.getDelegateServantNotActive( sna ) ;
    } catch (WrongPolicy wp) {
        throw wrapper.getDelegateWrongPolicy( wp ) ;
    }

    // Make sure that the POAManager is activated if no other
    // POAManager state management has taken place.
    POAManager mgr = poa.the_POAManager() ;
    if (mgr instanceof POAManagerImpl) {
        POAManagerImpl mgrImpl = (POAManagerImpl)mgr ;
        mgrImpl.implicitActivation() ;
    }

    return ref ;
}
 
Example 3
Source File: StubAdapter.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/** Use implicit activation to get an object reference for the servant.
 */
public static org.omg.CORBA.Object activateServant( Servant servant )
{
    POA poa = servant._default_POA() ;
    org.omg.CORBA.Object ref = null ;

    try {
        ref = poa.servant_to_reference( servant ) ;
    } catch (ServantNotActive sna) {
        throw wrapper.getDelegateServantNotActive( sna ) ;
    } catch (WrongPolicy wp) {
        throw wrapper.getDelegateWrongPolicy( wp ) ;
    }

    // Make sure that the POAManager is activated if no other
    // POAManager state management has taken place.
    POAManager mgr = poa.the_POAManager() ;
    if (mgr instanceof POAManagerImpl) {
        POAManagerImpl mgrImpl = (POAManagerImpl)mgr ;
        mgrImpl.implicitActivation() ;
    }

    return ref ;
}
 
Example 4
Source File: StubAdapter.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/** Use implicit activation to get an object reference for the servant.
 */
public static org.omg.CORBA.Object activateServant( Servant servant )
{
    POA poa = servant._default_POA() ;
    org.omg.CORBA.Object ref = null ;

    try {
        ref = poa.servant_to_reference( servant ) ;
    } catch (ServantNotActive sna) {
        throw wrapper.getDelegateServantNotActive( sna ) ;
    } catch (WrongPolicy wp) {
        throw wrapper.getDelegateWrongPolicy( wp ) ;
    }

    // Make sure that the POAManager is activated if no other
    // POAManager state management has taken place.
    POAManager mgr = poa.the_POAManager() ;
    if (mgr instanceof POAManagerImpl) {
        POAManagerImpl mgrImpl = (POAManagerImpl)mgr ;
        mgrImpl.implicitActivation() ;
    }

    return ref ;
}
 
Example 5
Source File: StubAdapter.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/** Use implicit activation to get an object reference for the servant.
 */
public static org.omg.CORBA.Object activateServant( Servant servant )
{
    POA poa = servant._default_POA() ;
    org.omg.CORBA.Object ref = null ;

    try {
        ref = poa.servant_to_reference( servant ) ;
    } catch (ServantNotActive sna) {
        throw wrapper.getDelegateServantNotActive( sna ) ;
    } catch (WrongPolicy wp) {
        throw wrapper.getDelegateWrongPolicy( wp ) ;
    }

    // Make sure that the POAManager is activated if no other
    // POAManager state management has taken place.
    POAManager mgr = poa.the_POAManager() ;
    if (mgr instanceof POAManagerImpl) {
        POAManagerImpl mgrImpl = (POAManagerImpl)mgr ;
        mgrImpl.implicitActivation() ;
    }

    return ref ;
}
 
Example 6
Source File: StubAdapter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/** Use implicit activation to get an object reference for the servant.
 */
public static org.omg.CORBA.Object activateServant( Servant servant )
{
    POA poa = servant._default_POA() ;
    org.omg.CORBA.Object ref = null ;

    try {
        ref = poa.servant_to_reference( servant ) ;
    } catch (ServantNotActive sna) {
        throw wrapper.getDelegateServantNotActive( sna ) ;
    } catch (WrongPolicy wp) {
        throw wrapper.getDelegateWrongPolicy( wp ) ;
    }

    // Make sure that the POAManager is activated if no other
    // POAManager state management has taken place.
    POAManager mgr = poa.the_POAManager() ;
    if (mgr instanceof POAManagerImpl) {
        POAManagerImpl mgrImpl = (POAManagerImpl)mgr ;
        mgrImpl.implicitActivation() ;
    }

    return ref ;
}
 
Example 7
Source File: StubAdapter.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/** Use implicit activation to get an object reference for the servant.
 */
public static org.omg.CORBA.Object activateServant( Servant servant )
{
    POA poa = servant._default_POA() ;
    org.omg.CORBA.Object ref = null ;

    try {
        ref = poa.servant_to_reference( servant ) ;
    } catch (ServantNotActive sna) {
        throw wrapper.getDelegateServantNotActive( sna ) ;
    } catch (WrongPolicy wp) {
        throw wrapper.getDelegateWrongPolicy( wp ) ;
    }

    // Make sure that the POAManager is activated if no other
    // POAManager state management has taken place.
    POAManager mgr = poa.the_POAManager() ;
    if (mgr instanceof POAManagerImpl) {
        POAManagerImpl mgrImpl = (POAManagerImpl)mgr ;
        mgrImpl.implicitActivation() ;
    }

    return ref ;
}
 
Example 8
Source File: StubAdapter.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/** Use implicit activation to get an object reference for the servant.
 */
public static org.omg.CORBA.Object activateServant( Servant servant )
{
    POA poa = servant._default_POA() ;
    org.omg.CORBA.Object ref = null ;

    try {
        ref = poa.servant_to_reference( servant ) ;
    } catch (ServantNotActive sna) {
        throw wrapper.getDelegateServantNotActive( sna ) ;
    } catch (WrongPolicy wp) {
        throw wrapper.getDelegateWrongPolicy( wp ) ;
    }

    // Make sure that the POAManager is activated if no other
    // POAManager state management has taken place.
    POAManager mgr = poa.the_POAManager() ;
    if (mgr instanceof POAManagerImpl) {
        POAManagerImpl mgrImpl = (POAManagerImpl)mgr ;
        mgrImpl.implicitActivation() ;
    }

    return ref ;
}
 
Example 9
Source File: StubAdapter.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/** Use implicit activation to get an object reference for the servant.
 */
public static org.omg.CORBA.Object activateServant( Servant servant )
{
    POA poa = servant._default_POA() ;
    org.omg.CORBA.Object ref = null ;

    try {
        ref = poa.servant_to_reference( servant ) ;
    } catch (ServantNotActive sna) {
        throw wrapper.getDelegateServantNotActive( sna ) ;
    } catch (WrongPolicy wp) {
        throw wrapper.getDelegateWrongPolicy( wp ) ;
    }

    // Make sure that the POAManager is activated if no other
    // POAManager state management has taken place.
    POAManager mgr = poa.the_POAManager() ;
    if (mgr instanceof POAManagerImpl) {
        POAManagerImpl mgrImpl = (POAManagerImpl)mgr ;
        mgrImpl.implicitActivation() ;
    }

    return ref ;
}
 
Example 10
Source File: HelloServer.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String args[]) {
    try{
        // create and initialize the ORB
        ORB orb = ORB.init(args, null);

        // get reference to rootpoa & activate the POAManager
        POA rootpoa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
        rootpoa.the_POAManager().activate();

        // create servant and register it with the ORB
        HelloImpl helloImpl = new HelloImpl();
        helloImpl.setORB(orb);

        // get object reference from the servant
        org.omg.CORBA.Object ref = rootpoa.servant_to_reference(helloImpl);
        Hello href = HelloHelper.narrow(ref);

        // get the root naming context
        org.omg.CORBA.Object objRef =
            orb.resolve_initial_references("NameService");
        // Use NamingContextExt which is part of the Interoperable
        // Naming Service (INS) specification.
        NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);

        // bind the Object Reference in Naming
        String name = "Hello";
        NameComponent path[] = ncRef.to_name( name );
        ncRef.rebind(path, href);

        System.out.println("HelloServer ready and waiting ...");

        // wait for invocations from clients
        while (true) {
            orb.run();
        }
    } catch (Exception e) {
        System.out.println("ERROR: " + e);
        e.printStackTrace(System.out);
    }

    System.out.println("HelloServer Exiting ...");

}
 
Example 11
Source File: HelloServer.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String args[]) {
    try{
        // create and initialize the ORB
        ORB orb = ORB.init(args, null);

        // get reference to rootpoa & activate the POAManager
        POA rootpoa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
        rootpoa.the_POAManager().activate();

        // create servant and register it with the ORB
        HelloImpl helloImpl = new HelloImpl();
        helloImpl.setORB(orb);

        // get object reference from the servant
        org.omg.CORBA.Object ref = rootpoa.servant_to_reference(helloImpl);
        Hello href = HelloHelper.narrow(ref);

        // get the root naming context
        org.omg.CORBA.Object objRef =
            orb.resolve_initial_references("NameService");
        // Use NamingContextExt which is part of the Interoperable
        // Naming Service (INS) specification.
        NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);

        // bind the Object Reference in Naming
        String name = "Hello";
        NameComponent path[] = ncRef.to_name( name );
        ncRef.rebind(path, href);

        System.out.println("HelloServer ready and waiting ...");

        // wait for invocations from clients
        while (true) {
            orb.run();
        }
    } catch (Exception e) {
        System.out.println("ERROR: " + e);
        e.printStackTrace(System.out);
    }

    System.out.println("HelloServer Exiting ...");

}
 
Example 12
Source File: HelloServer.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String args[]) {
    try{
        // create and initialize the ORB
        ORB orb = ORB.init(args, null);

        // get reference to rootpoa & activate the POAManager
        POA rootpoa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
        rootpoa.the_POAManager().activate();

        // create servant and register it with the ORB
        HelloImpl helloImpl = new HelloImpl();
        helloImpl.setORB(orb);

        // get object reference from the servant
        org.omg.CORBA.Object ref = rootpoa.servant_to_reference(helloImpl);
        Hello href = HelloHelper.narrow(ref);

        // get the root naming context
        org.omg.CORBA.Object objRef =
            orb.resolve_initial_references("NameService");
        // Use NamingContextExt which is part of the Interoperable
        // Naming Service (INS) specification.
        NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);

        // bind the Object Reference in Naming
        String name = "Hello";
        NameComponent path[] = ncRef.to_name( name );
        ncRef.rebind(path, href);

        System.out.println("HelloServer ready and waiting ...");

        // wait for invocations from clients
        while (true) {
            orb.run();
        }
    } catch (Exception e) {
        System.out.println("ERROR: " + e);
        e.printStackTrace(System.out);
    }

    System.out.println("HelloServer Exiting ...");

}
 
Example 13
Source File: HelloServer.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String args[]) {
    try{
        // create and initialize the ORB
        ORB orb = ORB.init(args, null);

        // get reference to rootpoa & activate the POAManager
        POA rootpoa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
        rootpoa.the_POAManager().activate();

        // create servant and register it with the ORB
        HelloImpl helloImpl = new HelloImpl();
        helloImpl.setORB(orb);

        // get object reference from the servant
        org.omg.CORBA.Object ref = rootpoa.servant_to_reference(helloImpl);
        Hello href = HelloHelper.narrow(ref);

        // get the root naming context
        org.omg.CORBA.Object objRef =
            orb.resolve_initial_references("NameService");
        // Use NamingContextExt which is part of the Interoperable
        // Naming Service (INS) specification.
        NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);

        // bind the Object Reference in Naming
        String name = "Hello";
        NameComponent path[] = ncRef.to_name( name );
        ncRef.rebind(path, href);

        System.out.println("HelloServer ready and waiting ...");

        // wait for invocations from clients
        while (true) {
            orb.run();
        }
    } catch (Exception e) {
        System.out.println("ERROR: " + e);
        e.printStackTrace(System.out);
    }

    System.out.println("HelloServer Exiting ...");

}
 
Example 14
Source File: HelloServer.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String args[]) {
    try{
        // create and initialize the ORB
        ORB orb = ORB.init(args, null);

        // get reference to rootpoa & activate the POAManager
        POA rootpoa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
        rootpoa.the_POAManager().activate();

        // create servant and register it with the ORB
        HelloImpl helloImpl = new HelloImpl();
        helloImpl.setORB(orb);

        // get object reference from the servant
        org.omg.CORBA.Object ref = rootpoa.servant_to_reference(helloImpl);
        Hello href = HelloHelper.narrow(ref);

        // get the root naming context
        org.omg.CORBA.Object objRef =
            orb.resolve_initial_references("NameService");
        // Use NamingContextExt which is part of the Interoperable
        // Naming Service (INS) specification.
        NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);

        // bind the Object Reference in Naming
        String name = "Hello";
        NameComponent path[] = ncRef.to_name( name );
        ncRef.rebind(path, href);

        System.out.println("HelloServer ready and waiting ...");

        // wait for invocations from clients
        while (true) {
            orb.run();
        }
    } catch (Exception e) {
        System.out.println("ERROR: " + e);
        e.printStackTrace(System.out);
    }

    System.out.println("HelloServer Exiting ...");

}
 
Example 15
Source File: HelloServer.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String args[]) {
    try{
        // create and initialize the ORB
        ORB orb = ORB.init(args, null);

        // get reference to rootpoa & activate the POAManager
        POA rootpoa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
        rootpoa.the_POAManager().activate();

        // create servant and register it with the ORB
        HelloImpl helloImpl = new HelloImpl();
        helloImpl.setORB(orb);

        // get object reference from the servant
        org.omg.CORBA.Object ref = rootpoa.servant_to_reference(helloImpl);
        Hello href = HelloHelper.narrow(ref);

        // get the root naming context
        org.omg.CORBA.Object objRef =
            orb.resolve_initial_references("NameService");
        // Use NamingContextExt which is part of the Interoperable
        // Naming Service (INS) specification.
        NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);

        // bind the Object Reference in Naming
        String name = "Hello";
        NameComponent path[] = ncRef.to_name( name );
        ncRef.rebind(path, href);

        System.out.println("HelloServer ready and waiting ...");

        // wait for invocations from clients
        while (true) {
            orb.run();
        }
    } catch (Exception e) {
        System.out.println("ERROR: " + e);
        e.printStackTrace(System.out);
    }

    System.out.println("HelloServer Exiting ...");

}
 
Example 16
Source File: HelloServer.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String args[]) {
    try{
        // create and initialize the ORB
        ORB orb = ORB.init(args, null);

        // get reference to rootpoa & activate the POAManager
        POA rootpoa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
        rootpoa.the_POAManager().activate();

        // create servant and register it with the ORB
        HelloImpl helloImpl = new HelloImpl();
        helloImpl.setORB(orb);

        // get object reference from the servant
        org.omg.CORBA.Object ref = rootpoa.servant_to_reference(helloImpl);
        Hello href = HelloHelper.narrow(ref);

        // get the root naming context
        org.omg.CORBA.Object objRef =
            orb.resolve_initial_references("NameService");
        // Use NamingContextExt which is part of the Interoperable
        // Naming Service (INS) specification.
        NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);

        // bind the Object Reference in Naming
        String name = "Hello";
        NameComponent path[] = ncRef.to_name( name );
        ncRef.rebind(path, href);

        System.out.println("HelloServer ready and waiting ...");

        // wait for invocations from clients
        while (true) {
            orb.run();
        }
    } catch (Exception e) {
        System.out.println("ERROR: " + e);
        e.printStackTrace(System.out);
    }

    System.out.println("HelloServer Exiting ...");

}
 
Example 17
Source File: HelloServer.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String args[]) {
    try{
        // create and initialize the ORB
        ORB orb = ORB.init(args, null);

        // get reference to rootpoa & activate the POAManager
        POA rootpoa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
        rootpoa.the_POAManager().activate();

        // create servant and register it with the ORB
        HelloImpl helloImpl = new HelloImpl();
        helloImpl.setORB(orb);

        // get object reference from the servant
        org.omg.CORBA.Object ref = rootpoa.servant_to_reference(helloImpl);
        Hello href = HelloHelper.narrow(ref);

        // get the root naming context
        org.omg.CORBA.Object objRef =
            orb.resolve_initial_references("NameService");
        // Use NamingContextExt which is part of the Interoperable
        // Naming Service (INS) specification.
        NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);

        // bind the Object Reference in Naming
        String name = "Hello";
        NameComponent path[] = ncRef.to_name( name );
        ncRef.rebind(path, href);

        System.out.println("HelloServer ready and waiting ...");

        // wait for invocations from clients
        while (true) {
            orb.run();
        }
    } catch (Exception e) {
        System.out.println("ERROR: " + e);
        e.printStackTrace(System.out);
    }

    System.out.println("HelloServer Exiting ...");

}
 
Example 18
Source File: HelloServer.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String args[]) {
    try{
        // create and initialize the ORB
        ORB orb = ORB.init(args, null);

        // get reference to rootpoa & activate the POAManager
        POA rootpoa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
        rootpoa.the_POAManager().activate();

        // create servant and register it with the ORB
        HelloImpl helloImpl = new HelloImpl();
        helloImpl.setORB(orb);

        // get object reference from the servant
        org.omg.CORBA.Object ref = rootpoa.servant_to_reference(helloImpl);
        Hello href = HelloHelper.narrow(ref);

        // get the root naming context
        org.omg.CORBA.Object objRef =
            orb.resolve_initial_references("NameService");
        // Use NamingContextExt which is part of the Interoperable
        // Naming Service (INS) specification.
        NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);

        // bind the Object Reference in Naming
        String name = "Hello";
        NameComponent path[] = ncRef.to_name( name );
        ncRef.rebind(path, href);

        System.out.println("HelloServer ready and waiting ...");

        // wait for invocations from clients
        while (true) {
            orb.run();
        }
    } catch (Exception e) {
        System.out.println("ERROR: " + e);
        e.printStackTrace(System.out);
    }

    System.out.println("HelloServer Exiting ...");

}
 
Example 19
Source File: HelloServer.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String args[]) {
    try{
        // create and initialize the ORB
        ORB orb = ORB.init(args, null);

        // get reference to rootpoa & activate the POAManager
        POA rootpoa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
        rootpoa.the_POAManager().activate();

        // create servant and register it with the ORB
        HelloImpl helloImpl = new HelloImpl();
        helloImpl.setORB(orb);

        // get object reference from the servant
        org.omg.CORBA.Object ref = rootpoa.servant_to_reference(helloImpl);
        Hello href = HelloHelper.narrow(ref);

        // get the root naming context
        org.omg.CORBA.Object objRef =
            orb.resolve_initial_references("NameService");
        // Use NamingContextExt which is part of the Interoperable
        // Naming Service (INS) specification.
        NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);

        // bind the Object Reference in Naming
        String name = "Hello";
        NameComponent path[] = ncRef.to_name( name );
        ncRef.rebind(path, href);

        System.out.println("HelloServer ready and waiting ...");

        // wait for invocations from clients
        while (true) {
            orb.run();
        }
    } catch (Exception e) {
        System.out.println("ERROR: " + e);
        e.printStackTrace(System.out);
    }

    System.out.println("HelloServer Exiting ...");

}
 
Example 20
Source File: HelloServer.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String args[]) {
    try{
        // create and initialize the ORB
        ORB orb = ORB.init(args, null);

        // get reference to rootpoa & activate the POAManager
        POA rootpoa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
        rootpoa.the_POAManager().activate();

        // create servant and register it with the ORB
        HelloImpl helloImpl = new HelloImpl();
        helloImpl.setORB(orb);

        // get object reference from the servant
        org.omg.CORBA.Object ref = rootpoa.servant_to_reference(helloImpl);
        Hello href = HelloHelper.narrow(ref);

        // get the root naming context
        org.omg.CORBA.Object objRef =
            orb.resolve_initial_references("NameService");
        // Use NamingContextExt which is part of the Interoperable
        // Naming Service (INS) specification.
        NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);

        // bind the Object Reference in Naming
        String name = "Hello";
        NameComponent path[] = ncRef.to_name( name );
        ncRef.rebind(path, href);

        System.out.println("HelloServer ready and waiting ...");

        // wait for invocations from clients
        while (true) {
            orb.run();
        }
    } catch (Exception e) {
        System.out.println("ERROR: " + e);
        e.printStackTrace(System.out);
    }

    System.out.println("HelloServer Exiting ...");

}