Package javax.naming

Examples of javax.naming.InitialContext.list()


    */
   public void testListing() throws Exception
   {
      log.debug("+++ testListing");
      InitialContext ctx = getInitialContext();
      NamingEnumeration names = ctx.list("");
      int count = 0;
      while( names.hasMore() )
      {
         NameClassPair ncp = (NameClassPair) names.next();
         log.info(ncp);
View Full Code Here


      redeployNaming();
     
      Context ctx2 = new InitialContext(env);
      try
      {
         NamingEnumeration list = ctx2.list(ObjectBinder.SUBCONTEXT_NAME);
         assertNotNull("NamingEnumeration returned", list);
         assertTrue("NamingEnumeration has entry", list.hasMoreElements());
         NameClassPair pair = (NameClassPair) list.next();
         assertEquals(ObjectBinder.NAME, pair.getName());
      }
View Full Code Here

   public void testListing() throws Exception
   {
      log.debug("+++ testListing");
      InitialContext ctx = getInitialContext();
      NamingEnumeration names = ctx.list("");
      int count = 0;
      while( names.hasMore() )
      {
         NameClassPair ncp = (NameClassPair) names.next();
         log.info(ncp);
View Full Code Here

      log.debug("+++ testBindNull");
      InitialContext ctx = getInitialContext();
      ctx.bind("testBindNull", null);
      Object x = ctx.lookup("testBindNull");
      assertNull("testBindNull", x);
      NamingEnumeration<NameClassPair> ncps = ctx.list("");
      NameClassPair testBindNullNCP = null;
      while( ncps.hasMore() )
      {
         NameClassPair ncp = ncps.next();
         if( ncp.getName().equals("testBindNull") )
View Full Code Here

      log.debug("+++ testRebindNull");
      InitialContext ctx = getInitialContext();
      ctx.bind("testRebindNull", null);
      Object x = ctx.lookup("testRebindNull");
      assertNull("testRebindNull", x);
      NamingEnumeration<NameClassPair> ncps = ctx.list("");
      NameClassPair testBindNullNCP = null;
      while( ncps.hasMore() )
      {
         NameClassPair ncp = ncps.next();
         if( ncp.getName().equals("testRebindNull") )
View Full Code Here

      StringBuilder tmp = new StringBuilder();
      for(int n = 0; n < depth; n ++)
         tmp.append('+');
      tmp.append(name);
      getLog().info(tmp.toString());
      NamingEnumeration<NameClassPair> iter = ctx.list(name);
      while(iter.hasMore())
      {
         NameClassPair ncp = iter.next();
         tmp.setLength(0);
         for(int n = 0; n <= depth; n ++)
View Full Code Here

      StringBuilder tmp = new StringBuilder();
      for(int n = 0; n < depth; n ++)
         tmp.append('+');
      tmp.append(name);
      getLog().info(tmp.toString());
      NamingEnumeration<NameClassPair> iter = ctx.list(name);
      while(iter.hasMore())
      {
         NameClassPair ncp = iter.next();
         tmp.setLength(0);
         for(int n = 0; n <= depth; n ++)
View Full Code Here

      {
         log.info("Dumping JNDI context:" + context);

         // dump out the context name-value bindings
         InitialContext ic = getInitialContext();
         NamingEnumeration list = ic.list(context);

         while (list.hasMore())
         {
            NameClassPair nc = (NameClassPair) list.next();
            log.info(nc.toString());
View Full Code Here

            hosts[v] = addr.toString();
         }
      }
      else
      {
         NamingEnumeration iter = ctx.list("/HAPartition");
         while( iter.hasMore() )
         {
            NameClassPair pair = (NameClassPair) iter.next();
            partitionName = pair.getName();
            String partitionJndiName = "/HAPartition/" + partitionName;
View Full Code Here

   {
      String[] hosts = {};
      env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      env.setProperty(Context.PROVIDER_URL, hostname+":"+port);
      InitialContext ctx = new InitialContext(env);
      NamingEnumeration iter = ctx.list("/HAPartition");
      String partitionName = null;
      while( iter.hasMore() )
      {
         NameClassPair pair = (NameClassPair) iter.next();
         partitionName = pair.getName();
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.