Package javax.naming

Examples of javax.naming.Context.rebind()


                    throw new DeployerException("Cannot add the ejbClassLoader parameter '" + ejbClassLoader + "'", e);
                }

                // Role names
                try {
                    ctx.rebind("roleNames", new String[0]);
                } catch (NamingException e) {
                    throw new DeployerException("Cannot add the altDDs parameter.'", e);
                }

                try {
View Full Code Here


                PersistenceContextType type = binding.getValue().getType();
                EntityManager em = persistenceUnitManager.getEntityManager(unitName, type);

                try {
                    createSubcontexts(envCtx, encName);
                    envCtx.rebind(encName, em);
                    if (this.logger.isDebugEnabled()) {
                        this.logger.debug("Adding persistence-context 'java:comp/env/" + encName + "'");
                    }
                } catch (NamingException e) {
                    this.logger.error("Unable to bind persistence-context in ENC", e);
View Full Code Here

                String unitName = binding.getValue().getUnitName();
                EntityManagerFactory emf = persistenceUnitManager.getEntityManagerFactory(unitName);

                try {
                    createSubcontexts(envCtx, encName);
                    envCtx.rebind(encName, emf);
                    if (this.logger.isDebugEnabled()) {
                        this.logger.debug("Adding persistence-unit 'java:comp/env/" + encName + "'");
                    }
                } catch (NamingException e) {
                    this.logger.error("Unable to bind persistence-unit in ENC", e);
View Full Code Here

                        jndiName = jndiResolver.getEJBJNDIUniqueName(interfaceName, beanName);

                        // Bind a link to this JNDI name
                        try {
                            createSubcontexts(envCtx, encName);
                            envCtx.rebind(encName, new LinkRef(jndiName));
                            if (this.logger.isDebugEnabled()) {
                                this.logger.debug("Adding ejb 'java:comp/env/" + encName + "' from JNDIName '" + jndiName
                                        + "'.");
                            }
                        } catch (NamingException e) {
View Full Code Here

            } catch (NamingException e) {
                logger.error("Cannot lookup UserTransaction.", e);
            }
        }
        if (this.userTransaction != null) {
            compCtx.rebind("UserTransaction", this.userTransaction);
        }

        // bind ORB
        try {
            compCtx.rebind("ORB", ORBInitHelper.getORB());
View Full Code Here

                    }

                }

                try {
                    bindContext.rebind(name, value);
                } catch (NamingException e) {
                    throwException(javaContextNamingEvent, new IllegalStateException("Cannot bind element '" + name
                            + "' for bean '" + beanName + "'.", e));
                }
            }
View Full Code Here

            compCtx.rebind("UserTransaction", this.userTransaction);
        }

        // bind ORB
        try {
            compCtx.rebind("ORB", ORBInitHelper.getORB());
        } catch (NamingException e) {
            logger.error("Cannot bind ORB", e);
        }

        return ctx;
View Full Code Here

            try {
                subctx = lookupCtx(n.get(0));
            } catch (NameNotFoundException e) {
                subctx = createSubcontext(n.get(0));
            }
            subctx.rebind(suffix, obj);
        }
    }

    /**
     * Unbinds the named object.
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

      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

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.