Package org.apache.openejb.jee

Examples of org.apache.openejb.jee.Beans


        } catch (final IOException e) {

            return;
        }

        Beans complete = null;
        for (final URL url : xmls) {
            if (url == null) {
                continue;
            }
            complete = mergeBeansXml(complete, url);
        }
        if (complete != null) {
            complete.removeDuplicates();
        }

        webModule.getAltDDs().put("beans.xml", complete);
    }
View Full Code Here


        webModule.getAltDDs().put("beans.xml", complete);
    }

    private Beans mergeBeansXml(final Beans current, final URL url) {
        Beans returnValue = current;
        try {
            final Beans beans;
            try {
                beans = ReadDescriptors.readBeans(url.openStream());
            } catch (final IOException e) {
                return returnValue;
            }

            if (current == null) {
                returnValue = beans;
            } else {
                current.getAlternativeClasses().addAll(beans.getAlternativeClasses());
                current.getAlternativeStereotypes().addAll(beans.getAlternativeStereotypes());
                current.getDecorators().addAll(beans.getDecorators());
                current.getInterceptors().addAll(beans.getInterceptors());
            }
            // check is done here since later we lost the data of the origin
            ReadDescriptors.checkDuplicatedByBeansXml(beans, returnValue);
        } catch (final OpenEJBException e) {
            logger.error("Unable to read beans.xml from: " + url.toExternalForm(), e);
View Full Code Here

        } catch (final IOException e) {

            return;
        }

        Beans complete = null;
        for (final URL url : xmls) {
            if (url == null) {
                continue;
            }
            complete = mergeBeansXml(complete, url);
        }

        if (complete == null) {
            return;
        }
        complete.removeDuplicates();

        IAnnotationFinder finder;
        try {
            finder = FinderFactory.createFinder(appModule);
        } catch (final Exception e) {
View Full Code Here

                } catch (final ClassNotFoundException e) {
                    // no-op
                }
            }

            final Beans beans = ejb.getBeans();
            if (beans != null && ejb.getEjbJar() != null) {
                for (final String name : beans.getManagedClasses()) {
                    try {
                        finderClasses.addAll(ancestors(classLoader.loadClass(name)));
                    } catch (final ClassNotFoundException e) {
                        // no-op
                    }
                }
                for (final String name : beans.getInterceptors()) {
                    try {
                        finderClasses.addAll(ancestors(classLoader.loadClass(name)));
                    } catch (final ClassNotFoundException e) {
                        // no-op
                    }
                }
                for (final String name : beans.getAlternativeClasses()) {
                    try {
                        finderClasses.addAll(ancestors(classLoader.loadClass(name)));
                    } catch (final ClassNotFoundException e) {
                        // no-op
                    }
                }
                for (final String name : beans.getDecorators()) {
                    try {
                        finderClasses.addAll(ancestors(classLoader.loadClass(name)));
                    } catch (final ClassNotFoundException e) {
                        // no-op
                    }
View Full Code Here

        final EjbJar ejbJar = new EjbJar();
        ejbJar.addEnterpriseBean(bean);
        ejbJar.addEnterpriseBean(test);

        final Beans beans = new Beans();
        beans.addManagedClass(PlcBaseDAO.class);
        beans.addManagedClass(PlcBaseJpaDAO.class);

        final EjbModule jar = new EjbModule(ejbJar);
        jar.setBeans(beans);

        return jar;
View Full Code Here

        return new SingletonBean(OrangeStateful.class);
    }

    @Module
    public Beans getBeans() {
        final Beans beans = new Beans();
        beans.addManagedClass(Peeler.class);
        return beans;
    }
View Full Code Here

        final EjbJar ejbJar = new EjbJar();
        ejbJar.addEnterpriseBean(bean);
        ejbJar.addEnterpriseBean(test);

        final Beans beans = new Beans();
        beans.addManagedClass(PlcBaseDAO.class);
        beans.addManagedClass(PlcBaseJpaDAO.class);
        beans.addManagedClass(AppCDI.class);
        beans.addManagedClass(AppJpaDAO.class);

        final EjbModule jar = new EjbModule(ejbJar);
        jar.setBeans(beans);

        return jar;
View Full Code Here

        assembler.createSecurityService(config.configureService(SecurityServiceInfo.class));

        final EjbJar ejbJar = new EjbJar();
        ejbJar.addEnterpriseBean(new StatelessBean(Echo.class));

        final Beans beans = new Beans();
        beans.addInterceptor(EchoInterceptor.class);
        beans.addDecorator(EchoDecorator.class);
        beans.addManagedClass(SimpleModel.class);
        beans.addManagedClass(ProducesEjbInjector.class);

        final EjbModule module = new EjbModule(ejbJar);
        module.setBeans(beans);

        assembler.createApplication(config.configureApplication(module));
View Full Code Here

        final StatefulBean bean = ejbJar.addEnterpriseBean(new StatefulBean(WidgetBean.class));
        bean.getEnvEntry().add(new EnvEntry("count", Integer.class.getName(), "10"));

        final EjbModule module = new EjbModule(ejbJar);
        module.setBeans(new Beans());

        assembler.createApplication(config.configureApplication(module));

    }
View Full Code Here

        assembler.createTransactionManager(config.configureService(TransactionServiceInfo.class));
        assembler.createSecurityService(config.configureService(SecurityServiceInfo.class));

        final EjbJar ejbJar = new EjbJar();
        final EjbModule ejbModule = new EjbModule(ejbJar);
        ejbModule.setBeans(new Beans());
        ejbModule.setModuleId("mbeans-test");

        for (final Class<?> clazz : Arrays.asList(Operation.class, OperationDescription.class,
            Reader.class, ReaderWriter.class, ReaderDescription.class,
            Empty.class, Inheritance.class, MBeanDescription.class)) {
View Full Code Here

TOP

Related Classes of org.apache.openejb.jee.Beans

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.