Package javax.naming

Examples of javax.naming.InitialContext.rebind()


      catch (NameAlreadyBoundException e)
      {
         // expected exception
      }
      assertEquals("test", ctx.lookup("test"));
      ctx.rebind("test", "test2");
      assertEquals("test2", ctx.lookup("test"));

      initializer.getInitialContext().bind("test", "test3");
      assertEquals("test3", ctx.lookup("test"));
      ctx.rebind("test", "test4");
View Full Code Here


      ctx.rebind("test", "test2");
      assertEquals("test2", ctx.lookup("test"));

      initializer.getInitialContext().bind("test", "test3");
      assertEquals("test3", ctx.lookup("test"));
      ctx.rebind("test", "test4");
      assertEquals("test3", ctx.lookup("test"));
      initializer.getInitialContext().rebind("test", "test5");
      assertEquals("test5", ctx.lookup("test"));
      initializer.getInitialContext().unbind("test");
      try
View Full Code Here

      so that any lookup against java:/jaas/domain returns an instance of our
      security manager class.
      */
     RefAddr refAddr = new StringRefAddr("nns", "JSM");
     Reference ref = new Reference("javax.naming.Context", refAddr, factoryName, null);
     ctx.rebind(this.baseContext, ref);
   }
}
View Full Code Here

      parser = ctx.getNameParser("");

      RefAddr refAddr = new StringRefAddr("nns", "JSMCachePolicy");
      String factoryName = DefaultCacheObjectFactory.class.getName();
      Reference ref = new Reference("javax.naming.Context", refAddr, factoryName, null);
      ctx.rebind(DEFAULT_CACHE_POLICY_PATH, ref);
      log.debug("cachePolicyCtxPath="+cacheJndiName);

      // Bind the default SecurityProxyFactory instance under java:/SecurityProxyFactory
      SecurityProxyFactory proxyFactory = (SecurityProxyFactory) securityProxyFactoryClass.newInstance();
      ctx.bind("java:/SecurityProxyFactory", proxyFactory);
View Full Code Here

   }

   private void establishPolicyRegistration() throws Exception
   {
      Context ctx = new InitialContext();
      ctx.rebind(this.policyRegistrationContextName, this.policyRegistration);
   }
  
   private void establishSecurityManagement() throws Exception
   {
      Context ctx = new InitialContext();
View Full Code Here

   }
  
   private void establishSecurityManagement() throws Exception
   {
      Context ctx = new InitialContext();
      ctx.rebind(this.securityManagementContextName, this.securityManagement);
   }
}
View Full Code Here

       security manager class.
      */
      RefAddr refAddr = new StringRefAddr("nns", "JSM");
      String factoryName = SecurityDomainObjectFactory.class.getName();
      Reference ref = new Reference("javax.naming.Context", refAddr, factoryName, null);
      ctx.rebind(SECURITY_MGR_PATH, ref);
      log.debug("securityMgrCtxPath="+SECURITY_MGR_PATH);

      refAddr = new StringRefAddr("nns", "JSMCachePolicy");
      factoryName = DefaultCacheObjectFactory.class.getName();
      ref = new Reference("javax.naming.Context", refAddr, factoryName, null);
View Full Code Here

      log.debug("securityMgrCtxPath="+SECURITY_MGR_PATH);

      refAddr = new StringRefAddr("nns", "JSMCachePolicy");
      factoryName = DefaultCacheObjectFactory.class.getName();
      ref = new Reference("javax.naming.Context", refAddr, factoryName, null);
      ctx.rebind(DEFAULT_CACHE_POLICY_PATH, ref);
      log.debug("cachePolicyCtxPath="+cacheJndiName);

      // Bind the default SecurityProxyFactory instance under java:/SecurityProxyFactory
      SecurityProxyFactory proxyFactory = (SecurityProxyFactory) securityProxyFactoryClass.newInstance();
      ctx.bind("java:/SecurityProxyFactory", proxyFactory);
View Full Code Here

    public void testInitialization() {
      SimpleDataSource simpleDS = new SimpleDataSource(mDbDriver, mDbUrl, mDbUsername, mDbPassword);
            // Grab the connection created and do a simple Query - we expect a result
      try {
        Context ctx = new InitialContext();
        ctx.rebind(JNDI_DATASOURCE, simpleDS);
   
        DatabaseInitializer di = new DatabaseInitializer();
        di.setDatasource(JNDI_DATASOURCE);
      di.setExistsSql("select * from AUTH_TOKEN");
      di.setSqlFiles("org/jboss/internal/soa/esb/test.sql");
View Full Code Here

            Context context = new InitialContext();
            MockContextFactory.setDelegateContext( context );
       
            final MockQueue queue = new SerializableMockQueue( QUEUE_NAME );
       
            context.rebind( QUEUE_NAME, queue );

            // inbound is to simulate a jms message arriving at a gateway endpoint.
            TextMessageImpl inBoundJmsMessage = new TextMessageImpl();
            inBoundJmsMessage.setJMSReplyTo( queue );
            new DefaultESBPropertiesSetter().setPropertiesFromJMSMessage( inBoundJmsMessage, msg );
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.