Package javax.naming

Examples of javax.naming.LinkRef


    * @throws NamingException DOCUMENT_ME
    */
   public void addResourceLink( ResourceLink resourceLink )
   throws NamingException
   {
      LinkRef link = new LinkRef( resourceLink.getTarget(  ) );
      this.createSubcontexts( resourceLink.getName(  ) );
      this.context.bind( resourceLink.getName(  ),
                         link );
      if ( LOG.isDebugEnabled(  ) )
      {
View Full Code Here


    * @throws NamingException DOCUMENT_ME
    */
   public void addResourceLink( ResourceLink resourceLink )
   throws NamingException
   {
      LinkRef link = new LinkRef( resourceLink.getTarget(  ) );
      this.createSubcontexts( resourceLink.getName(  ) );
      this.m_context.bind( resourceLink.getName(  ),
                         link );
      if ( LOG.isDebugEnabled(  ) )
      {
View Full Code Here

            }
            bindings.put(normalize(referenceInfo.referenceName), reference);
        }

        for (ResourceEnvReferenceInfo referenceInfo : jndiEnc.resourceEnvRefs) {
            LinkRef linkRef = null;
            try {
                Class<?> type = Class.forName(referenceInfo.resourceEnvRefType, true, EJBContext.class.getClassLoader());
                if (EJBContext.class.isAssignableFrom(type)) {
                    String jndiName = "java:comp/EJBContext";
                    linkRef = new LinkRef(jndiName);
                    bindings.put(normalize(referenceInfo.resourceEnvRefName), linkRef);
                    continue;
                } else if (WebServiceContext.class.equals(type)) {
                    String jndiName = "java:comp/WebServiceContext";
                    linkRef = new LinkRef(jndiName);
                    bindings.put(normalize(referenceInfo.resourceEnvRefName), linkRef);
                    continue;
                } else if (TimerService.class.equals(type)) {
                    String jndiName = "java:comp/TimerService";
                    linkRef = new LinkRef(jndiName);
                    bindings.put(normalize(referenceInfo.resourceEnvRefName), linkRef);
                    continue;
                }
            } catch (ClassNotFoundException e) {
            }
View Full Code Here

//         Reference ref = new Reference(EJBContext.class.getName(), EJBContextFactory.class.getName(), null);
//         ref.add(new StringRefAddr("containerGuid", Ejb3Registry.guid(this)));
//         ref.add(new StringRefAddr("containerClusterUid", Ejb3Registry.clusterUid(this)));
//         ref.add(new StringRefAddr("isClustered", Boolean.toString(isClustered())));
         // TODO: a temporary measure until jboss-injection is in place
         LinkRef ref = new LinkRef("java:internal/EJBContext");
         Util.rebind(getEnc(), "EJBContext", ref);
      }
      catch (NamingException e)
      {
         throw new RuntimeException(e);
View Full Code Here

  
   private void bindORB()
   {
      try
      {
         Util.rebind(getEnc(), "ORB", new LinkRef("java:/JBossCorbaORB"));
      }
      catch(NamingException e)
      {
         throw new RuntimeException(e);
      }
View Full Code Here

            namingException.setRootCause(e);
            throw namingException;
         }
         try
         {
            Util.rebind(getEnc(), "TransactionSynchronizationRegistry", new LinkRef("java:TransactionSynchronizationRegistry"));
            log.debug("Linked java:comp/TransactionSynchronizationRegistry to JNDI name: java:TransactionSynchronizationRegistry");
         }
         catch (NamingException e)
         {
            NamingException namingException = new NamingException("Could not bind TransactionSynchronizationRegistry for ejb name " + ejbName + " into JNDI under jndiName: " + getEnc().getNameInNamespace() + "/" + "TransactionSynchronizationRegistry");
View Full Code Here

            envCtx = (Context) iniCtx.lookup("java:comp");
            envCtx = envCtx.createSubcontext("env");
          }
         
          String securityDomain = getConfig().getAttribute(SECURITY_DOMAIN);
          Util.bind(envCtx, "security/securityMgr", new LinkRef(securityDomain));
          Util.bind(envCtx, "security/realmMapping", new LinkRef(securityDomain));
          Util.bind(envCtx, "security/security-domain", new LinkRef(securityDomain));
          Util.bind(envCtx, "security/subject", new LinkRef(securityDomain));
    }
   
      StandardWrapper sw = (StandardWrapper) ctx.createWrapper();
   
    sw.setServletClass(dispatchServletClassName);
View Full Code Here

        InitialContext context = new InitialContext();

        Context javaContext = (Context) context.lookup("java:");

        javaContext.bind("java:TransactionManager", new JndiUrlReference("java:comp/TransactionManager"));
        javaContext.bind("java:TransactionManagerLink", new LinkRef("java:comp/TransactionManager"));

        assertTrue(context.lookup("java:TransactionManager") instanceof TransactionManager);
        assertTrue(context.lookup("java:TransactionManagerLink") instanceof TransactionManager);

        new InitialContext().bind("java:foo", new LinkRef("java:comp/TransactionManager"));

        assertTrue(context.lookup("java:foo") instanceof TransactionManager);


    }
View Full Code Here

            if (URL.class.equals(type)) {
                reference = new URLReference(referenceInfo.resourceID);
            } else if (type.isAnnotationPresent(ManagedBean.class)) {
                ManagedBean managed = type.getAnnotation(ManagedBean.class);
                String name = managed.value().length() == 0 ? type.getSimpleName() : managed.value();
                reference = new LinkRef("module/" + name);
            } else if (Request.class.equals(type)) {
                reference = new ObjectReference(ThreadLocalContextManager.REQUEST);
            } else if (UriInfo.class.equals(type)) {
                reference = new ObjectReference(ThreadLocalContextManager.URI_INFO);
            } else if (HttpHeaders.class.equals(type)) {
                reference = new ObjectReference(ThreadLocalContextManager.HTTP_HEADERS);
            } else if (SecurityContext.class.equals(type)) {
                reference = new ObjectReference(ThreadLocalContextManager.SECURITY_CONTEXT);
            } else if (ContextResolver.class.equals(type)) {
                reference = new ObjectReference(ThreadLocalContextManager.CONTEXT_RESOLVER);
            } else if (referenceInfo.resourceID != null) {
                String jndiName = "openejb/Resource/" + referenceInfo.resourceID;
                reference = new IntraVmJndiReference(jndiName);
            } else {
                String jndiName = "openejb/Resource/" + referenceInfo.referenceName;
                reference = new IntraVmJndiReference(jndiName);
            }
            bindings.put(normalize(referenceInfo.referenceName), reference);
        }

        for (ResourceEnvReferenceInfo referenceInfo : jndiEnc.resourceEnvRefs) {

            if (referenceInfo.location != null) {
                Reference reference = buildReferenceLocation(referenceInfo.location);
                bindings.put(normalize(referenceInfo.referenceName), reference);
                continue;
            }

            final Class<?> type = getType(referenceInfo.resourceEnvRefType, referenceInfo);
            final Object reference;

            if (EJBContext.class.isAssignableFrom(type)) {
                String jndiName = "comp/EJBContext";
                reference = new LinkRef(jndiName);

                // Let the container bind this into JNDI
                if (jndiName.equals(referenceInfo.referenceName)) continue;
            } else if (Validator.class.equals(type)) {
                String jndiName = "comp/Validator";
                reference = new LinkRef(jndiName);
            } else if (ValidatorFactory.class.equals(type)) {
                String jndiName = "comp/ValidatorFactory";
                reference = new LinkRef(jndiName);
            } else if (WebServiceContext.class.equals(type)) {
                String jndiName = "comp/WebServiceContext";
                reference = new LinkRef(jndiName);
            } else if (TimerService.class.equals(type)) {
                String jndiName = "comp/TimerService";
                reference = new LinkRef(jndiName);

                // TODO Bind the BeanManager
            } else if (BeanManager.class.equals(type)) {
                String jndiName = "java:app/BeanManager";
                reference = new LinkRef(jndiName);

            } else if (UserTransaction.class.equals(type)) {
                reference = new IntraVmJndiReference("comp/UserTransaction");
            } else if (referenceInfo.resourceID != null) {
                String jndiName = "openejb/Resource/" + referenceInfo.resourceID;
View Full Code Here

                if (vdh != null)
                {
                    jndi_name = vdh.getEjbRefJndiName(jndi_name);
                }

                NamingUtil.rebind(sub, ejb.getEjbRefName(), new LinkRef(
                        jndi_name));
            }

            i = config.getEjbLocalRef().iterator();
            while (i.hasNext() == true)
            {
                EJBLocalRef ejb = (EJBLocalRef) i.next();
                String jndi_name = ejb.getEjbRefName();
                if (vdh != null)
                {
                    jndi_name = vdh.getEjbLocalRefJndiName(jndi_name);
                }
                NamingUtil.rebind(sub, ejb.getEjbRefName(), new LinkRef(
                        jndi_name));
            }
        }
        finally
        {
View Full Code Here

TOP

Related Classes of javax.naming.LinkRef

Copyright © 2018 www.massapicom. 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.