Package org.apache.openejb

Examples of org.apache.openejb.Injection


                JndiEncInfo jndiEnc = clientInfo.jndiEnc;
                for (EjbReferenceInfo info : jndiEnc.ejbReferences) {
                    for (InjectionInfo target : info.targets) {
                        try {
                            Class targetClass = classLoader.loadClass(target.className);
                            Injection injection = new Injection(info.referenceName, target.propertyName, targetClass);
                            injections.add(injection);
                        } catch (ClassNotFoundException e) {
                            logger.error("Injection Target invalid: class=" + target.className + ", name=" + target.propertyName + ".  Exception: " + e.getMessage(), e);
                        }
                    }
                }
                for (ResourceReferenceInfo info : jndiEnc.resourceRefs) {
                    for (InjectionInfo target : info.targets) {
                        try {
                            Class targetClass = classLoader.loadClass(target.className);
                            Injection injection = new Injection(info.referenceName, target.propertyName, targetClass);
                            injections.add(injection);
                        } catch (ClassNotFoundException e) {
                            logger.error("Injection Target invalid: class=" + target.className + ", name=" + target.propertyName + ".  Exception: " + e.getMessage(), e);
                        }
                    }
                }
                for (ResourceEnvReferenceInfo info : jndiEnc.resourceEnvRefs) {
                    for (InjectionInfo target : info.targets) {
                        try {
                            Class targetClass = classLoader.loadClass(target.className);
                            Injection injection = new Injection(info.resourceEnvRefName, target.propertyName, targetClass);
                            injections.add(injection);
                        } catch (ClassNotFoundException e) {
                            logger.error("Injection Target invalid: class=" + target.className + ", name=" + target.propertyName + ".  Exception: " + e.getMessage(), e);
                        }
                    }
View Full Code Here


                    targetClass = loadClass(target.className);
                } catch (OpenEJBException ex) {
                    continue;
                }

                Injection injection = new Injection(info.referenceName, target.propertyName, targetClass);
                injections.add(injection);
            }
        }

        for (EjbReferenceInfo info : jndiEnc.ejbReferences) {
            for (InjectionInfo target : info.targets) {
                final Class<?> targetClass;
                try {
                    targetClass = loadClass(target.className);
                } catch (OpenEJBException ex) {
                    continue;
                }

                Injection injection = new Injection(info.referenceName, target.propertyName, targetClass);
                injections.add(injection);
            }
        }

        for (EjbReferenceInfo info : jndiEnc.ejbLocalReferences) {
            for (InjectionInfo target : info.targets) {
                final Class<?> targetClass;
                try {
                    targetClass = loadClass(target.className);
                } catch (OpenEJBException ex) {
                    continue;
                }

                Injection injection = new Injection(info.referenceName, target.propertyName, targetClass);
                injections.add(injection);
            }
        }

        for (PersistenceUnitReferenceInfo info : jndiEnc.persistenceUnitRefs) {
            for (InjectionInfo target : info.targets) {
                final Class<?> targetClass;
                try {
                    targetClass = loadClass(target.className);
                } catch (OpenEJBException ex) {
                    continue;
                }

                Injection injection = new Injection(info.referenceName, target.propertyName, targetClass);
                injections.add(injection);
            }
        }

        for (PersistenceContextReferenceInfo info : jndiEnc.persistenceContextRefs) {
            for (InjectionInfo target : info.targets) {
                final Class<?> targetClass;
                try {
                    targetClass = loadClass(target.className);
                } catch (OpenEJBException ex) {
                    continue;
                }

                Injection injection = new Injection(info.referenceName, target.propertyName, targetClass);
                injections.add(injection);
            }
        }

        for (ResourceReferenceInfo info : jndiEnc.resourceRefs) {
            for (InjectionInfo target : info.targets) {
                final Class<?> targetClass;
                try {
                    targetClass = loadClass(target.className);
                } catch (OpenEJBException ex) {
                    continue;
                }

                Injection injection = new Injection(info.referenceName, target.propertyName, targetClass);
                injections.add(injection);
            }
        }

        for (ResourceEnvReferenceInfo info : jndiEnc.resourceEnvRefs) {
            for (InjectionInfo target : info.targets) {
                final Class<?> targetClass;
                try {
                    targetClass = loadClass(target.className);
                } catch (OpenEJBException ex) {
                    continue;
                }

                Injection injection = new Injection(info.referenceName, target.propertyName, targetClass);
                injections.add(injection);
            }
        }

        for (ServiceReferenceInfo info : jndiEnc.serviceRefs) {
            for (InjectionInfo target : info.targets) {
                final Class<?> targetClass;
                try {
                    targetClass = loadClass(target.className);
                } catch (OpenEJBException ex) {
                    continue;
                }

                Injection injection = new Injection(info.referenceName, target.propertyName, targetClass);
                injections.add(injection);
            }
        }

        return injections;
View Full Code Here

        CoreContainerSystem containerSystem = new CoreContainerSystem(new IvmJndiFactory());
        WebContext webContext = new WebContext(application);
        webContext.setId(webApp.getId());
        webContext.setClassLoader(webModule.getClassLoader());
        webContext.getInjections().add(new Injection("SimpleEJBLocalBean", "simple", RestWithInjections.class));
        webContext.setJndiEnc(ctx);
        containerSystem.addWebContext(webContext);
        SystemInstance.get().setComponent(ContainerSystem.class, containerSystem);

        ServiceInfo serviceInfo = new ServiceInfo();
View Full Code Here

        }

        for (EnvEntryInfo info : bean.jndiEnc.envEntries) {
            for (InjectionInfo target : info.targets) {
                Class targetClass = loadClass(target.className, "classNotFound.injectionTarget");
                Injection injection = new Injection(info.name, target.propertyName, targetClass);
                deployment.getInjections().add(injection);
            }
        }

        for (EjbReferenceInfo info : bean.jndiEnc.ejbReferences) {
            for (InjectionInfo target : info.targets) {
                Class targetClass = loadClass(target.className, "classNotFound.injectionTarget");
                Injection injection = new Injection(info.referenceName, target.propertyName, targetClass);
                deployment.getInjections().add(injection);
            }
        }

        for (EjbLocalReferenceInfo info : bean.jndiEnc.ejbLocalReferences) {
            for (InjectionInfo target : info.targets) {
                Class targetClass = loadClass(target.className, "classNotFound.injectionTarget");
                Injection injection = new Injection(info.referenceName, target.propertyName, targetClass);
                deployment.getInjections().add(injection);
            }
        }

        for (PersistenceUnitReferenceInfo info : bean.jndiEnc.persistenceUnitRefs) {
            for (InjectionInfo target : info.targets) {
                Class targetClass = loadClass(target.className, "classNotFound.injectionTarget");
                Injection injection = new Injection(info.referenceName, target.propertyName, targetClass);
                deployment.getInjections().add(injection);
            }
        }

        for (PersistenceContextReferenceInfo info : bean.jndiEnc.persistenceContextRefs) {
            for (InjectionInfo target : info.targets) {
                Class targetClass = loadClass(target.className, "classNotFound.injectionTarget");
                Injection injection = new Injection(info.referenceName, target.propertyName, targetClass);
                deployment.getInjections().add(injection);
            }
        }

        for (ResourceReferenceInfo info : bean.jndiEnc.resourceRefs) {
            for (InjectionInfo target : info.targets) {
                Class targetClass = loadClass(target.className, "classNotFound.injectionTarget");
                Injection injection = new Injection(info.referenceName, target.propertyName, targetClass);
                deployment.getInjections().add(injection);
            }
        }

        for (ResourceEnvReferenceInfo info : bean.jndiEnc.resourceEnvRefs) {
            for (InjectionInfo target : info.targets) {
                Class targetClass = loadClass(target.className, "classNotFound.injectionTarget");
                Injection injection = new Injection(info.resourceEnvRefName, target.propertyName, targetClass);
                deployment.getInjections().add(injection);
            }
        }

        for (ServiceReferenceInfo info : bean.jndiEnc.serviceRefs) {
            for (InjectionInfo target : info.targets) {
                Class targetClass = loadClass(target.className, "classNotFound.injectionTarget");
                Injection injection = new Injection(info.referenceName, target.propertyName, targetClass);
                deployment.getInjections().add(injection);
            }
        }

        // ejbTimeout
View Full Code Here

        CoreContainerSystem containerSystem = new CoreContainerSystem(new IvmJndiFactory());
        WebContext webContext = new WebContext(application);
        webContext.setId(webApp.getId());
        webContext.setClassLoader(webModule.getClassLoader());
        webContext.getInjections().add(new Injection("SimpleEJBLocalBean", "simple", RestWithInjections.class));
        webContext.setJndiEnc(ctx);
        containerSystem.addWebContext(webContext);
        SystemInstance.get().setComponent(ContainerSystem.class, containerSystem);

        ServiceInfo serviceInfo = new ServiceInfo();
View Full Code Here

    public List<Injection> buildInjections(JndiEncInfo jndiEnc) throws OpenEJBException {
        List<Injection> injections = new ArrayList<Injection>();
        for (EnvEntryInfo info : jndiEnc.envEntries) {
            for (InjectionInfo target : info.targets) {
                Class targetClass = loadClass(target.className);
                Injection injection = new Injection(info.referenceName, target.propertyName, targetClass);
                injections.add(injection);
            }
        }

        for (EjbReferenceInfo info : jndiEnc.ejbReferences) {
            for (InjectionInfo target : info.targets) {
                Class targetClass = loadClass(target.className);
                Injection injection = new Injection(info.referenceName, target.propertyName, targetClass);
                injections.add(injection);
            }
        }

        for (EjbReferenceInfo info : jndiEnc.ejbLocalReferences) {
            for (InjectionInfo target : info.targets) {
                Class targetClass = loadClass(target.className);
                Injection injection = new Injection(info.referenceName, target.propertyName, targetClass);
                injections.add(injection);
            }
        }

        for (PersistenceUnitReferenceInfo info : jndiEnc.persistenceUnitRefs) {
            for (InjectionInfo target : info.targets) {
                Class targetClass = loadClass(target.className);
                Injection injection = new Injection(info.referenceName, target.propertyName, targetClass);
                injections.add(injection);
            }
        }

        for (PersistenceContextReferenceInfo info : jndiEnc.persistenceContextRefs) {
            for (InjectionInfo target : info.targets) {
                Class targetClass = loadClass(target.className);
                Injection injection = new Injection(info.referenceName, target.propertyName, targetClass);
                injections.add(injection);
            }
        }

        for (ResourceReferenceInfo info : jndiEnc.resourceRefs) {
            for (InjectionInfo target : info.targets) {
                Class targetClass = loadClass(target.className);
                Injection injection = new Injection(info.referenceName, target.propertyName, targetClass);
                injections.add(injection);
            }
        }

        for (ResourceEnvReferenceInfo info : jndiEnc.resourceEnvRefs) {
            for (InjectionInfo target : info.targets) {
                Class targetClass = loadClass(target.className);
                Injection injection = new Injection(info.referenceName, target.propertyName, targetClass);
                injections.add(injection);
            }
        }

        for (ServiceReferenceInfo info : jndiEnc.serviceRefs) {
            for (InjectionInfo target : info.targets) {
                Class targetClass = loadClass(target.className);
                Injection injection = new Injection(info.referenceName, target.propertyName, targetClass);
                injections.add(injection);
            }
        }

        return injections;
View Full Code Here

        CoreContainerSystem containerSystem = new CoreContainerSystem(new IvmJndiFactory());
        WebContext webContext = new WebContext(application);
        webContext.setId(webApp.getId());
        webContext.setClassLoader(webModule.getClassLoader());
        webContext.getInjections().add(new Injection("SimpleEJBLocalBean", "simple", RestWithInjections.class));
        webContext.setJndiEnc(ctx);
        containerSystem.addWebContext(webContext);
        SystemInstance.get().setComponent(ContainerSystem.class, containerSystem);

        ServiceInfo serviceInfo = new ServiceInfo();
View Full Code Here

        service = doServiceCreate();

        { // cleanup jax-ws injections
            final Iterator<Injection> injections = port.getInjections().iterator();
            while (injections.hasNext()) {
                final Injection next = injections.next();
                if (WebServiceContext.class.equals(type(loader, next))) {
                    injections.remove();
                }
            }
        }
View Full Code Here

    public List<Injection> buildInjections(JndiEncInfo jndiEnc) throws OpenEJBException {
        List<Injection> injections = new ArrayList<Injection>();
        for (EnvEntryInfo info : jndiEnc.envEntries) {
            for (InjectionInfo target : info.targets) {
                Class targetClass = loadClass(target.className);
                Injection injection = new Injection(info.name, target.propertyName, targetClass);
                injections.add(injection);
            }
        }

        for (EjbReferenceInfo info : jndiEnc.ejbReferences) {
            for (InjectionInfo target : info.targets) {
                Class targetClass = loadClass(target.className);
                Injection injection = new Injection(info.referenceName, target.propertyName, targetClass);
                injections.add(injection);
            }
        }

        for (EjbLocalReferenceInfo info : jndiEnc.ejbLocalReferences) {
            for (InjectionInfo target : info.targets) {
                Class targetClass = loadClass(target.className);
                Injection injection = new Injection(info.referenceName, target.propertyName, targetClass);
                injections.add(injection);
            }
        }

        for (PersistenceUnitReferenceInfo info : jndiEnc.persistenceUnitRefs) {
            for (InjectionInfo target : info.targets) {
                Class targetClass = loadClass(target.className);
                Injection injection = new Injection(info.referenceName, target.propertyName, targetClass);
                injections.add(injection);
            }
        }

        for (PersistenceContextReferenceInfo info : jndiEnc.persistenceContextRefs) {
            for (InjectionInfo target : info.targets) {
                Class targetClass = loadClass(target.className);
                Injection injection = new Injection(info.referenceName, target.propertyName, targetClass);
                injections.add(injection);
            }
        }

        for (ResourceReferenceInfo info : jndiEnc.resourceRefs) {
            for (InjectionInfo target : info.targets) {
                Class targetClass = loadClass(target.className);
                Injection injection = new Injection(info.referenceName, target.propertyName, targetClass);
                injections.add(injection);
            }
        }

        for (ResourceEnvReferenceInfo info : jndiEnc.resourceEnvRefs) {
            for (InjectionInfo target : info.targets) {
                Class targetClass = loadClass(target.className);
                Injection injection = new Injection(info.resourceEnvRefName, target.propertyName, targetClass);
                injections.add(injection);
            }
        }

        for (ServiceReferenceInfo info : jndiEnc.serviceRefs) {
            for (InjectionInfo target : info.targets) {
                Class targetClass = loadClass(target.className);
                Injection injection = new Injection(info.referenceName, target.propertyName, targetClass);
                injections.add(injection);
            }
        }
        return injections;
    }
View Full Code Here

    private static void updateInjections(final Collection<Injection> injections, final ClassLoader classLoader, final boolean keepInjection) {
        final Iterator<Injection> it = injections.iterator();
        final List<Injection> newOnes = new ArrayList<Injection>();
        while (it.hasNext()) {
            final Injection injection = it.next();
            if (injection.getTarget() == null) {
                try {
                    final Class<?> target = classLoader.loadClass(injection.getClassname());
                    if (keepInjection) {
                        final Injection added = new Injection(injection.getJndiName(), injection.getName(), target);
                        newOnes.add(added);
                    } else {
                        injection.setTarget(target);
                    }
                } catch (final ClassNotFoundException cnfe) {
View Full Code Here

TOP

Related Classes of org.apache.openejb.Injection

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.