Package org.omg.CosNaming

Examples of org.omg.CosNaming.NamingContextExt


            if (delete_ok) {
                org.omg.CORBA.Object objRef = orb
                        .resolve_initial_references("NameService");
                // Use NamingContextExt which is part of the Interoperable
                // Naming Service (INS) specification.
                NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);
                String id = new Integer(a_participant.get_domain_id())
                        .toString();
                NameComponent path[] = ncRef.to_name(id);
                ncRef.unbind(path);
            } else {
                return RETCODE_PRECONDITION_NOT_MET.value;
            }
        } catch (Exception e) {
            System.err.println("ERROR: " + e);
View Full Code Here


        try {
            org.omg.CORBA.Object objRef = orb
                    .resolve_initial_references("NameService");
            // Use NamingContextExt instead of NamingContext. This is
            // part of the Interoperable naming Service.
            NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);
            ref = DomainParticipantHelper.narrow(ncRef.resolve_str(new Integer(
                    domainId).toString()));
        }

        catch (Exception e) {
            System.err.println("ERROR: " + e);
View Full Code Here

    {
        try
        {
            int slot_id = info.allocate_slot_id();

            NamingContextExt nc =
                NamingContextExtHelper.narrow(
                     info.resolve_initial_references("NameService"));

            TracingService tracer =
                TracingServiceHelper.narrow(
                    nc.resolve( nc.to_name("tracing.service")));


            if( tracer == null )
            {
                System.err.println("No Tracing Service, cannot register tracer interceptor!");
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

    }

    @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

            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

    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

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

            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

            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

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.