Package javax.naming

Examples of javax.naming.InitialContext.rebind()


        assertTrue("Incorrect number of events. Expected 2, got " + listAppender2.getEvents().size(), listAppender2.getEvents().size() == 2);
        assertTrue("Incorrect number of events. Expected 1, got " + listAppender1.getEvents().size(), listAppender1.getEvents().size() == 1);

        // now set jndi resource to Application3.
        // The context name, 'Application3', will be used as log file name by the default route.
        context.rebind("java:comp/env/logging/context-name", "Application3");
        msg = new StructuredDataMessage("Test", "This is a message from Application3", "Context");
        EventLogger.logEvent(msg);
        File application3LogFile = new File("target/routingbyjndi/routingbyjnditest-Application3.log");
        assertTrue("The Application3 log file was not created", application3LogFile.exists());
View Full Code Here


        File application3LogFile = new File("target/routingbyjndi/routingbyjnditest-Application3.log");
        assertTrue("The Application3 log file was not created", application3LogFile.exists());

        // now set jndi resource to Application4
        // The context name, 'Application4', will be used as log file name by the default route.
        context.rebind("java:comp/env/logging/context-name", "Application4");
        msg = new StructuredDataMessage("Test", "This is a message from Application4", "Context");
        EventLogger.logEvent(msg);
        File application4LogFile = new File("target/routingbyjndi/routingbyjnditest-Application4.log");
        assertTrue("The Application3 log file was not created", application4LogFile.exists());
    }
View Full Code Here

         try
         {
            ctx = new InitialContext(new Hashtable(environment));
            if(rebind)
            {
               ctx.rebind(jndiPath, stub);
            }
            else
            {
               ctx.bind(jndiPath, stub);
            }
View Full Code Here

      InitialContext ctx = new InitialContext();
      POJO pojo = new POJO();
      Dispatcher.singleton.registerTarget("pojo", pojo);
      System.out.println("*** hello ***");

      ctx.rebind("pojo", AsynchRemoting.createRemoteProxy("pojo", POJO.class, new InvokerLocator("socket://localhost:5150")));
   }

   public void stop()
   {
      System.out.println("**** STOP ***");
 
View Full Code Here

      redeployNaming();
     
      Context ctx2 = new InitialContext(env);
      try
      {
         ctx2.rebind(ObjectBinder.NAME, ObjectBinder.VALUE);
      }
      catch (NamingException e)
      {
         log.error("Caught NamingException", e);
         fail(e.getMessage());
View Full Code Here

   public void testCertLogin() throws Exception
   {
      log.info("testCertLogin");
      InitialContext ctx = new InitialContext();
      ctx.rebind("testCertLogin", new TestSecurityDomain());

      KeyStore store = KeyStore.getInstance("JKS");
      ClassLoader loader = Thread.currentThread().getContextClassLoader();
      URL resURL = loader.getResource("security/tst.keystore");
      store.load(resURL.openStream(), "unit-tests".toCharArray());
View Full Code Here

   public void testCertRoles() throws Exception
   {
      log.info("testCertRoles");
      InitialContext ctx = new InitialContext();
      ctx.rebind("testCertRoles", new TestSecurityDomain());

      KeyStore store = KeyStore.getInstance("JKS");
      ClassLoader loader = Thread.currentThread().getContextClassLoader();
      URL resURL = loader.getResource("security/tst.keystore");
      store.load(resURL.openStream(), "unit-tests".toCharArray());
View Full Code Here

   {
      Class.forName("org.hsqldb.jdbcDriver");
      // Create a DataSource binding
      TestDS ds = new TestDS();
      InitialContext ctx = new InitialContext();
      ctx.rebind("testJdbc", ds);

      // Start database and setup tables
      Connection conn = ds.getConnection("sa", "");
      Statement statement = conn.createStatement();
      createPrincipalsTable(statement);
View Full Code Here

        // directory.
        InitialContext ctx =
            new InitialContext(attributes);

        if (rebind)
            ctx.rebind(jndiUrl, rmiServer);
        else
            ctx.bind(jndiUrl, rmiServer);
        ctx.close();
    }
View Full Code Here

        // directory.
        InitialContext ctx =
            new InitialContext(attributes);
       
        if (rebind)
            ctx.rebind(jndiUrl, rmiServer);
        else
            ctx.bind(jndiUrl, rmiServer);
        ctx.close();
    }
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.