Java 8 NamingContextExt - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 NamingContextExt class.

This code example shows how to use the following methods:to_name, rebind
        // Create implementation object 
        // 
        BankImpl bankImpl = new BankImpl(poa);
 
        byte[] oid = "Bank".getBytes();
        poa.activate_object_with_id(oid, bankImpl);
 
        org.omg.CORBA.Object ref = poa.create_reference_with_id(oid, BankHelper.id());
 
        // Register in NameService 
        org.omg.CORBA.Object nsObj = orb.resolve_initial_references("NameService");
        NamingContextExt rootContext = NamingContextExtHelper.narrow(nsObj);
        NameComponent[] nc = rootContext.to_name("Bank");
        rootContext.rebind(nc, ref);
 
        // 
        // Run implementation 
        // 
        manager.activate();
        System.out.println("Server ready...");
5
CodeRank
This code example shows how to use the following methods:to_name, rebind
         
        //Register in NameService 
        try { 
            org.omg.CORBA.Object nsObj = orb.resolve_initial_references("NameService");
            NamingContextExt rootContext = NamingContextExtHelper.narrow(nsObj);
            NameComponent[] nc = rootContext.to_name(name);
            rootContext.rebind(nc, ref);
        } catch (Exception ex) {
            throw new CorbaBindingException(ex);
        } 
    } 
    public void exportObjectReferenceToCorbaloc(ORB orb,
                                                org.omg.CORBA.Object object,
                                                String location) {
        int keyIndex = location.indexOf('/');
        String key = location.substring(keyIndex + 1);
        try { 
            Class<?> bootMgrHelperClass = Class.forName("org.apache.yoko.orb.OB.BootManagerHelper");
            Class<?> bootMgrClass = Class.forName("org.apache.yoko.orb.OB.BootManager");
            Method narrowMethod =
5
CodeRank
This code example shows how to use the following methods:to_name, resolve
            // NameService request that will cause failures.  We use one configuration to access 
            // the server, and the activate the object on the real one. 
            org.omg.CORBA.Object ref = nssORB.string_to_object(nsURI.toString());
            NamingContextExt ic = NamingContextExtHelper.narrow(ref);
 
            NameComponent[] nameComponent = ic.to_name(name);
            org.omg.CORBA.Object bean = ic.resolve(nameComponent);
 
            // Ok, now we have an object reference from the naming service, but we need to  
            // activate that object on the cssORB instance before we hand it out.  Activating it  
            // on the cssORB will ensure that all of the interceptors and policies we define on the  
            // cssORB will get used for all requests involving this bean.  
            String beanIOR = nssORB.object_to_string(bean);
            bean = cssORB.string_to_object(beanIOR);
 
            return bean;
        } catch (NoSuchMethodError e) {
            log.error("Incorrect level of org.omg.CORBA classes found.\nLikely cause is an incorrect java.endorsed.dirs configuration");  
            throw new InvalidConfigurationException("CORBA usage requires Yoko CORBA spec classes in java.endorsed.dirs classpath", e); 
        } catch (UserException ue) {
5
CodeRank
See Code Examples for Java 8 NamingContextExt Methods: