Package org.omg.CosNaming

Examples of org.omg.CosNaming.NamingContextExt


    public void testOrb() throws Exception {
        if (nameService == null) {
            return;
        }

        NamingContextExt ctx = NamingContextExtHelper.narrow(orb.resolve_initial_references("NameService"));
        NamingContextExt rootNamingContext = ctx;
        NameComponent name[] = ctx.to_name("foo/bar/baz");
        for (int i = 0; i < name.length; i++) {
            NameComponent nameComponent = name[i];
            ctx = NamingContextExtHelper.narrow(ctx.bind_new_context(new NameComponent[] {nameComponent}));
        }
View Full Code Here


    public void testOrb() throws Exception {
        if (nameService == null) {
            return;
        }

        NamingContextExt ctx = NamingContextExtHelper.narrow(orb.resolve_initial_references("NameService"));
        NamingContextExt rootNamingContext = ctx;
        NameComponent name[] = ctx.to_name("foo/bar/baz");
        for (int i = 0; i < name.length; i++) {
            NameComponent nameComponent = name[i];
            ctx = NamingContextExtHelper.narrow(ctx.bind_new_context(new NameComponent[] {nameComponent}));
        }
View Full Code Here

            Parameter iorFilePath = service.getParameter(IOR_FILE_PATH);
            Parameter iorString = service.getParameter(IOR_STRING);

            if (namingServiceUrl!=null && objectName!=null) {
                obj = orb.string_to_object(((String) namingServiceUrl.getValue()).trim());
                NamingContextExt nc = NamingContextExtHelper.narrow(obj);
                obj = nc.resolve(nc.to_name(((String) objectName.getValue()).trim()));
            } else if (iorFilePath!=null) {
                FileReader fileReader = new FileReader(((String) iorFilePath.getValue()).trim());
                char[] buf = new char[1000];
                fileReader.read(buf);
                obj = orb.string_to_object((new String(buf)).trim());
View Full Code Here

            // retrieve the object reference from the NameService because the SecurityInterceptor
            // attached to the main ORB instance may add additional service contexts to the
            // 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.
View Full Code Here

        String name = location.substring(idx + 1);
       
        //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);
        }
    }
View Full Code Here

      //props.setProperty("org.omg.CORBA.ORBInitialHost",  "stolas69.servequake.com");
      String[] args = new String[0];
      ORB orb = ORB.init(args, props);
      org.omg.CORBA.Object object = orb
          .resolve_initial_references("NameService");
      NamingContextExt nc = NamingContextExtHelper.narrow(object);
      org.omg.CORBA.Object adm = nc.resolve_str("admin");
      items = AdminHelper.narrow(adm);
      product[] products = new product[items.getProducts().length];
      System.out.println(products.length);
      products = items.getProducts();
      for (int i = 0; i < products.length - 1; i++) {
View Full Code Here

    // create Servant objects
    CustomerImpl customers = new CustomerImpl(items);
    AdminImpl admins = new AdminImpl(items);

    // init root context
    NamingContextExt nc;
    try {
      nc = NamingContextExtHelper.narrow(theOrb
          .resolve_initial_references("NameService"));
      System.out.println("resolved initial reference to NameService ...");

      nc.rebind(nc.to_name("admin"), thePoa.servant_to_reference(admins));
      nc.rebind(nc.to_name("customer"),
          thePoa.servant_to_reference(customers));
      System.out.println("resolved references to NameService");
    } catch (InvalidName e) {
      e.printStackTrace(System.err);
    } catch (NotFound e) {
View Full Code Here

    }

    @Override
    public synchronized void stop(final StopContext context) {
        // Get local (in-VM) CORBA naming context
        final NamingContextExt corbaContext = corbaNamingContext.getValue();

        // Unregister bean home from local CORBA naming context
        try {
            NameComponent[] name = corbaContext.to_name(this.name);
            corbaContext.unbind(name);
        } catch (InvalidName invalidName) {
            logger.error("Cannot unregister EJBHome from CORBA naming service", invalidName);
        } catch (NotFound notFound) {
            logger.error("Cannot unregister EJBHome from CORBA naming service", notFound);
        } catch (CannotProceed cannotProceed) {
View Full Code Here

         interfaceDef = InterfaceDefHelper.narrow(ir.lookup_id(beanRepositoryIds[0]));
      }
     
      Current poaCurrent = CurrentHelper.narrow(orb.resolve_initial_references("POACurrent"));

      NamingContextExt ctx = getNamingContextExt();

      log.debug("binding servant name " + getServantName());
     
      Servant servant = new BeanCorbaServant(this, poaCurrent, container, interfaceDef, interfaceAnalysis);
      this.referenceFactory = servantRegistry.bind(getServantName(), servant, policies);
View Full Code Here

    */
   private void unbind(String strName)
   {
      try
      {
         NamingContextExt corbaContext = getNamingContextExt();
         NameComponent n[] = corbaContext.to_name(strName);
         getNamingContextExt().unbind(n);
      }
      catch(Exception e)
      {
         log.warn("unable to unbind '" + strName + "'", e);
View Full Code Here

TOP

Related Classes of org.omg.CosNaming.NamingContextExt

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.