Package org.apache.openejb.jee

Examples of org.apache.openejb.jee.Method


            if (method.getLock() != null) {
                info.concurrencyAttribute = method.getLock().toString();
            }
            info.accessTimeout = toInfo(method.getAccessTimeout());
           
            Method m = new Method(bean.getEjbName(), null, method.getMethod().getMethodName());
            m.setMethodParams(method.getMethod().getMethodParams());           
            info.methods.add(getMethodInfo(m, ejbds));           
            ejbJarInfo.methodConcurrency.add(info);
        }
    }
View Full Code Here


            if (method.getLock() != null) {
                info.concurrencyAttribute = method.getLock().toString();
            }
            info.accessTimeout = toInfo(method.getAccessTimeout());

            final Method m = new Method(bean.getEjbName(), null, method.getMethod().getMethodName());
            m.setMethodParams(method.getMethod().getMethodParams());
            info.methods.add(getMethodInfo(m, ejbds));
            ejbJarInfo.methodConcurrency.add(info);
        }
    }
View Full Code Here

@RunWith(ValidationRunner.class)
public class CheckInvalidMethodPermissionsTest {
    @Keys( { @Key("methodPermission.ejbNameRequired"), @Key("methodPermission.noSuchEjbName") })
    public EjbJar test() throws Exception {
        EjbJar ejbJar = new EjbJar();
        MethodPermission permission = new MethodPermission(new Method((String) null, (String) null));
        ejbJar.getAssemblyDescriptor().getMethodPermission().add(permission);
        MethodPermission permission1 = new MethodPermission(new Method("wrongEjbName", "wrongMethodName"));
        ejbJar.getAssemblyDescriptor().getMethodPermission().add(permission1);
        return ejbJar;
    }
View Full Code Here

    @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));
View Full Code Here

@RunWith(ValidationRunner.class)
public class CheckInvalidContainerTransactionTest {
    @Keys( { @Key("containerTransaction.ejbNameRequired"), @Key("containerTransaction.noSuchEjbName") })
    public EjbJar test() throws Exception {
        EjbJar ejbJar = new EjbJar();
        ContainerTransaction tx = new ContainerTransaction(TransAttribute.REQUIRED, new Method((String) null, (String) null));
        ejbJar.getAssemblyDescriptor().getContainerTransaction().add(tx);
        ContainerTransaction tx1 = new ContainerTransaction(TransAttribute.REQUIRED, new Method("wrongEjbName", "wrongMethodName"));
        ejbJar.getAssemblyDescriptor().getContainerTransaction().add(tx1);
        return ejbJar;
    }
View Full Code Here

    public EjbJar xml() throws SecurityException, NoSuchMethodException {
        EjbJar ejbJar = new EjbJar();
        StatelessBean bean = ejbJar.addEnterpriseBean(new StatelessBean(CheeseEjb.class));
        bean.setTransactionType(TransactionType.BEAN);
        ContainerTransaction tx = new ContainerTransaction();
        tx.getMethod().add(new Method(bean.getEjbName(), CheeseEjb.class.getMethod("sayCheesePlease", null)));
        tx.setTransAttribute(TransAttribute.REQUIRED);
        ejbJar.getAssemblyDescriptor().getContainerTransaction().add(tx);
        return ejbJar;
    }
View Full Code Here

            if (method.getLock() != null) {
                info.concurrencyAttribute = method.getLock().toString();
            }
            info.accessTimeout = toInfo(method.getAccessTimeout());
           
            Method m = new Method(bean.getEjbName(), null, method.getMethod().getMethodName());
            m.setMethodParams(method.getMethod().getMethodParams());           
            info.methods.add(getMethodInfo(m, ejbds));           
            ejbJarInfo.methodConcurrency.add(info);
        }
    }
View Full Code Here

            if (method.getLock() != null) {
                info.concurrencyAttribute = method.getLock().toString();
            }
            info.accessTimeout = toInfo(method.getAccessTimeout());
           
            Method m = new Method(bean.getEjbName(), null, method.getMethod().getMethodName());
            m.setMethodParams(method.getMethod().getMethodParams());           
            info.methods.add(getMethodInfo(m, ejbds));           
            ejbJarInfo.methodConcurrency.add(info);
        }
    }
View Full Code Here

    MethodPermission methodPermission = new MethodPermission();
    List<Method> methods = methodPermission.getMethod();
    methodPermission.getRoleName().addAll(Arrays.asList(rolesAllowed));
    methodPermission.setUnchecked(unchecked);
    methodPermissions.add(methodPermission);
    Method method = new Method();
    method.setEjbName(beanName);
    method.setMethodName(methodName);
    method.setMethodParams(new MethodParams());
    methods.add(method);
   
    if (deny) {
      descriptor.getExcludeList().addMethod(method);
    }
View Full Code Here

    containerTransaction.setTransAttribute(TransAttribute.MANDATORY);
    containerTransactions.add(containerTransaction);
  }

  private Method createMethod(String ejbName, String methodName, String[] params) {
    Method method = new Method(ejbName, methodName);
    MethodParams methodParams = new MethodParams();

    for (int i = 0; i < params.length; i++) {
      methodParams.getMethodParam().add(params[i]);
    }
   
    method.setMethodParams(methodParams);
    return method;
  }
View Full Code Here

TOP

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

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.