Examples of NamingContextExt


Examples of org.omg.CosNaming.NamingContextExt

                {
                    String _indent = indent + "\t";
                    ps.println("/");
                   
                    NameComponent [] name = root_context.to_name(stringName);
                    NamingContextExt sub_context =
                        NamingContextExtHelper.narrow( n.resolve(name) );
                    list( sub_context, _indent, ps );
                }
                else
                    System.out.println();
View Full Code Here

Examples of org.omg.CosNaming.NamingContextExt

        {
            // rebind in the correct context

            NameComponent[] ncx = new NameComponent[1];
            ncx[0] = nb;
            NamingContextExt nce = NamingContextExtHelper.narrow(resolve(ctx.components()));
            if( nce == null )
                throw new CannotProceed();
            nce.rebind(ncx,obj);
        }
    }
View Full Code Here

Examples of org.omg.CosNaming.NamingContextExt

            throw new CannotProceed();

        if( nc == null || nc.length == 0 )
            throw new InvalidName();

        NamingContextExt ns = NamingContextExtHelper.narrow(new_context());
        bind_context( nc, ns );

        if( ns == null )
        {
            throw new CannotProceed();
View Full Code Here

Examples of org.omg.CosNaming.NamingContextExt

            throw new InvalidName();

        Name n = new Name( nc[0] );
        if( nc.length > 1 )
        {
            NamingContextExt next_context =
                NamingContextExtHelper.narrow((org.omg.CORBA.Object)contexts.get(n));


            if ((next_context == null)||(isDead(next_context)))
            {
                throw new NotFound(NotFoundReason.missing_node,nc);
            }

            NameComponent[] nc_prime =
                new NameComponent[nc.length-1];

            for( int i = 1; i < nc.length; i++)
                nc_prime[i-1] = nc[i];

            return next_context.resolve(nc_prime);
        }
        else
        {
            org.omg.CORBA.Object result = null;
View Full Code Here

Examples of org.omg.CosNaming.NamingContextExt

            "Selection error",JOptionPane.ERROR_MESSAGE);
      return;
  }

  DefaultMutableTreeNode node = (DefaultMutableTreeNode) getModel().getRoot();
  NamingContextExt context = rootContext;

  if (length > 1)
  {
      for (int i = 1; i < length; i++)
      {
    node = (DefaultMutableTreeNode)path.getPathComponent(i);
    ContextNode bind = (ContextNode)node.getUserObject();
    context = NamingContextExtHelper.narrow(context.resolve(bind.getName()));
    if( context == null )
    {
        System.err.println("Naming context narrow failed!");
        System.exit(1);
    }
      }
  }
  if (node.getAllowsChildren())
  {
      Name bindname = new Name(name);
      if( context == null )
    System.err.println("context null ");

      if( bindname.components() == null )
    System.err.println("name is null ");

      context.bind_new_context(bindname.components());
      update();
  }
  else
  {
      JOptionPane.showMessageDialog(this,
View Full Code Here

Examples of org.omg.CosNaming.NamingContextExt

            "Selection error",JOptionPane.ERROR_MESSAGE);
      return;
  }

  DefaultMutableTreeNode node = (DefaultMutableTreeNode) getModel().getRoot();
  NamingContextExt context = rootContext;

  if (length>1)
  {
      for (int i = 1;i<length;i++)
      {
    node = (DefaultMutableTreeNode) path.getPathComponent(i);
    ContextNode bind = (ContextNode) node.getUserObject();
    context = NamingContextExtHelper.narrow( context.resolve( bind.getName()));
    if( context == null )
    {
        System.err.println("Naming context narrow failed!");
        System.exit(1);
    }
      }
  }
  if (node.getAllowsChildren())
  {
      Name bindname = new Name(name);
      if( context == null )
    System.err.println("context null ");

      if( bindname.components() == null )
    System.err.println("name is null ");
                                                  
            try
            {                                                  
                context.bind( bindname.components(), orb.string_to_object( ior ));
            }
            catch( AlreadyBound ab )
            {
                if (isRebind)
                    context.rebind( bindname.components(), orb.string_to_object( ior ));
                else
                    throw ab;
            }
      update();
  }
View Full Code Here

Examples of org.omg.CosNaming.NamingContextExt

     */
 
    public void unbind()
    {
  DefaultMutableTreeNode node;
  NamingContextExt context = rootContext;
  TreePath path = null;
  int length = 0;
  try
  {
      path = getSelectionPath();
      length = path.getPathCount();
      if (length > 1)
      {
    for (int i = 1; i < length-1; i++)
    {
        node = (DefaultMutableTreeNode)path.getPathComponent(i);
        ContextNode bind = (ContextNode)node.getUserObject();
        context = NamingContextExtHelper.narrow(context.resolve(bind.getName()));
    }
      }

      if (length > 0)
      {
    node = (DefaultMutableTreeNode)path.getPathComponent(length-1);
    ContextNode binding = (ContextNode)node.getUserObject();
    context.unbind(binding.getName());
    DefaultTreeModel model = (DefaultTreeModel)getModel();
    model.removeNodeFromParent(node);
               
                // select the parent node and display its content
                DefaultMutableTreeNode parent = (DefaultMutableTreeNode)path.getPathComponent(length-2);
View Full Code Here

Examples of org.omg.CosNaming.NamingContextExt

        menubar.add(fileMenu);
        menubar.add(editMenu);
        menubar.add(helpMenu);

        NamingContextExt rootContext = null;
        try
        {
            rootContext =
                NamingContextExtHelper.narrow( orb.resolve_initial_references("NameService"));
        }
View Full Code Here

Examples of org.omg.CosNaming.NamingContextExt

        ORB orb = ORB.init(args, null);

        // get the root naming context
        org.omg.CORBA.Object objRef = orb.resolve_initial_references("NameService");
     
        NamingContextExt namingCtx = NamingContextExtHelper.narrow(objRef);
  
        // resolve the object reference
        String bankname = "swissbank";
        Bank bank = BankHelper.narrow(namingCtx.resolve_str(bankname));

        System.out.println("Obtained a handle on server object: " + bank);
       
        String accNum = "0234.234432.50L";
        CurrentAccount currentAccount = bank.createCurrentAccount(accNum, 123);
View Full Code Here

Examples of org.omg.CosNaming.NamingContextExt

        AccountImpl accountImpl = new AccountImpl(accNum);
        AccountPOATie tie = new AccountPOATie(accountImpl, rootpoa);
       
        Account account = tie._this(orb);
        org.omg.CORBA.Object objRef = orb.resolve_initial_references("NameService");
        NamingContextExt namingCtx = NamingContextExtHelper.narrow(objRef);

        NameComponent path[] = namingCtx.to_name( accNum );
        namingCtx.rebind(path, account);

        System.out.println("AccountServer ready and waiting ...");
        orb.run();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.