Package org.apache.naming

Examples of org.apache.naming.NamingService


  
   public TestJmsAdmin(String name) throws Exception {
      super(name);
      XMLUnit.setIgnoreWhitespace(true);
      try {
         this.namingService = new NamingService();
         this.namingService.start();
      }
      catch (Exception ex) {
         ex.printStackTrace();
         assertTrue("exception in constructor when starting naming service", false);
View Full Code Here


            else if (args[i].equalsIgnoreCase("-fillNames")) {
               fillNames = (new Boolean(args[++i])).booleanValue();
            }
         }

         NamingService namingService = null;
         if (startNamingService) {
            namingService = new NamingService();
            namingService.start();
            System.out.println("Started an ebedded naming service.");
         }

         Hashtable properties = new Hashtable();
         if (factory != null) {
            properties.put("java.naming.factory.initial", factory);
            System.out.println("Forcing java.naming.factory.initial=" + factory);
         }
         else {
            System.out.println("Using System.getProperty(java.naming.factory.initial)=" + System.getProperty("java.naming.factory.initial"));
         }
        
         InitialContext context = new InitialContext(properties);
         if (fillNames) {
            context.bind("first", new String("first"));
            context.bind("second", new String("first"));
            context.bind("third", new String("first"));
            context.createSubcontext("dir1");
            context.createSubcontext("dir2");
            context.createSubcontext("dir3");
            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=============");
         JndiDumper.scanContext(null, context, System.out);
         System.out.println("================JNDI CONTENT END  =============");

         if (namingService != null) namingService.stop();
      }
      catch (Exception ex) {
         ex.getMessage();
         ex.printStackTrace();
      }
View Full Code Here

  
   public TestJmsSubscribe(String name) {
      super(name);
      try {
         this.namingService = new NamingService();
         this.namingService.start();
      }
      catch (Exception ex) {
         ex.printStackTrace();
         assertTrue("exception in constructor when starting naming service", false);
View Full Code Here

TOP

Related Classes of org.apache.naming.NamingService

Copyright © 2018 www.massapicom. 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.