Package org.apache.openejb.jee

Examples of org.apache.openejb.jee.StatefulBean


        TestSecurityService securityService = (TestSecurityService) SystemInstance.get().getComponent(SecurityService.class);

        securityService.login("foo", "Jazz", "Rock", "Reggae", "HipHop");

        EjbJar ejbJar = new EjbJar();
        ejbJar.addEnterpriseBean(new StatefulBean(Color.class));
        List<MethodPermission> permissions = ejbJar.getAssemblyDescriptor().getMethodPermission();
        permissions.add(new MethodPermission("*", "Color", "*", "Foo"));
        permissions.add(new MethodPermission("*", "Color", "create").setUnchecked());
        permissions.add(new MethodPermission("*", "Color", "ejbCreate").setUnchecked());

View Full Code Here


        statefulContainerInfo.properties.setProperty("BulkPassivate", "1");
        statefulContainerInfo.properties.setProperty("Frequency", "0");
        assembler.createContainer(statefulContainerInfo);

        EjbJar ejbJar = new EjbJar();
        StatefulBean bean = ejbJar.addEnterpriseBean(new StatefulBean(TargetBean.class));
        bean.setHomeAndRemote(TargetHome.class, Target.class);

        assembler.createApplication(config.configureApplication(new EjbModule(getClass().getClassLoader(), getClass().getSimpleName(), "test", ejbJar, null)));

        calls.clear();
View Full Code Here

        assembler.createContainer(statefulContainerInfo);

        // Setup the descriptor information

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

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

        WidgetBean.lifecycle.clear();
View Full Code Here

    public EjbModule buildTestApp() {
        EjbJar ejbJar = new EjbJar();
        AssemblyDescriptor ad = ejbJar.getAssemblyDescriptor();

        EnterpriseBean bean = ejbJar.addEnterpriseBean(new StatefulBean(TargetBean.class));

        Interceptor interceptor;

        interceptor = ejbJar.addInterceptor(new Interceptor(ClassInterceptor.class));
        ad.addInterceptorBinding(new InterceptorBinding(bean, interceptor));
View Full Code Here

        AppModule appModule = new AppModule(getClass().getClassLoader(), "dummy.jar");
        List<EjbModule> ejbModules = appModule.getEjbModules();

        EjbJar ejbJar = new EjbJar();
       
        StatefulBean sfsb = new StatefulBean();
        String sfsbName = "SFSB";
        sfsb.setEjbName(sfsbName);
        ejbJar.addEnterpriseBean(sfsb);
       
        StatelessBean slsb = new StatelessBean();
        String slsbName = "SLSB";
        slsb.setEjbName(slsbName);
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.getName());
                    ejbJar.addEnterpriseBean(enterpriseBean);
                }
                if (enterpriseBean.getEjbClass() == null) {
                    enterpriseBean.setEjbClass(beanClass.getName());
                }
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

        // Setup the descriptor information

        EjbJar ejbJar = new EjbJar();
        ejbJar.addEnterpriseBean(new StatelessBean(BlueStatelessBean.class));
        ejbJar.addEnterpriseBean(new StatefulBean(RedStatefulBean.class));
        ejbJar.addEnterpriseBean(new StatefulBean(LegacyStatefulBean.class));

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

        addStatefulBean(ejbJar, ExtendedContextBean.class, "Extendedx2", "Extendedx3");
        addStatefulBean(ejbJar, ExtendedContextBean.class, "Extendedx3", "Extendedx4");
        addStatefulBean(ejbJar, ExtendedContextBean.class, "Extendedx4", "Extendedx5");
        addStatefulBean(ejbJar, ExtendedContextBean.class, "ExtendedToTransaction", "StatelessTransactionToExtended");
        addStatefulBean(ejbJar, ExtendedContextBean.class, "Extendedx5", "Extendedx6");
        ejbJar.addEnterpriseBean(new StatefulBean("Extendedx6", EndNodeBean.class));

        // Add six beans and link them all in a chain
        addStatefulBean(ejbJar, TransactionContextBean.class, "Transaction", "Transactionx2");
        addStatefulBean(ejbJar, TransactionContextBean.class, "Transactionx2", "Transactionx3");
        addStatefulBean(ejbJar, TransactionContextBean.class, "Transactionx3", "Transactionx4");
        addStatefulBean(ejbJar, TransactionContextBean.class, "Transactionx4", "Transactionx5");
        addStatefulBean(ejbJar, TransactionContextBean.class, "Transactionx5", "Transactionx6");
        addStatefulBean(ejbJar, TransactionContextBean.class, "TransactionToExtended", "Extendedx5");
       
        addStatelessBean(ejbJar, TransactionContextBean.class, "StatelessTransactionToExtended", "Extendedx5");
        ejbJar.addEnterpriseBean(new StatefulBean("Transactionx6", EndNodeBean.class));
       
        ejbJar.setAssemblyDescriptor(new AssemblyDescriptor());
        ejbJar.getAssemblyDescriptor().addApplicationException(IllegalArgumentException.class, false);
        ejbJar.getAssemblyDescriptor().addApplicationException(ArgumentException.class, false);
       
View Full Code Here

        AppInfo info = config.configureApplication(appModule);
        assembler.createApplication(info);
    }

    private void addStatefulBean(EjbJar ejbJar, Class<?> ejbClass, String name, String reference) {
        StatefulBean bean = ejbJar.addEnterpriseBean(new StatefulBean(name, ejbClass));
        bean.getEjbLocalRef().add(new EjbLocalRef("child", reference));
    }
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.