Search in sources :

Example 1 with MethodConcurrencyInfo

use of org.apache.openejb.assembler.classic.MethodConcurrencyInfo in project tomee by apache.

the class EjbJarInfoBuilder method copyConcurrentMethods.

private void copyConcurrentMethods(final SessionBean bean, final EjbJarInfo ejbJarInfo, final Map ejbds) {
    for (final ConcurrentMethod method : bean.getConcurrentMethod()) {
        final MethodConcurrencyInfo info = new MethodConcurrencyInfo();
        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);
    }
}
Also used : ConcurrentMethod(org.apache.openejb.jee.ConcurrentMethod) RemoveMethod(org.apache.openejb.jee.RemoveMethod) AsyncMethod(org.apache.openejb.jee.AsyncMethod) CallbackMethod(org.apache.openejb.jee.CallbackMethod) QueryMethod(org.apache.openejb.jee.QueryMethod) ConcurrentMethod(org.apache.openejb.jee.ConcurrentMethod) Method(org.apache.openejb.jee.Method) NamedMethod(org.apache.openejb.jee.NamedMethod) InitMethod(org.apache.openejb.jee.InitMethod) MethodConcurrencyInfo(org.apache.openejb.assembler.classic.MethodConcurrencyInfo)

Example 2 with MethodConcurrencyInfo

use of org.apache.openejb.assembler.classic.MethodConcurrencyInfo in project tomee by apache.

the class SystemAppInfo method preComputedInfo.

//
//
// DONT MODIFY IT WITHOUT UPDATING org.apache.openejb.config.SystemApps
//
//
public static AppInfo preComputedInfo(final ConfigurationFactory factory) {
    final String singletonContainerId;
    try {
        singletonContainerId = findSingletonContainer(factory);
    } catch (final OpenEJBException e) {
        throw new IllegalStateException(e);
    }
    final EjbJarInfo ejbJarInfo = new EjbJarInfo();
    ejbJarInfo.moduleId = "openejb";
    ejbJarInfo.moduleName = ejbJarInfo.moduleId;
    ejbJarInfo.moduleUri = URI.create(ejbJarInfo.moduleId);
    ejbJarInfo.properties.setProperty("openejb.deploymentId.format", "{ejbName}");
    ejbJarInfo.properties.setProperty("openejb.jndiname.format", "{deploymentId}{interfaceType.openejbLegacyName}");
    final SingletonBeanInfo deployer = new SingletonBeanInfo();
    deployer.ejbDeploymentId = "openejb/Deployer";
    deployer.ejbName = deployer.ejbDeploymentId;
    deployer.ejbClass = "org.apache.openejb.assembler.DeployerEjb";
    deployer.businessRemote.add("org.apache.openejb.assembler.Deployer");
    deployer.parents.add(deployer.ejbClass);
    deployer.transactionType = "BEAN";
    deployer.concurrencyType = "CONTAINER";
    deployer.containerId = singletonContainerId;
    ejbJarInfo.enterpriseBeans.add(deployer);
    final SingletonBeanInfo configuration = new SingletonBeanInfo();
    configuration.ejbDeploymentId = "openejb/ConfigurationInfo";
    configuration.ejbName = deployer.ejbDeploymentId;
    configuration.ejbClass = "org.apache.openejb.assembler.classic.cmd.ConfigurationInfoEjb";
    configuration.businessRemote.add("org.apache.openejb.assembler.classic.cmd.ConfigurationInfo");
    configuration.parents.add(deployer.ejbClass);
    configuration.transactionType = "CONTAINER";
    configuration.concurrencyType = "CONTAINER";
    configuration.containerId = singletonContainerId;
    ejbJarInfo.enterpriseBeans.add(configuration);
    final SingletonBeanInfo mejb = new SingletonBeanInfo();
    mejb.ejbDeploymentId = "MEJB";
    mejb.ejbName = deployer.ejbDeploymentId;
    mejb.ejbClass = "org.apache.openejb.mgmt.MEJBBean";
    mejb.home = "javax.management.j2ee.ManagementHome";
    mejb.remote = "javax.management.j2ee.Management";
    mejb.parents.add(deployer.ejbClass);
    mejb.transactionType = "CONTAINER";
    mejb.concurrencyType = "CONTAINER";
    mejb.containerId = singletonContainerId;
    ejbJarInfo.enterpriseBeans.add(mejb);
    for (final EnterpriseBeanInfo ebi : ejbJarInfo.enterpriseBeans) {
        final MethodInfo methodInfo = new MethodInfo();
        methodInfo.ejbDeploymentId = ebi.ejbDeploymentId;
        methodInfo.ejbName = ebi.ejbName;
        methodInfo.methodName = "*";
        methodInfo.className = ebi.ejbClass;
        final MethodConcurrencyInfo methodConcurrencyInfo = new MethodConcurrencyInfo();
        methodConcurrencyInfo.concurrencyAttribute = "READ";
        methodConcurrencyInfo.methods.add(methodInfo);
        ejbJarInfo.methodConcurrency.add(methodConcurrencyInfo);
    }
    final CallbackInfo callbackInfo = new CallbackInfo();
    callbackInfo.className = "org.apache.openejb.security.internal.InternalSecurityInterceptor";
    callbackInfo.method = "invoke";
    final InterceptorInfo interceptorInfo = new InterceptorInfo();
    interceptorInfo.clazz = "org.apache.openejb.security.internal.InternalSecurityInterceptor";
    interceptorInfo.aroundInvoke.add(callbackInfo);
    ejbJarInfo.interceptors.add(interceptorInfo);
    final InterceptorBindingInfo interceptorBindingInfo = new InterceptorBindingInfo();
    interceptorBindingInfo.ejbName = "*";
    interceptorBindingInfo.interceptors.add("org.apache.openejb.security.internal.InternalSecurityInterceptor");
    ejbJarInfo.interceptorBindings.add(interceptorBindingInfo);
    ejbJarInfo.mbeans.add("org.apache.openejb.assembler.monitoring.JMXDeployer");
    // we start at 1 so no conflict using 0
    ejbJarInfo.uniqueId = "0";
    final AppInfo appInfo = new AppInfo();
    appInfo.appId = ejbJarInfo.moduleId;
    appInfo.path = appInfo.appId;
    appInfo.ejbJars.add(ejbJarInfo);
    return appInfo;
}
Also used : EnterpriseBeanInfo(org.apache.openejb.assembler.classic.EnterpriseBeanInfo) OpenEJBException(org.apache.openejb.OpenEJBException) CallbackInfo(org.apache.openejb.assembler.classic.CallbackInfo) InterceptorBindingInfo(org.apache.openejb.assembler.classic.InterceptorBindingInfo) InterceptorInfo(org.apache.openejb.assembler.classic.InterceptorInfo) MethodInfo(org.apache.openejb.assembler.classic.MethodInfo) SingletonBeanInfo(org.apache.openejb.assembler.classic.SingletonBeanInfo) EjbJarInfo(org.apache.openejb.assembler.classic.EjbJarInfo) MethodConcurrencyInfo(org.apache.openejb.assembler.classic.MethodConcurrencyInfo) AppInfo(org.apache.openejb.assembler.classic.AppInfo)

Example 3 with MethodConcurrencyInfo

use of org.apache.openejb.assembler.classic.MethodConcurrencyInfo in project tomee by apache.

the class EjbJarInfoBuilder method initMethodConcurrency.

private void initMethodConcurrency(final EjbModule jar, final Map ejbds, final EjbJarInfo ejbJarInfo) {
    final List<ContainerConcurrency> containerConcurrency = jar.getEjbJar().getAssemblyDescriptor().getContainerConcurrency();
    for (final ContainerConcurrency att : containerConcurrency) {
        final MethodConcurrencyInfo info = new MethodConcurrencyInfo();
        info.description = att.getDescription();
        if (att.getLock() != null) {
            info.concurrencyAttribute = att.getLock().toString();
        }
        info.accessTimeout = toInfo(att.getAccessTimeout());
        info.methods.addAll(getMethodInfos(att.getMethod(), ejbds));
        ejbJarInfo.methodConcurrency.add(info);
    }
}
Also used : ContainerConcurrency(org.apache.openejb.jee.ContainerConcurrency) MethodConcurrencyInfo(org.apache.openejb.assembler.classic.MethodConcurrencyInfo)

Aggregations

MethodConcurrencyInfo (org.apache.openejb.assembler.classic.MethodConcurrencyInfo)3 OpenEJBException (org.apache.openejb.OpenEJBException)1 AppInfo (org.apache.openejb.assembler.classic.AppInfo)1 CallbackInfo (org.apache.openejb.assembler.classic.CallbackInfo)1 EjbJarInfo (org.apache.openejb.assembler.classic.EjbJarInfo)1 EnterpriseBeanInfo (org.apache.openejb.assembler.classic.EnterpriseBeanInfo)1 InterceptorBindingInfo (org.apache.openejb.assembler.classic.InterceptorBindingInfo)1 InterceptorInfo (org.apache.openejb.assembler.classic.InterceptorInfo)1 MethodInfo (org.apache.openejb.assembler.classic.MethodInfo)1 SingletonBeanInfo (org.apache.openejb.assembler.classic.SingletonBeanInfo)1 AsyncMethod (org.apache.openejb.jee.AsyncMethod)1 CallbackMethod (org.apache.openejb.jee.CallbackMethod)1 ConcurrentMethod (org.apache.openejb.jee.ConcurrentMethod)1 ContainerConcurrency (org.apache.openejb.jee.ContainerConcurrency)1 InitMethod (org.apache.openejb.jee.InitMethod)1 Method (org.apache.openejb.jee.Method)1 NamedMethod (org.apache.openejb.jee.NamedMethod)1 QueryMethod (org.apache.openejb.jee.QueryMethod)1 RemoveMethod (org.apache.openejb.jee.RemoveMethod)1