Package org.omg.CosNaming

Examples of org.omg.CosNaming.Binding


      for (int i = 0; i < base.length; i++)
         name[i] = base[i];

      while (iterHolder.value.next_one(bindingHolder))
      {
         Binding binding = bindingHolder.value;
         name[name.length - 1] = binding.binding_name[0];
         try
         {
            String stringName = namingService.to_string(name);
            buf.append(stringName);
View Full Code Here


            int how_many_ctr = how_many;

            // set up an array with "how_many" bindings
            result = new Binding[how_many];
            for (; names.hasNext() && how_many_ctr > 0; how_many_ctr--)
                result[how_many_ctr - 1] = new Binding((names.next()).components(), BindingType.nobject);

            for (; contexts.hasNext() && how_many_ctr > 0; how_many_ctr--)
                result[how_many_ctr - 1] = new Binding((contexts.next()).components(), BindingType.ncontext);

            // create a new BindingIterator for the remaining arrays
            size -= how_many;
            Binding[] rest = new Binding[size];
            for (; names.hasNext() && size > 0; size--)
                rest[size - 1] = new Binding((names.next()).components(), BindingType.nobject);

            for (; contexts.hasNext() && size > 0; size--)
                rest[size - 1] = new Binding((contexts.next()).components(), BindingType.ncontext);

            org.omg.CORBA.Object o;
            try {
                // Iterators are activated with the RootPOA (transient)
                byte[] oid = rootPoa.activate_object(new BindingIteratorImpl(rest));
                o = rootPoa.id_to_reference(oid);
            } catch (Exception e) {
                log.error("unexpected exception", e);
                throw new INTERNAL(e.toString());
            }

            bi.value = BindingIteratorHelper.narrow(o);
        } else {
            result = new Binding[size];
            for (; names.hasNext() && size > 0; size--)
                result[size - 1] = new Binding((names.next()).components(), BindingType.nobject);

            for (; contexts.hasNext() && size > 0; size--)
                result[size - 1] = new Binding((contexts.next()).components(), BindingType.ncontext);
        }

        bl.value = result;
    }
View Full Code Here

            int how_many_ctr = how_many;

            // set up an array with "how_many" bindings
            result = new Binding[how_many];
            for (; names.hasNext() && how_many_ctr > 0; how_many_ctr--)
                result[how_many_ctr - 1] = new Binding((names.next()).components(), BindingType.nobject);

            for (; contexts.hasNext() && how_many_ctr > 0; how_many_ctr--)
                result[how_many_ctr - 1] = new Binding((contexts.next()).components(), BindingType.ncontext);

            // create a new BindingIterator for the remaining arrays
            size -= how_many;
            Binding[] rest = new Binding[size];
            for (; names.hasNext() && size > 0; size--)
                rest[size - 1] = new Binding((names.next()).components(), BindingType.nobject);

            for (; contexts.hasNext() && size > 0; size--)
                rest[size - 1] = new Binding((contexts.next()).components(), BindingType.ncontext);

            org.omg.CORBA.Object o;
            try {
                // Iterators are activated with the RootPOA (transient)
                byte[] oid = rootPoa.activate_object(new BindingIteratorImpl(rest));
                o = rootPoa.id_to_reference(oid);
            } catch (Exception e) {
                JacORBLogger.ROOT_LOGGER.logInternalError(e);
                throw new INTERNAL(e.toString());
            }

            bi.value = BindingIteratorHelper.narrow(o);
        } else {
            result = new Binding[size];
            for (; names.hasNext() && size > 0; size--)
                result[size - 1] = new Binding((names.next()).components(), BindingType.nobject);

            for (; contexts.hasNext() && size > 0; size--)
                result[size - 1] = new Binding((contexts.next()).components(), BindingType.ncontext);
        }

        bl.value = result;
    }
View Full Code Here

         */
        public boolean next_one(org.omg.CosNaming.BindingHolder b) {
            if (iterator.hasNext()) {
                // return this as a Binding value.
                BoundObject obj = (BoundObject)iterator.next();
                b.value = new Binding(new NameComponent[] { obj.name }, obj.type);
                return true;
            }
            else {
                // return an empty element
                b.value = new Binding(new NameComponent[0], BindingType.nobject);
                return false;
            }
        }
View Full Code Here

      b.value = bindings[iterator_pos++];
      return true;
  }
  else
  {
      b.value = new Binding(new org.omg.CosNaming.NameComponent[0],
          org.omg.CosNaming.BindingType.nobject);
      return false;
  }
    }
View Full Code Here

        result = new Binding[how_many];
        for( ; n.hasMoreElements() && how_many > 0; how_many-- )
        {
            result[how_many-1] =
                new Binding(((Name)n.nextElement()).components(),
                            BindingType.nobject );
        }

        for( ; c.hasMoreElements() && how_many > 0; how_many-- )
        {
            result[how_many-1] =
                new Binding(((Name)c.nextElement()).components(),
                            BindingType.ncontext);
        }

        return result;
    }
View Full Code Here

            // set up an array with "how_many" bindings

            result = new Binding[how_many];
            for( ; n.hasMoreElements() && how_many_ctr > 0; how_many_ctr-- )
            {
                result[how_many_ctr-1] = new Binding(((Name)n.nextElement()).components(),
                                                 BindingType.nobject );
            }

            for( ; c.hasMoreElements() && how_many_ctr > 0; how_many_ctr-- )
            {
                result[how_many_ctr-1] = new Binding(((Name)c.nextElement()).components(),
                                                 BindingType.ncontext);
            }

            // create a new BindingIterator for the remaining arrays

            size -= how_many;
            Binding[] rest = new Binding[ size ];
            for( ; n.hasMoreElements() && size > 0; size-- )
            {
                rest[size-1] = new Binding(((Name)n.nextElement()).components(),
                                           BindingType.nobject );
            }

            for( ; c.hasMoreElements() && size > 0; size-- )
            {
                rest[size-1] = new Binding(((Name)c.nextElement()).components(),
                                           BindingType.ncontext);
            }

            org.omg.CORBA.Object o = null;
            try
            {
                // Iterators are activated with the RootPOA (transient)
                byte[] oid = rootPoa.activate_object( new BindingIteratorImpl( rest ) );
                o = rootPoa.id_to_reference(oid);
            }
            catch ( Exception e )
            {
                logger.error("unexpected exception", e);
                throw new INTERNAL(e.toString());
            }

            bi.value = BindingIteratorHelper.narrow(o);
        }
        else
        {
            result = new Binding[size];
            for( ; n.hasMoreElements() && size > 0; size-- )
            {
                result[size-1] =
                    new Binding(((Name)n.nextElement()).components(),
                                BindingType.nobject );
            }

            for( ; c.hasMoreElements() && size > 0; size-- )
            {
                result[size-1] =
                    new Binding(((Name)c.nextElement()).components(),
                                BindingType.ncontext);
            }
        }

        bl.value = result;
View Full Code Here

         */
        public boolean next_one(org.omg.CosNaming.BindingHolder b) {
            if (iterator.hasNext()) {
                // return this as a Binding value.
                BoundObject obj = (BoundObject)iterator.next();
                b.value = new Binding(new NameComponent[] { obj.name }, obj.type);
                return true;
            }
            else {
                // return an empty element
                b.value = new Binding(new NameComponent[0], BindingType.nobject);
                return false;
            }
        }
View Full Code Here

            b.value =
                ((InternalBindingValue)theEnumeration.nextElement()).theBinding;
            currentSize--;
        } else {
            // Return empty but marshalable binding
            b.value = new Binding(new NameComponent[0],BindingType.nobject);
        }
        return hasMore;
    }
View Full Code Here

            NameComponent[] nlist = new NameComponent[1];
            nlist[0] = n;
            BindingType theType = theElement.theBindingType;

            b.value =
                new Binding( nlist, theType );
        } else {
            // Return empty but marshalable binding
            b.value = new Binding(new NameComponent[0],BindingType.nobject);
        }
        return hasMore;
    }
View Full Code Here

TOP

Related Classes of org.omg.CosNaming.Binding

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.