Package javax.naming

Examples of javax.naming.InitialContext.bind()


            //check bindings at comp
            Context sub1 = (Context)initCtx.lookup("java:comp");

            Context sub2 = sub1.createSubcontext ("env");

            initCtx.bind ("java:comp/env/rubbish", "abc");
            assertEquals ("abc", (String)initCtx.lookup("java:comp/env/rubbish"));



            //check binding LinkRefs
View Full Code Here




            //check binding LinkRefs
            LinkRef link = new LinkRef ("java:comp/env/rubbish");
            initCtx.bind ("java:comp/env/poubelle", link);
            assertEquals ("abc", (String)initCtx.lookup("java:comp/env/poubelle"));

            //check binding References
            StringRefAddr addr = new StringRefAddr("blah", "myReferenceable");
            Reference ref = new Reference (java.lang.String.class.getName(),
View Full Code Here

            Reference ref = new Reference (java.lang.String.class.getName(),
                    addr,
                    MyObjectFactory.class.getName(),
                    (String)null);

            initCtx.bind ("java:comp/env/quatsch", ref);
            assertEquals (MyObjectFactory.myString, (String)initCtx.lookup("java:comp/env/quatsch"));

            //test binding something at java:
            Context sub3 = initCtx.createSubcontext("java:zero");
            initCtx.bind ("java:zero/one", "ONE");
View Full Code Here

            initCtx.bind ("java:comp/env/quatsch", ref);
            assertEquals (MyObjectFactory.myString, (String)initCtx.lookup("java:comp/env/quatsch"));

            //test binding something at java:
            Context sub3 = initCtx.createSubcontext("java:zero");
            initCtx.bind ("java:zero/one", "ONE");
            assertEquals ("ONE", initCtx.lookup("java:zero/one"));



View Full Code Here

                server = (AxisServer)context.lookup(name);
            } catch (NamingException e) {
                // Didn't find it.
                server = super.getServer(environment);
                try {
                    context.bind(name, server);
                } catch (NamingException e1) {
                    // !!! Couldn't do it, what should we do here?
                }
            }
        } else {
View Full Code Here

        configurationManager.startConfiguration(configurationData.getId());

        InitialContext ctx = new InitialContext();
        Context fooCtx = ctx.createSubcontext("jca:foo");
        fooCtx.createSubcontext("bar");
        ctx.bind("jca:foo/bar/baz", 1);
        assertEquals(ctx.lookup("jca:foo/bar/baz"), 1);
        ctx.rebind("jca:foo/bar/baz", 2);
        assertEquals(ctx.lookup("jca:foo/bar/baz"), 2);

    }
View Full Code Here

  }

  @Test
  public void getBpmPlatformXmlLocationFromJndi() throws NamingException, MalformedURLException {
    Context context = new InitialContext();
    context.bind("java:comp/env/" + BPM_PLATFORM_XML_LOCATION, BPM_PLATFORM_XML_FILE_ABSOLUTE_LOCATION);

    URL url = new TomcatParseBpmPlatformXmlStep().lookupBpmPlatformXmlLocationFromJndi();

    assertEquals(new File(BPM_PLATFORM_XML_FILE_ABSOLUTE_LOCATION).toURI().toURL(), url);
  }
View Full Code Here

  }

  @Test
  public void lookupBpmPlatformXml() throws NamingException, MalformedURLException {
    Context context = new InitialContext();
    context.bind("java:comp/env/" + BPM_PLATFORM_XML_LOCATION, BPM_PLATFORM_XML_FILE_ABSOLUTE_LOCATION);

    URL url = new TomcatParseBpmPlatformXmlStep().lookupBpmPlatformXml();

    assertEquals(new File(BPM_PLATFORM_XML_FILE_ABSOLUTE_LOCATION).toURI().toURL(), url);
  }
View Full Code Here

      for (BindReferencePlugin plugin : bindReferencesPlugins)
      {
         try
         {
            InitialContext ic = new InitialContext();
            ic.bind(plugin.getBindName(), plugin.getReference());
            log.info("Reference bound (by recall()): " + plugin.getBindName());
         }
         catch (NameAlreadyBoundException e)
         {
            log.debug("Name already bound: " + plugin.getBindName());
View Full Code Here

        Reference _ref = new Reference(className, getClass().getName(), null);
        InitialContext _context = new InitialContext();

        try
        {
            _context.bind("java:/" + name, _ref);
            log.info("Bound to JNDI name: " + name);
        } finally
        {
            _context.close();
        }
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.