Package javax.naming

Examples of javax.naming.Context.bind()


      cache.getConfiguration().setCacheLoaderConfig(getCacheLoaderConfig(props));
      cache.create();


      MockDataSource ds = new MockDataSource(props);
      context.bind(JNDI_NAME, ds);
      assertNotNull(JNDI_NAME + " bound", context.lookup(JNDI_NAME));
      cache.start();

      assertNotNull("Cache has a cache loader", cache.getCacheLoaderManager().getCacheLoader());
   }
View Full Code Here


         ds = new jdbcDataSource();
         ds.setDatabase(prop.getProperty("cache.jdbc.url"));
         ds.setUser("sa");

         context.bind(JNDI_NAME, ds);
         assertNotNull(JNDI_NAME + " bound", context.lookup(JNDI_NAME));
      }
      Properties p = new Properties();
      p.setProperty("cache.jdbc.datasource", JNDI_NAME);
      p.setProperty("cache.jdbc.node.type", prop.getProperty("cache.jdbc.node.type"));
View Full Code Here

    ResolveResult r = findContextFor(name);
    Context ctx = (Context) r.getResolvedObj();
    String rname = r.getRemainingName().toString();

    // Bind the name in its proper context
    ctx.bind(rname, obj);
  }

  /**
   * Binds a name to an object, overwriting any existing binding.
   * All intermediate contexts and the target context (that named by all
View Full Code Here

     */
    public void testSimpleBind() throws NamingException {
        Context child = this.ic.createSubcontext("TestBindContext");
        assertNotNull("Created subcontext TestBindContext must not be null",
                child);
        child.bind("bindInteger", new Integer(80));
        Object lookupInt = this.ic.lookup("TestBindContext/bindInteger");
        assertNotNull(
                "java:/comp/env/TestBindContext/bindInteger should be non-null",
                lookupInt);
        assertEquals("java:/comp/env/TestBindContext/bindInteger", lookupInt,
View Full Code Here

            context.bind("dir1/first", new String("first"));
            context.bind("dir1/second", new String("first"));
            context.bind("dir1/third", new String("first"));
                    
            Context ctx = (Context)context.lookup("dir2");
            ctx.bind("first", new String("first"));
            ctx.bind("second", new String("first"));
            ctx.bind("third", new String("first"));
         }
        
         System.out.println("================JNDI CONTENT START=============");
View Full Code Here

            context.bind("dir1/second", new String("first"));
            context.bind("dir1/third", new String("first"));
                    
            Context ctx = (Context)context.lookup("dir2");
            ctx.bind("first", new String("first"));
            ctx.bind("second", new String("first"));
            ctx.bind("third", new String("first"));
         }
        
         System.out.println("================JNDI CONTENT START=============");
         JndiDumper.scanContext(null, context, System.out);
View Full Code Here

            context.bind("dir1/third", new String("first"));
                    
            Context ctx = (Context)context.lookup("dir2");
            ctx.bind("first", new String("first"));
            ctx.bind("second", new String("first"));
            ctx.bind("third", new String("first"));
         }
        
         System.out.println("================JNDI CONTENT START=============");
         JndiDumper.scanContext(null, context, System.out);
         System.out.println("================JNDI CONTENT END  =============");
View Full Code Here

      {
         failed=true;
      }
      if (failed)
      {
         context.bind(name, o);
      }
   }

   // Attributes ----------------------------------------------------
  
View Full Code Here

            throwException(cne, new IllegalStateException("Unable to detect factory type '" + easyBeansFactory + "'"));
        }


        try {
            compCtx.bind("EJBContext", context);
        } catch (NamingException e) {
            throwException(cne, new IllegalStateException("Cannot bind EJBContext", e));
        }

        // bind TimerService
View Full Code Here

            throwException(cne, new IllegalStateException("Cannot bind EJBContext", e));
        }

        // bind TimerService
        try {
            compCtx.bind("TimerService", context.getTimerService());
        } catch (NamingException e) {
            throwException(cne, new IllegalStateException("Cannot bind TimerService", e));
        }
    }
}
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.