Package javax.naming

Examples of javax.naming.InitialContext.rebind()


      try
      {
         ctx = new InitialContext(new Hashtable(environment));
         boolean rebind = Boolean.valueOf((String)environment.get(RMIConnectorServer.JNDI_REBIND_ATTRIBUTE)).booleanValue();
         if (rebind)
            ctx.rebind(jndiURL, rmiServer.toStub());
         else
            ctx.bind(jndiURL, rmiServer.toStub());
         RmiConnectorActivator.log(LogService.LOG_DEBUG,"Bound " + rmiServer + " to " + jndiURL, null);
         return url;
      }
View Full Code Here


   private InitialContextInitializer(String name, Reference reference) throws NamingException, FileNotFoundException,
      XMLStreamException
   {
      PrivilegedSystemHelper.setProperty(Context.INITIAL_CONTEXT_FACTORY, DEFAULT_INITIAL_CONTEXT_FACTORY);
      InitialContext initialContext = getInitialContext();
      initialContext.rebind(name, reference);

      // binder
      binder = new InitialContextBinder(this, DEFAULT_BINDING_STORE_PATH);
   }
View Full Code Here

      {
         BindReferencePlugin brplugin = (BindReferencePlugin)plugin;
         try
         {
            InitialContext ic = getInitialContext();
            ic.rebind(brplugin.getBindName(), brplugin.getReference());
            LOG.info("Reference bound: " + brplugin.getBindName());
            bindReferencesPlugins.add((BindReferencePlugin)plugin);
         }
         catch (NamingException e)
         {
View Full Code Here

   private InitialContextInitializer(String name, Reference reference) throws NamingException, FileNotFoundException,
      XMLStreamException
   {
      PrivilegedSystemHelper.setProperty(Context.INITIAL_CONTEXT_FACTORY, DEFAULT_INITIAL_CONTEXT_FACTORY);
      InitialContext initialContext = getInitialContext();
      initialContext.rebind(name, reference);

      // binder
      binder = new InitialContextBinder(this, DEFAULT_BINDING_STORE_PATH);
   }
View Full Code Here

      {
         BindReferencePlugin brplugin = (BindReferencePlugin)plugin;
         try
         {
            InitialContext ic = getInitialContext();
            ic.rebind(brplugin.getBindName(), brplugin.getReference());
            LOG.info("Reference bound: " + brplugin.getBindName());
            bindReferencesPlugins.add((BindReferencePlugin)plugin);
         }
         catch (NamingException e)
         {
View Full Code Here

   private InitialContextInitializer(String name, Reference reference) throws NamingException, FileNotFoundException,
      XMLStreamException
   {
      PrivilegedSystemHelper.setProperty(Context.INITIAL_CONTEXT_FACTORY, DEFAULT_INITIAL_CONTEXT_FACTORY);
      InitialContext initialContext = getInitialContext();
      initialContext.rebind(name, reference);

      // binder
      binder = new InitialContextBinder(this, DEFAULT_BINDING_STORE_PATH);
   }
View Full Code Here

      {
         BindReferencePlugin brplugin = (BindReferencePlugin)plugin;
         try
         {
            InitialContext ic = getInitialContext();
            ic.rebind(brplugin.getBindName(), brplugin.getReference());
            LOG.info("Reference bound: " + brplugin.getBindName());
            bindReferencesPlugins.add((BindReferencePlugin)plugin);
         }
         catch (NamingException e)
         {
View Full Code Here

            //put the thread's classloader back
            currentThread.setContextClassLoader(childLoader1);

            //test rebind with existing binding
            initCtx.rebind("java:comp/env/rubbish", "xyz");
            assertEquals ("xyz", initCtx.lookup("java:comp/env/rubbish"));

            //test rebind with no existing binding
            initCtx.rebind ("java:comp/env/mullheim", "hij");
            assertEquals ("hij", initCtx.lookup("java:comp/env/mullheim"));
View Full Code Here

            //test rebind with existing binding
            initCtx.rebind("java:comp/env/rubbish", "xyz");
            assertEquals ("xyz", initCtx.lookup("java:comp/env/rubbish"));

            //test rebind with no existing binding
            initCtx.rebind ("java:comp/env/mullheim", "hij");
            assertEquals ("hij", initCtx.lookup("java:comp/env/mullheim"));

            //test that the other bindings are already there      
            assertEquals ("xyz", (String)initCtx.lookup("java:comp/env/poubelle"));
View Full Code Here

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

    }

    /*Disable this one, have to update MockServiceRegistration, MockServiceReference in kernel module
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.