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


    */
   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.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

      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

      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

            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

            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.