Package javax.naming

Examples of javax.naming.InitialContext.createSubcontext()


      }
      catch(NamingException e)
      {
         try
         {
            context = initialContext.createSubcontext(DETECTION_SUBCONTEXT_NAME);
         }
         catch(NameAlreadyBoundException e1)
         {
            log.debug("The sub context " + DETECTION_SUBCONTEXT_NAME + " was created before we could.");
            context = (Context) initialContext.lookup(DETECTION_SUBCONTEXT_NAME);
View Full Code Here


   protected void createSubContextForFactories()
   {
      try
      {
         Context root = new InitialContext(jndiEnvironment);
         this.bvFactoryContext = root.createSubcontext(BV_FACTORY_JNDI_SUBCONTEXT);
      }
      catch (NamingException e)
      {
         log.error("Unable to create JNDI subcontext for Bean Validation Factories", e);
      }
View Full Code Here

      }
      catch ( NameNotFoundException nnfe )
      {
         LOG.debug( "Initializing WSRF JNDI context..." );
         LOG.debug( "Creating JNDI subcontext: " + JndiConstants.CONTEXT_NAME_BASE + " ..." );
         wsrfContext = initialContext.createSubcontext( JndiConstants.CONTEXT_NAME_BASE );
         LOG.debug( "Creating JNDI subcontext: " + JndiConstants.CONTEXT_SERVICES_BASE + " ..." );
         wsrfContext.createSubcontext( JndiConstants.CONTEXT_SERVICES_BASE );
         LOG.debug( "Creating JNDI subcontext: " + JndiConstants.CONTEXT_GLOBAL_BASE + " ..." );
         wsrfContext.createSubcontext( JndiConstants.CONTEXT_GLOBAL_BASE );
      }
View Full Code Here

            context.lookup(subcontextName);
         }
         catch (NameNotFoundException e)
         {
            logger.trace("Creating subcontext " + subcontextName);
            context.createSubcontext(subcontextName);
         }
      }
     
      NonSerializableFactory.rebind(context, jndiName, value);
   }
View Full Code Here

        Hashtable env = new Hashtable();
        env.put(Context.INITIAL_CONTEXT_FACTORY, MemoryContextFactory.class.getName());
        env.put(Context.URL_PKG_PREFIXES, "tyrex.naming");
        env.put(Context.PROVIDER_URL, alias);
        Context context = new InitialContext(env);
        context.createSubcontext("jdbc");
        context.bind(jndiName, dataSource);
        context.close();
        // end J2EE server

        // now... pretend to be a client.
View Full Code Here

        Hashtable env = new Hashtable();
        env.put(Context.INITIAL_CONTEXT_FACTORY, MemoryContextFactory.class.getName());
        env.put(Context.URL_PKG_PREFIXES, "tyrex.naming");
        env.put(Context.PROVIDER_URL, alias);
        Context context = new InitialContext(env);
        context.createSubcontext("jdbc");
        context.bind(jndiName, NamingManager.getObjectInstance(reference, null, null, null));
        context.close();
        // end JNDI aware container

        // now... pretend to be a client.
View Full Code Here

        replay(dataSource);

        MockContextFactory.setAsInitial();

        final InitialContext context = new InitialContext();
        context.createSubcontext("java:");
        context.createSubcontext("java:/comp");
        context.createSubcontext("java:/comp/env");
        context.createSubcontext("java:/comp/env/jdbc");

        context.bind("java:/comp/env/jdbc/TestDataSourceAppender", dataSource);
View Full Code Here

        MockContextFactory.setAsInitial();

        final InitialContext context = new InitialContext();
        context.createSubcontext("java:");
        context.createSubcontext("java:/comp");
        context.createSubcontext("java:/comp/env");
        context.createSubcontext("java:/comp/env/jdbc");

        context.bind("java:/comp/env/jdbc/TestDataSourceAppender", dataSource);
View Full Code Here

        MockContextFactory.setAsInitial();

        final InitialContext context = new InitialContext();
        context.createSubcontext("java:");
        context.createSubcontext("java:/comp");
        context.createSubcontext("java:/comp/env");
        context.createSubcontext("java:/comp/env/jdbc");

        context.bind("java:/comp/env/jdbc/TestDataSourceAppender", dataSource);

        try {
View Full Code Here

        final InitialContext context = new InitialContext();
        context.createSubcontext("java:");
        context.createSubcontext("java:/comp");
        context.createSubcontext("java:/comp/env");
        context.createSubcontext("java:/comp/env/jdbc");

        context.bind("java:/comp/env/jdbc/TestDataSourceAppender", dataSource);

        try {
            this.setUp("dsLogEntry", "log4j2-data-source.xml");
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.