Package javax.naming

Examples of javax.naming.Context.rebind()


       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

            // OK
         }

         Context c = org.hornetq.utils.JNDIUtil.createContext(context, parentContext);

         c.rebind(jndiNameInContext, objectToBind);
      }
      return true;
   }

   private void deploy() throws Exception
View Full Code Here

            }

            // a bit weird but just to be consistent if user doesn't lookup directly the resource
            final Context lastContext = Contexts.createSubcontexts(containerSystemContext, path);
            try {
                lastContext.rebind(path.substring(path.lastIndexOf("/") + 1, path.length()), value.getValue());
            } catch (final NameAlreadyBoundException nabe) {
                nabe.printStackTrace();
            }
            containerSystemContext.rebind(path, value.getValue());
        }
View Full Code Here

            }
        }

        try {
            if (rebind) {
                jndiContext.rebind(name, service);
            } else {
                jndiContext.bind(name, service);
            }
        } catch (final NameAlreadyBoundException nabe) {
            logger.warning("unbounding resource " + name + " can happen because of a redeployment or because of a duplicated id");
View Full Code Here

    }
    Context ctx;
    MockDataSource mds = new MockDataSource(this);
    try {
      ctx = new InitialContext();
      ctx.rebind("datasource", mds);
      ctx.rebind("path", repository);
    } catch (NamingException e) {
      fail(e.getMessage());
      logger.error("", e);
    }
View Full Code Here

    Context ctx;
    MockDataSource mds = new MockDataSource(this);
    try {
      ctx = new InitialContext();
      ctx.rebind("datasource", mds);
      ctx.rebind("path", repository);
    } catch (NamingException e) {
      fail(e.getMessage());
      logger.error("", e);
    }
       
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

        MockContextFactory.setAsInitial();
       
        final Context ctx = NamingContextPool.getNamingContext(null);
        try
        {
            ctx.rebind(CONNECTION_FACTORY, new MockXAConnectionFactory());
        }
        finally
        {
            NamingContextPool.releaseNamingContext(ctx) ;
        }
View Full Code Here

        MockContextFactory.setAsInitial();
       
        final Context ctx = NamingContextPool.getNamingContext(null);
        try
        {
            ctx.rebind(CONNECTION_FACTORY, new MockQueueConnectionFactory());
            ctx.rebind(QUEUE_NAME, new MockQueue(QUEUE_NAME));
        }
        finally
        {
            NamingContextPool.releaseNamingContext(ctx) ;
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.