Package org.apache.openejb.jee

Examples of org.apache.openejb.jee.ContainerTransaction


            public Map<String, List<MethodAttribute>> getExistingDeclarations() {
                return assemblyDescriptor.getMethodTransactionMap(ejbName);
            }

            public void addClassLevelDeclaration(final TransactionAttribute attribute, final Class type) {
                final ContainerTransaction ctx = new ContainerTransaction(cast(attribute.value()), type.getName(), ejbName, "*");
                assemblyDescriptor.getContainerTransaction().add(ctx);
            }
View Full Code Here


                final ContainerTransaction ctx = new ContainerTransaction(cast(attribute.value()), type.getName(), ejbName, "*");
                assemblyDescriptor.getContainerTransaction().add(ctx);
            }

            public void addMethodLevelDeclaration(final TransactionAttribute attribute, final Method method) {
                final ContainerTransaction ctx = new ContainerTransaction(cast(attribute.value()), ejbName, method);
                assemblyDescriptor.getContainerTransaction().add(ctx);
            }
View Full Code Here

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

        declared.add(new ContainerTransaction(TransAttribute.REQUIRED, "*", "Crimson", "*"));
        declared.add(new ContainerTransaction(TransAttribute.REQUIRES_NEW, "*", "Crimson", "create"));
        final ContainerTransaction o = new ContainerTransaction(TransAttribute.SUPPORTS, "*", "Crimson", "create");
        o.getMethod().get(0).setMethodIntf(MethodIntf.HOME);
        declared.add(o);
        declared.add(new ContainerTransaction(TransAttribute.REQUIRES_NEW, "*", "Crimson", "remove"));
        declared.add(new ContainerTransaction(TransAttribute.REQUIRES_NEW, Color.class.getName(), "Scarlet", "*"));
        declared.add(new ContainerTransaction(TransAttribute.NEVER, Red.class.getName(), "Scarlet", "red"));
        declared.add(new ContainerTransaction(TransAttribute.REQUIRED, "Scarlet", Scarlet.class.getMethod("scarlet")));

        final EjbJarInfo ejbJarInfo = config.configureApplication(ejbJar);
        assembler.createApplication(ejbJarInfo);

        final InitialContext context = new InitialContext();
View Full Code Here

            public Map<String, List<MethodAttribute>> getExistingDeclarations() {
                return assemblyDescriptor.getMethodTransactionMap(ejbName);
            }

            public void addClassLevelDeclaration(TransactionAttribute attribute, Class type) {
                ContainerTransaction ctx = new ContainerTransaction(cast(attribute.value()), type.getName(), ejbName, "*");
                assemblyDescriptor.getContainerTransaction().add(ctx);
            }
View Full Code Here

                ContainerTransaction ctx = new ContainerTransaction(cast(attribute.value()), type.getName(), ejbName, "*");
                assemblyDescriptor.getContainerTransaction().add(ctx);
            }

            public void addMethodLevelDeclaration(TransactionAttribute attribute, Method method) {
                ContainerTransaction ctx = new ContainerTransaction(cast(attribute.value()), ejbName, method);
                assemblyDescriptor.getContainerTransaction().add(ctx);
            }
View Full Code Here

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

        declared.add(new ContainerTransaction(TransAttribute.REQUIRED, "*", "*", "*"));
        declared.add(new ContainerTransaction(TransAttribute.SUPPORTS, "*", "Crimson", "*"));
        declared.add(new ContainerTransaction(TransAttribute.SUPPORTS, Color.class.getName(), "Scarlet", "*"));
        declared.add(new ContainerTransaction(TransAttribute.NEVER, Red.class.getName(), "Scarlet", "red"));
        declared.add(new ContainerTransaction(TransAttribute.REQUIRED, "Scarlet", Scarlet.class.getMethod("scarlet")));

        ejbJar.getAssemblyDescriptor().addInterceptorBinding(new InterceptorBinding("*", AttributeInterceptor.class.getName()));

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

        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");
        o.getMethod().get(0).setMethodIntf(MethodIntf.HOME);
        declared.add(o);
        declared.add(new ContainerTransaction(TransAttribute.REQUIRES_NEW, "*", "Crimson", "remove"));
        declared.add(new ContainerTransaction(TransAttribute.REQUIRES_NEW, Color.class.getName(), "Scarlet", "*"));
        declared.add(new ContainerTransaction(TransAttribute.NEVER, Red.class.getName(), "Scarlet", "red"));
        declared.add(new ContainerTransaction(TransAttribute.REQUIRED, "Scarlet", Scarlet.class.getMethod("scarlet")));

        EjbJarInfo ejbJarInfo = config.configureApplication(ejbJar);
        assembler.createApplication(ejbJarInfo);

        InitialContext context = new InitialContext();
View Full Code Here

            public Map<String, List<MethodAttribute>> getExistingDeclarations() {
                return assemblyDescriptor.getMethodTransactionMap(ejbName);
            }

            public void addClassLevelDeclaration(TransactionAttribute attribute, Class type) {
                ContainerTransaction ctx = new ContainerTransaction(cast(attribute.value()), type.getName(), ejbName, "*");
                assemblyDescriptor.getContainerTransaction().add(ctx);
            }
View Full Code Here

                ContainerTransaction ctx = new ContainerTransaction(cast(attribute.value()), type.getName(), ejbName, "*");
                assemblyDescriptor.getContainerTransaction().add(ctx);
            }

            public void addMethodLevelDeclaration(TransactionAttribute attribute, Method method) {
                ContainerTransaction ctx = new ContainerTransaction(cast(attribute.value()), ejbName, method);
                assemblyDescriptor.getContainerTransaction().add(ctx);
            }
View Full Code Here

        //    <method-name>*</method-name>
        //  </method>
        //  <trans-attribute>Supports</trans-attribute>
        //</container-transaction>

        transactions.add(new ContainerTransaction(TransAttribute.SUPPORTS, null, "MyBmpBean", "*"));
        transactions.add(new ContainerTransaction(TransAttribute.SUPPORTS, null, "MyCmpBean", "*"));
        transactions.add(new ContainerTransaction(TransAttribute.SUPPORTS, null, "MySingletonBean", "*"));

        final File f = new File("test").getAbsoluteFile();
        if (!f.exists() && !f.mkdirs()) {
            throw new Exception("Failed to create test directory: " + f);
        }
View Full Code Here

TOP

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

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.