Package javax.naming

Examples of javax.naming.InitialContext.list()


      sleep(2000);

      try
      {
         ctx.list("");
         fail();
      }
      catch (NamingException x)
      {
      }
View Full Code Here


      Hashtable env = new Hashtable();
      env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.rmi.registry.RegistryContextFactory");
      env.put(Context.PROVIDER_URL, "rmi://localhost:" + port);
      InitialContext ctx = new InitialContext(env);
      ctx.list("");
      sleep(1000);

      Socket socket = new Socket((String)null, shutdownPort);
      socket.getOutputStream().write(DefaultConfigurationBuilder.SHUTDOWN_COMMAND.getBytes());
      socket.close();
View Full Code Here

      sleep(2000);

      try
      {
         ctx.list("");
         fail();
      }
      catch (NamingException x)
      {
      }
View Full Code Here

            final 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);
            final 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);
            final Context context = new InitialContext(props);

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

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

        } finally {
View Full Code Here

        m_evaluators.clear();
        NamingEnumeration list = null;
        try
        {
            Context context = new InitialContext();
            list = context.list( JndiConstants.TOPIC_EXPRESSION_EVALUATOR_CONTEXT );
            while ( list.hasMore() )
            {
                NameClassPair pair = (NameClassPair) list.next();
                TopicExpressionEvaluator evaluator = (TopicExpressionEvaluator) JNDIUtils.lookup( context,
                        JndiConstants.TOPIC_EXPRESSION_EVALUATOR_CONTEXT + "/" + pair.getName(),
View Full Code Here

   private void lookup(String name)
   {
      System.out.println("lookup " + name);
      try {
         InitialContext jndiContext = InitialContextFactory.getInitialContext();
         NamingEnumeration names = jndiContext.list(name);
         if (names != null){
            while (names.hasMore()){
               System.out.println("  " + names.next());
            }
         }
View Full Code Here

   */
  public void listRepositoryContents() throws NamingException
  {
    InitialContext ctx = new InitialContext();
   
    NamingEnumeration<NameClassPair> serviceList = ctx.list("osgi:service/java.lang.Runnable/(rubbish=smelly)");
   
    checkThreadRetrievedViaListMethod(serviceList);
   
    assertFalse("The repository contained more objects than we expected", serviceList.hasMoreElements());
   
View Full Code Here

   
    //Now add a second service
   
    registerService(new Thread());
   
    serviceList = ctx.list("osgi:service/java.lang.Runnable/(rubbish=smelly)");
   
    checkThreadRetrievedViaListMethod(serviceList);
   
    checkThreadRetrievedViaListMethod(serviceList);
   
View Full Code Here

    reg.unregister();
   
    ServiceRegistration reg = bc.registerService(className, t, null);
    ServiceRegistration reg2 = bc.registerService(className, new Thread(), null);
   
    NamingEnumeration<NameClassPair> ne = ctx.list("osgi:servicelist/" + className);
   
    assertTrue(ne.hasMoreElements());
   
    NameClassPair ncp = ne.nextElement();
   
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.