Package javax.naming

Examples of javax.naming.InitialContext.list()


    try {
      InitialContext ctx = new InitialContext();
      boolean present = false;
      try {

        NamingEnumeration<NameClassPair> entries = ctx.list(RESOURCES_CONTEXT);
        while (entries.hasMoreElements()) {
          NameClassPair e = entries.next();
          if (e.getName().equals(BEAN_MANAGER_JNDI_NAME) && e.getClassName().equals(BeanManager.class)) {
            present = true;
            break;
View Full Code Here


/*     */   private void lookup(String name)
/*     */   {
/* 550 */     System.out.println("lookup " + name);
/*     */     try {
/* 552 */       InitialContext jndiContext = InitialContextFactory.getInitialContext();
/* 553 */       NamingEnumeration names = jndiContext.list(name);
/* 554 */       if (names != null)
/* 555 */         while (names.hasMore())
/* 556 */           System.out.println("  " + names.next());
/*     */     }
/*     */     catch (Exception e)
View Full Code Here

      env.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
      env.setProperty("java.naming.provider.url", "localhost:" + serverPort);
      env.setProperty("java.naming.factory.url.pkgs", "org.jnp.interfaces");
      InitialContext ctx = new InitialContext(env);
      System.out.println("Connected to jnp service");
      ctx.list("");
      ctx.close();
      if (ClientSocketFactory.created == false)
         fail("No ClientSocketFactory was created");
      if (ServerSocketFactory.created == false)
         fail("No ServerSocketFactory was created");
View Full Code Here

      try
      {
         Context initialContext = new InitialContext(  );
         try
         {
            list = initialContext.list( COTEXT_NAME_QUERY_EVALUATOR );
         }
         catch ( NamingException ne )
         {
            // ignore
         }
View Full Code Here

            Properties props = new Properties();
            props.put("java.naming.factory.initial", "org.apache.openejb.client.RemoteInitialContextFactory");
            props.put("java.naming.provider.url", "ejbd://127.0.0.1:" + port);
            Context context = new InitialContext(props);

            assertNameClassPair(context.list(""));
            assertNameClassPair(context.list("ejb"));

            assertBindings(context.listBindings(""));
            assertBindings(context.listBindings("ejb"));
View Full Code Here

            props.put("java.naming.factory.initial", "org.apache.openejb.client.RemoteInitialContextFactory");
            props.put("java.naming.provider.url", "ejbd://127.0.0.1:" + port);
            Context context = new InitialContext(props);

            assertNameClassPair(context.list(""));
            assertNameClassPair(context.list("ejb"));

            assertBindings(context.listBindings(""));
            assertBindings(context.listBindings("ejb"));

        } finally {
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.