Package org.omg.CosNaming

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


            "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

            "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

     */
 
    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

            poa.the_POAManager().activate();

            org.omg.CORBA.Object o =
                poa.servant_to_reference(new TracingServiceImpl());

            NamingContextExt nc =
                NamingContextExtHelper.narrow(orb.resolve_initial_references("NameService"));
            nc.bind( nc.to_name("tracing.service"), o);
            poa.the_POAManager().activate();
        }
        catch ( Exception e )
        {
            e.printStackTrace();
View Full Code Here

        int idx = location.indexOf("#");
        String name = location.substring(idx + 1);
       
        //Register in NameService
        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);
    }
View Full Code Here

        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();
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

        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();
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);

            //Install the client interceptors
            String beanIOR = nssORB.object_to_string(bean);
            bean = cssORB.string_to_object(beanIOR);
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.