Search in sources :

Example 16 with Method$JAXB.readMethod

use of org.apache.openejb.jee.Method$JAXB.readMethod in project tomee by apache.

the class InterfaceTransactionTest method module.

@Module
public EjbJar module() throws Exception {
    final EjbJar ejbJar = new EjbJar();
    ejbJar.addEnterpriseBean(new StatelessBean(OrangeBean.class));
    final Method remoteMethod = new Method("OrangeBean", "isInTransaction").withInterface(MethodIntf.REMOTE);
    final Method localMethod = new Method("OrangeBean", "isInTransaction").withInterface(MethodIntf.LOCAL);
    final List<ContainerTransaction> transactions = ejbJar.getAssemblyDescriptor().getContainerTransaction();
    transactions.add(new ContainerTransaction(TransAttribute.REQUIRED, remoteMethod));
    transactions.add(new ContainerTransaction(TransAttribute.SUPPORTS, localMethod));
    return ejbJar;
}
Also used : StatelessBean(org.apache.openejb.jee.StatelessBean) ContainerTransaction(org.apache.openejb.jee.ContainerTransaction) Method(org.apache.openejb.jee.Method) EjbJar(org.apache.openejb.jee.EjbJar) Module(org.apache.openejb.testing.Module)

Example 17 with Method$JAXB.readMethod

use of org.apache.openejb.jee.Method$JAXB.readMethod in project tomee by apache.

the class CheckInvalidContainerTransactionTest method test.

@Keys({ @Key("containerTransaction.ejbNameRequired"), @Key("containerTransaction.noSuchEjbName") })
public EjbJar test() throws Exception {
    final EjbJar ejbJar = new EjbJar();
    final ContainerTransaction tx = new ContainerTransaction(TransAttribute.REQUIRED, new Method((String) null, (String) null));
    ejbJar.getAssemblyDescriptor().getContainerTransaction().add(tx);
    final ContainerTransaction tx1 = new ContainerTransaction(TransAttribute.REQUIRED, new Method("wrongEjbName", "wrongMethodName"));
    ejbJar.getAssemblyDescriptor().getContainerTransaction().add(tx1);
    return ejbJar;
}
Also used : ContainerTransaction(org.apache.openejb.jee.ContainerTransaction) Method(org.apache.openejb.jee.Method) EjbJar(org.apache.openejb.jee.EjbJar)

Aggregations

Method (org.apache.openejb.jee.Method)9 Method$JAXB.readMethod (org.apache.openejb.jee.Method$JAXB.readMethod)8 Method$JAXB.writeMethod (org.apache.openejb.jee.Method$JAXB.writeMethod)8 Text$JAXB.readText (org.apache.openejb.jee.Text$JAXB.readText)8 Text$JAXB.writeText (org.apache.openejb.jee.Text$JAXB.writeText)8 RuntimeContext (org.metatype.sxc.jaxb.RuntimeContext)8 ArrayList (java.util.ArrayList)7 ContainerTransaction (org.apache.openejb.jee.ContainerTransaction)6 EjbJar (org.apache.openejb.jee.EjbJar)6 CollapsedStringAdapter (javax.xml.bind.annotation.adapters.CollapsedStringAdapter)4 QName (javax.xml.namespace.QName)4 MethodPermission (org.apache.openejb.jee.MethodPermission)4 Attribute (org.metatype.sxc.util.Attribute)4 XoXMLStreamReader (org.metatype.sxc.util.XoXMLStreamReader)4 AssemblyDescriptor (org.apache.openejb.jee.AssemblyDescriptor)3 EnterpriseBean (org.apache.openejb.jee.EnterpriseBean)3 InterceptorBinding (org.apache.openejb.jee.InterceptorBinding)3 AsyncMethod (org.apache.openejb.jee.AsyncMethod)2 CallbackMethod (org.apache.openejb.jee.CallbackMethod)2 ConcurrentLockType$JAXB.parseConcurrentLockType (org.apache.openejb.jee.ConcurrentLockType$JAXB.parseConcurrentLockType)2