Package javax.naming

Examples of javax.naming.InitialContext.list()


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

      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,
View Full Code Here

            //test java:/comp/env/stuff
            assertEquals ("xyz", (String)initCtx.lookup("java:/comp/env/poubelle/"));

            //test list Names
            NamingEnumeration nenum = initCtx.list ("java:comp/env");
            HashMap results = new HashMap();
            while (nenum.hasMore())
            {
                NameClassPair ncp = (NameClassPair)nenum.next();
                results.put (ncp.getName(), ncp.getClassName());
View Full Code Here

            assertEquals ("javax.naming.LinkRef", (String)results.get("poubelle"));
            assertEquals ("java.lang.String", (String)results.get("mullheim"));
            assertEquals ("javax.naming.Reference", (String)results.get("quatsch"));

            //test list Bindings
            NamingEnumeration benum = initCtx.list("java:comp/env");
            assertEquals (4, results.size());

            //test NameInNamespace
            assertEquals ("comp/env", sub2.getNameInNamespace());
View Full Code Here

        m_evaluators.clear();
        NamingEnumeration list = null;
        try
        {
            Context initialContext = new InitialContext();
            list = initialContext.list( QUERY_EVALUATOR_CONTEXT );
            NameClassPair pair = null;
            ExpressionEvaluator evaluator = null;
            while ( list.hasMore() )
            {
                pair = (NameClassPair) list.next();
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

      m_evaluators.clear(  );
      NamingEnumeration list = null;
      try
      {
         Context initialContext = new InitialContext(  );
         list = initialContext.list( QUERY_EVALUATOR_CONTEXT );
         NameClassPair       pair      = null;
         ExpressionEvaluator evaluator = null;
         while ( list.hasMore(  ) )
         {
            pair         = (NameClassPair) list.next(  );
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.