Package org.apache.openejb.jee

Examples of org.apache.openejb.jee.StatelessBean


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

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

        Beans beans = new Beans();
        beans.addInterceptor(EchoInterceptor.class);
        beans.addDecorator(EchoDecorator.class);
        beans.addManagedClass(SimpleModel.class);
View Full Code Here


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

        webModule = annotationDeployer.deploy(webModule);

        EjbJar ejbJar = new EjbJar("ejb");
        ejbJar.addEnterpriseBean(new StatelessBean(SimpleEJB.class));

        ConfigurationFactory factory = new ConfigurationFactory(false);

        AppModule appModule = new AppModule(Thread.currentThread().getContextClassLoader(), "foo");
        appModule.setModuleId("rest");
View Full Code Here

        orange.getResourceRef().add(new ResourceRef()
                .lookup("java:comp/env/superDS")
                .injectionTarget(OrangeBean.class, "ds")
        );

        final StatelessBean yellow = ejbJar.addEnterpriseBean(new StatelessBean(YellowBean.class));

        yellow.getDataSource().add(new org.apache.openejb.jee.DataSource()
                .name("java:comp/env/superMegaDS")
                .className("org.hsqldb.jdbc.jdbcDataSource")
                .user("sa")
                .password("")
                .url("jdbc:hsqldb:mem:superDS")
        );

        yellow.getResourceRef().add(new ResourceRef()
                .lookup("java:comp/env/superMegaDS")
                .injectionTarget(YellowBean.class, "mega")
        );


        yellow.getDataSource().add(new org.apache.openejb.jee.DataSource()
                .name("java:comp/env/superGigaDS")
                .className("org.hsqldb.jdbc.jdbcDataSource")
                .user("sa")
                .password("")
                .url("jdbc:hsqldb:mem:superDS")
        );

        yellow.getResourceRef().add(new ResourceRef()
                .lookup("java:comp/env/superGigaDS")
                .injectionTarget(YellowBean.class, "giga")
        );

View Full Code Here

        return asMap(ejbJarInfo.enterpriseBeans);
    }

    private StatelessBean addBean(Class<?> orangeBeanClass) {
        return ejbJar.addEnterpriseBean(new StatelessBean(orangeBeanClass));
    }
View Full Code Here

        Assembler assembler = SystemInstance.get().getComponent(Assembler.class);
        ConfigurationFactory config = new ConfigurationFactory();

        EjbJar ejbJar = new EjbJar();
        ejbJar.addEnterpriseBean(new StatelessBean("Orange", Fruit.class));
        ejbJar.addEnterpriseBean(new StatelessBean("Apple", Fruit.class));
        ejbJar.addEnterpriseBean(new StatelessBean("Peach", Fruit.class));
        ejbJar.addEnterpriseBean(new StatelessBean("Pear", Fruit.class));
        ejbJar.addEnterpriseBean(new StatelessBean("Plum", Fruit.class));
        ejbJar.addEnterpriseBean(new StatelessBean("ejb/Orange", Fruit.class));
        ejbJar.addEnterpriseBean(new StatelessBean("ejb/Apple", Fruit.class));
        ejbJar.addEnterpriseBean(new StatelessBean("ejb/Peach", Fruit.class));
        ejbJar.addEnterpriseBean(new StatelessBean("ejb/Pear", Fruit.class));
        ejbJar.addEnterpriseBean(new StatelessBean("ejb/Plum", Fruit.class));
        assembler.createApplication(config.configureApplication(ejbJar));

        try {

            // good creds
View Full Code Here

        EjbModule ejbModule = new EjbModule(new EjbJar(), new OpenejbJar());
        EjbJar ejbJar = ejbModule.getEjbJar();
        OpenejbJar openejbJar = ejbModule.getOpenejbJar();

        StatelessBean statelessBean = ejbJar.addEnterpriseBean(new StatelessBean(WidgetBean.class));
        EjbDeployment deployment = openejbJar.addEjbDeployment(statelessBean);
        deployment.getProperties().put("color", "orange");
        deployment.getProperties().put("openejb.client.color", "red");

        EjbJarInfo ejbJarInfo = config.configureApplication(ejbModule);
View Full Code Here

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

        EjbJar ejbJar = new EjbJar();
        ejbJar.addEnterpriseBean(new StatelessBean(GreenBean.class));
        ejbJar.addEnterpriseBean(new StatelessBean(RedBean.class));

        EjbModule ejbModule = new EjbModule(ejbJar, new OpenejbJar());

        ejbModule.getOpenejbJar().addEjbDeployment(new EjbDeployment(null, "foo/bar/baz/Green", "GreenBean"));
        ejbModule.getOpenejbJar().addEjbDeployment(new EjbDeployment(null, "foo/bar/baz/Red", "RedBean"));
View Full Code Here

        p.put("bvalDatabase.JdbcUrl", "jdbc:hsqldb:mem:bval");
        return p;
    }

    @Module public StatelessBean app() throws Exception {
        final StatelessBean bean = new StatelessBean(PersistManager.class);
        bean.setLocalBean(new Empty());
        return bean;
    }
View Full Code Here

        Interceptor interceptorC = new Interceptor(SimpleInterceptorC.class);
        interceptorC.getAroundTimeout().add(new org.apache.openejb.jee.AroundTimeout(SimpleInterceptorC.class.getName(), "interceptorTimeoutAround"));
        ejbJar.addInterceptor(interceptorC);

        //Configure aroundTimeout by deployment plan
        StatelessBean subBeanA = new StatelessBean(SubBeanA.class);
        subBeanA.addAroundTimeout("beanTimeoutAround");
        ejbJar.addEnterpriseBean(subBeanA);
        assemblyDescriptor.addInterceptorBinding(new InterceptorBinding(subBeanA, interceptorA));
        assemblyDescriptor.addInterceptorBinding(new InterceptorBinding(subBeanA, interceptorB));
        assemblyDescriptor.addInterceptorBinding(new InterceptorBinding(subBeanA, interceptorC));

        //Configure aroundTimeout by annotation
        StatelessBean subBeanB = new StatelessBean(SubBeanB.class);
        ejbJar.addEnterpriseBean(subBeanB);
        assemblyDescriptor.addInterceptorBinding(new InterceptorBinding(subBeanB, interceptorA));
        assemblyDescriptor.addInterceptorBinding(new InterceptorBinding(subBeanB, interceptorB));
        assemblyDescriptor.addInterceptorBinding(new InterceptorBinding(subBeanB, interceptorC));

        //Override aroundTimeout annotation by deployment plan
        StatelessBean subBeanC = new StatelessBean(SubBeanC.class);
        subBeanC.addAroundTimeout("beanTimeoutAround");
        ejbJar.addEnterpriseBean(subBeanC);
        assemblyDescriptor.addInterceptorBinding(new InterceptorBinding(subBeanC, interceptorA));
        assemblyDescriptor.addInterceptorBinding(new InterceptorBinding(subBeanC, interceptorB));
        assemblyDescriptor.addInterceptorBinding(new InterceptorBinding(subBeanC, interceptorC));
View Full Code Here

        Persistence persistence = new Persistence(new org.apache.openejb.jee.jpa.unit.PersistenceUnit("foo-unit"));
        app.getPersistenceModules().add(new PersistenceModule("root", persistence));

        EjbJar ejbJar = new EjbJar();
        ejbJar.addEnterpriseBean(new StatelessBean(SuperBean.class));
        app.getEjbModules().add(new EjbModule(ejbJar));

        ClientModule clientModule = new ClientModule(null, app.getClassLoader(), app.getJarLocation(), null, null);
        clientModule.getLocalClients().add(this.getClass().getName());
View Full Code Here

TOP

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

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.