Package org.apache.openejb.jee

Examples of org.apache.openejb.jee.StatefulBean


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

        EjbJar ejbJar = new EjbJar();
        ejbJar.addEnterpriseBean(new StatefulBean(Color.class));
        ejbJar.addEnterpriseBean(new StatefulBean(Red.class));
        ejbJar.addEnterpriseBean(new StatefulBean(Crimson.class));
        ejbJar.addEnterpriseBean(new StatefulBean(Scarlet.class));
        List<ContainerTransaction> declared = ejbJar.getAssemblyDescriptor().getContainerTransaction();

        declared.add(new ContainerTransaction(TransAttribute.REQUIRED, "*", "Crimson", "*"));
        declared.add(new ContainerTransaction(TransAttribute.REQUIRES_NEW, "*", "Crimson", "create"));
        ContainerTransaction o = new ContainerTransaction(TransAttribute.SUPPORTS, "*", "Crimson", "create");
View Full Code Here


        EjbJar ejbJar = new EjbJar();
        StatelessBean testBean = ejbJar.addEnterpriseBean(new StatelessBean("TestStateless", TestBean.class));
        testBean.addAroundInvoke("wrongMethod");
        testBean.addPostConstruct("wrongMethod");
        ejbJar.addEnterpriseBean(new SingletonBean("TestSingleton", TestBean.class));
        ejbJar.addEnterpriseBean(new StatefulBean("FooStateful", FooBean.class));
        ejbJar.addEnterpriseBean(new StatefulBean("BarStateful", BarBean.class));
        StatefulBean starBean = ejbJar.addEnterpriseBean(new StatefulBean("StarStateful", StarBean.class));
        starBean.setAfterBeginMethod(new NamedMethod("myAfterBegin"));
        starBean.setBeforeCompletionMethod(new NamedMethod("myBeforeCompletion"));
        starBean.setAfterCompletionMethod(new NamedMethod("myAfterCompletion"));
        return ejbJar;
    }
View Full Code Here

        System.setProperty("openejb.validation.output.level", "VERBOSE");
        EjbJar ejbJar = new EjbJar();
        StatelessBean sun = ejbJar.addEnterpriseBean(new StatelessBean("SunStateless", Sun.class));
        sun.setLocalHome(SunLocalHome.class.getName());
        sun.setLocal(SunLocal.class.getName());
        StatefulBean meteor = ejbJar.addEnterpriseBean(new StatefulBean("MeteorStateful", Meteor.class));
        meteor.setLocal(SunLocal.class.getName());
        meteor.setLocalHome(SunLocalHome.class.getName());
        return ejbJar;
    }
View Full Code Here

        StatelessBean stateless = new StatelessBean(FooStateless.class);
        stateless.setHomeAndRemote("WrongHome", "WrongRemote");
        stateless.setLocal("WrongLocal");
        stateless.setLocalHome("WrongLocalHome");
        ejbJar.addEnterpriseBean(stateless);
        StatefulBean stateful = new StatefulBean(FooStateful.class);
        stateful.setHomeAndRemote("WrongHome", "WrongRemote");
        stateful.setLocal("WrongLocal");
        stateful.setLocalHome("WrongLocalHome");
        ejbJar.addEnterpriseBean(stateful);
        EntityBean bmpEntityBean = new EntityBean(FooEntityBMP.class, PersistenceType.BEAN);
        bmpEntityBean.setHome("WrongHome");
        bmpEntityBean.setLocalHome("WrongLocalHome");
        bmpEntityBean.setRemote("WrongRemote");
View Full Code Here

        final StatefulSessionContainerInfo statefulContainerInfo = config.configureService(StatefulSessionContainerInfo.class);
        assembler.createContainer(statefulContainerInfo);

        final EjbJar ejbJar = new EjbJar();
               
        StatefulBean bean1 = new StatefulBean(MyLocalBeanImpl.class);
        Timeout timeout1 = new Timeout();
        timeout1.setTimeout(1000);
        timeout1.setUnit(TimeUnit.MILLISECONDS);
        ConcurrentMethod method1 = new ConcurrentMethod();
        method1.setMethod(new NamedMethod("*"));
        method1.setAccessTimeout(timeout1);
        bean1.getConcurrentMethod().add(method1);
       
        StatefulBean bean2 = new StatefulBean("BeanNegative", MyLocalBeanImpl.class);
        Timeout timeout2 = new Timeout();
        timeout2.setTimeout(-1);
        timeout2.setUnit(TimeUnit.MILLISECONDS);
        ConcurrentMethod method2 = new ConcurrentMethod();
        method2.setMethod(new NamedMethod("*"));
        method2.setAccessTimeout(timeout2);
        bean2.getConcurrentMethod().add(method2);

        ejbJar.addEnterpriseBean(bean1);
        ejbJar.addEnterpriseBean(bean2);

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

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

        EjbJar ejbJar = new EjbJar();
        ejbJar.addEnterpriseBean(new StatefulBean(MyBean.class));

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



    @Module
    public SessionBean getEjbs() {
        return new StatefulBean(Brown.class);
    }
View Full Code Here

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

        EjbJar ejbJar = new EjbJar();
        ejbJar.addEnterpriseBean(new StatefulBean(Color.class));
        ejbJar.addEnterpriseBean(new StatefulBean(Red.class));
        EjbJarInfo ejbJarInfo = config.configureApplication(ejbJar);

        StatefulBeanInfo expected = (StatefulBeanInfo) ejbJarInfo.enterpriseBeans.get(0);
        StatefulBeanInfo actual = (StatefulBeanInfo) ejbJarInfo.enterpriseBeans.get(1);
View Full Code Here

                if (!isValidEjbAnnotationUsage(Stateful.class, beanClass, ejbName, ejbModule)) continue;

                EnterpriseBean enterpriseBean = ejbJar.getEnterpriseBean(ejbName);
                if (enterpriseBean == null) {
                    enterpriseBean = new StatefulBean(ejbName, beanClass.get());
                    ejbJar.addEnterpriseBean(enterpriseBean);
                }
                if (enterpriseBean.getEjbClass() == null) {
                    enterpriseBean.setEjbClass(beanClass.get());
                }
View Full Code Here

                ejbJar.addEnterpriseBean(new StatelessBean(clazz));
            }

            if (isStatefull(clazz))
            {
                ejbJar.addEnterpriseBean(new StatefulBean(clazz));
            }
        }

        return new EjbModule(ejbJar);
View Full Code Here

TOP

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

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.