Examples of Beans


Examples of org.apache.openejb.jee.Beans

        return new StatefulBean(Brown.class);
    }

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

Examples of org.apache.openejb.jee.Beans

        return new SingletonBean(OrangeStatefulBean.class);
    }

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

Examples of org.apache.openejb.jee.Beans

        Object data = ejbModule.getAltDDs().get("beans.xml");
        if (data instanceof Beans) {
            ejbModule.setBeans((Beans) data);
        } else if (data instanceof URL) {
            URL url = (URL) data;
            Beans beans = readBeans(url);
            ejbModule.setBeans(beans);
        } else {
//            DeploymentLoader.logger.debug("No beans.xml found assuming annotated beans present: " + appModule.getJarLocation() + ", module: " + ejbModule.getModuleId());
//            ejbModule.setBeans(new Beans());
        }
View Full Code Here

Examples of org.apache.openejb.jee.Beans

        }
    }

    public static Beans readBeans(URL url) throws OpenEJBException {
        try {
            if (isEmptyBeansXml(url)) return new Beans();
            return (Beans) JaxbJavaee.unmarshalJavaee(Beans.class, url.openStream());
        } catch (SAXException e) {
            throw new OpenEJBException("Cannot parse the beans.xml file: " + url.toExternalForm(), e);
        } catch (JAXBException e) {
            throw new OpenEJBException("Cannot unmarshall the beans.xml file: " + url.toExternalForm(), e);
View Full Code Here

Examples of org.apache.openejb.jee.Beans

        } catch (IOException e) {

            return;
        }

        Beans complete = null;
        for (URL url : xmls) {
            if (url == null) continue;
            try {
                final Beans beans = ReadDescriptors.readBeans(url);

                if (complete == null) {
                    complete = beans;
                } else {
                    complete.getAlternativeClasses().addAll(beans.getAlternativeClasses());
                    complete.getAlternativeStereotypes().addAll(beans.getAlternativeStereotypes());
                    complete.getDecorators().addAll(beans.getDecorators());
                    complete.getInterceptors().addAll(beans.getInterceptors());
                }
            } catch (OpenEJBException e) {
                logger.error("Unable to read beans.xml from :"+ url.toExternalForm());
            }
        }
View Full Code Here

Examples of org.apache.openejb.jee.Beans

            return;
        }

        List<Archive> jars = new ArrayList<Archive>();

        Beans complete = null;
        for (URL url : xmls) {
            if (url == null) continue;
            try {

                final Beans beans = ReadDescriptors.readBeans(url);

                if (complete == null) {
                    complete = beans;
                } else {
                    complete.getAlternativeClasses().addAll(beans.getAlternativeClasses());
                    complete.getAlternativeStereotypes().addAll(beans.getAlternativeStereotypes());
                    complete.getDecorators().addAll(beans.getDecorators());
                    complete.getInterceptors().addAll(beans.getInterceptors());
                }
                File file = URLs.toFile(url);
                jars.add(new JarArchive(appModule.getClassLoader(), url));
//            } catch (MalformedURLException e) {
//                logger.error("Unable to resolve jar path of beans.xml:"+ url.toExternalForm(), e);
View Full Code Here

Examples of org.apache.openejb.jee.Beans

        return new StatefulBean(Brown.class);
    }

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

Examples of org.apache.openejb.jee.Beans

        EjbJar ejbJar = new EjbJar();
        ejbJar.addEnterpriseBean(new StatelessBean("HelloOne", RedBean.class));
        ejbJar.addEnterpriseBean(new StatelessBean("HelloTwo", RedBean.class));
        ejbJar.addEnterpriseBean(new StatelessBean(OrangeBean.class));

        Beans beans = new Beans();
        beans.addInterceptor(OrangeCdiInterceptor.class);
        beans.addDecorator(OrangeOneDecorator.class);
        beans.addDecorator(OrangeTwoDecorator.class);
        beans.addManagedClass(YellowBean.class);

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

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

Examples of org.apache.openejb.jee.Beans

            IAnnotationFinder finder = ejbModule.getFinder();


            final List<String> managedClasses;
            {
                final Beans beans = ejbModule.getBeans();

                if (beans != null) {
                    managedClasses = beans.getManagedClasses();
                    final List<String> classNames = getBeanClasses(finder);
                    for (String className : classNames) {
                        try {
                            final ClassLoader loader = ejbModule.getClassLoader();
                            final Class<?> clazz = loader.loadClass(className);
View Full Code Here

Examples of org.apache.openejb.jee.Beans

        } catch (IOException e) {

            return;
        }

        Beans complete = null;
        for (URL url : xmls) {
            if (url == null) continue;
            try {
                final Beans beans = ReadDescriptors.readBeans(url);

                if (complete == null) {
                    complete = beans;
                } else {
                    complete.getAlternativeClasses().addAll(beans.getAlternativeClasses());
                    complete.getAlternativeStereotypes().addAll(beans.getAlternativeStereotypes());
                    complete.getDecorators().addAll(beans.getDecorators());
                    complete.getInterceptors().addAll(beans.getInterceptors());
                }
            } catch (OpenEJBException e) {
                logger.error("Unable to read beans.xml from :"+ url.toExternalForm());
            }
        }
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.