Examples of IJEjbEJB


Examples of org.ow2.util.ee.metadata.common.api.struct.IJEjbEJB

            throws ArchiveInjectionException {



        // Inject EJB
        IJEjbEJB jejb = sharedMetadata.getJEjbEJB();
        if (jejb != null) {
            // Update interface name
            jejb.setBeanInterface(getInterfaceName(sharedMetadata));

            // inject field
            injectEJB(jejb, sharedMetadata, clazz, instance);
        }
View Full Code Here

Examples of org.ow2.util.ee.metadata.common.api.struct.IJEjbEJB

            // EJBs
            EZBJNDIResolver jndiResolver = this.injectionHolder.getJNDIResolver();
            if (jndiResolver != null) {
                for (IENCBinding<IJEjbEJB> binding : this.encBindingHolder.getEJBBindings()) {
                    String encName = binding.getName();
                    IJEjbEJB jEjbEJB = binding.getValue();
                    String interfaceName = jEjbEJB.getBeanInterface();
                    String beanName = jEjbEJB.getBeanName();

                    String jndiName;
                    try {
                        jndiName = jndiResolver.getEJBJNDIUniqueName(interfaceName, beanName);
View Full Code Here

Examples of org.ow2.util.ee.metadata.common.api.struct.IJEjbEJB

            for (IJEjbEJB jEJB : jEjbs) {
                bindClassEJB(jEJB, mv);
            }
        }
        // &#64;EJB annotation
        IJEjbEJB jEJB = this.classAnnotationMetadata.getJEjbEJB();
        if (jEJB != null) {
            // For each ejb, do :
            bindClassEJB(jEJB, mv);
        }
View Full Code Here

Examples of org.ow2.util.ee.metadata.common.api.struct.IJEjbEJB

                javaxPersistenceUnit.setName(getJndiName(javaxPersistenceUnit.getName(), fieldMetaData));
                bindClassPersistenceUnit(javaxPersistenceUnit, mv);
            }

            // &#64;EJB annotation
            IJEjbEJB jEjb = fieldMetaData.getJEjbEJB();
            if (jEjb != null) {
                // validate
                validateAccessFieldAnnotation(fieldMetaData);

                logger.debug("Add injection for EJB on attribute {0} of class {1}", fieldMetaData.getFieldName(),
                        this.classAnnotationMetadata.getClassName());

                // Gets the JNDI Resolver
                EZBContainerJNDIResolver containerJNDIResolver = (EZBContainerJNDIResolver) this.map
                        .get(EZBContainerJNDIResolver.class.getName());

                // ejbName ?
                String beanName = jEjb.getBeanName();

                // JNDI name
                String jndiName = null;

                // Mapped Name ? if not null, use it as JNDI name
                String mappedName = jEjb.getMappedName();
                if (mappedName != null && !mappedName.equals("")) {
                    jndiName = mappedName;
                }

                // JNDI name still null, ask the JNDI resolver
                if (jndiName == null) {
                    try {
                        jndiName = containerJNDIResolver.getEJBJNDIUniqueName(itfName, beanName);
                    } catch (EZBJNDIResolverException e) {
                        logger.error("No jndi name found on class {0} for interface {1} and beanName {2}",
                                this.classAnnotationMetadata.getClassName(), itfName, beanName);
                    }
                }

                // JNDI name not null
                if (jndiName != null) {
                    logger.debug("Result of Asking jndi name on class {0} for interface {1} and beanName {2}. Result = {3}",
                            this.classAnnotationMetadata.getClassName(), itfName, beanName, jndiName);
                    callAttributeJndi(jndiName, typeInterface, mv, fieldMetaData, this.classAnnotationMetadata
                            .getClassName(), REGISTRY);
                    callBindAttributeJndi(jEjb.getName(), jndiName, mv, fieldMetaData);
                }


            }
View Full Code Here

Examples of org.ow2.util.ee.metadata.common.api.struct.IJEjbEJB

                    callBindLookupJndiRef(jAnnotationResource.getName(), mappedName, mv);
                }
            }

            // &#64;EJB annotation
            IJEjbEJB jEjb = methodMetaData.getJEjbEJB();
            if (jEjb != null) {
                logger.debug("Add injection for EJB on method {0} of class {1}", methodMetaData.getMethodName(),
                        this.classAnnotationMetadata.getClassName());

                Type typeInterface = validateSetterMethod(methodMetaData);
                String itfName = typeInterface.getClassName();

                // ejbName ?
                String beanName = jEjb.getBeanName();

                // JNDI name
                String jndiName = null;

                // Mapped Name ? if not null, use it as JNDI name
                String mappedName = jEjb.getMappedName();
                if (mappedName != null && !mappedName.equals("")) {
                    jndiName = mappedName;
                }

                // JNDI name still null, ask the JNDI resolver
                if (jndiName == null) {
                    try {
                        jndiName = this.containerJNDIResolver.getEJBJNDIUniqueName(itfName, beanName);
                    } catch (EZBJNDIResolverException e) {
                        logger.error("Cannot find JNDI Name on class {0} for interface {1} and beanName {2}. Result = {3}",
                            this.classAnnotationMetadata.getClassName(), itfName, beanName);
                    }
                }

                // Not null, bind it
                if (jndiName != null) {
                    logger.debug("Asking jndi name on class {0} for interface {1} and beanName {2}. Result = {3}",
                            this.classAnnotationMetadata.getClassName(), itfName, beanName, jndiName);

                    callMethodJndiEnv(jndiName, typeInterface, mv, methodMetaData, this.classAnnotationMetadata
                            .getClassName(), REGISTRY);

                    // get enc name (or the default name) and bind result
                    String encName = getJndiName(jEjb.getName(), methodMetaData);
                    callBindLookupJndiRef(encName, jndiName, mv);
                }
            }

            // &#64;PersistenceContext annotation
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.