@Test public void run() { try { SystemAppInfo.preComputedInfo(new ConfigurationFactory() { @Override protected List<ContainerInfo> getContainerInfos() { return Collections.<ContainerInfo>singletonList(new SingletonSessionContainerInfo()); } @Override public boolean isOffline() { return true; } }); } catch (final IllegalStateException ise) { fail(ise.getMessage()); } }
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"); ejbJarInfo.uniqueId = "0"; final AppInfo appInfo = new AppInfo(); appInfo.appId = ejbJarInfo.moduleId; appInfo.path = appInfo.appId; appInfo.ejbJars.add(ejbJarInfo); return appInfo; }
SystemAppInfo { 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"); ejbJarInfo.uniqueId = "0"; final AppInfo appInfo = new AppInfo(); appInfo.appId = ejbJarInfo.moduleId; appInfo.path = appInfo.appId; appInfo.ejbJars.add(ejbJarInfo); return appInfo; } }
SystemAppInfo { 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"); ejbJarInfo.uniqueId = "0"; final AppInfo appInfo = new AppInfo(); appInfo.appId = ejbJarInfo.moduleId; appInfo.path = appInfo.appId; appInfo.ejbJars.add(ejbJarInfo); return appInfo; } private  SystemAppInfo(); }
SystemAppInfo { 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"); ejbJarInfo.uniqueId = "0"; final AppInfo appInfo = new AppInfo(); appInfo.appId = ejbJarInfo.moduleId; appInfo.path = appInfo.appId; appInfo.ejbJars.add(ejbJarInfo); return appInfo; } private  SystemAppInfo(); static AppInfo preComputedInfo(final ConfigurationFactory factory); }
SystemAppInfo { 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"); ejbJarInfo.uniqueId = "0"; final AppInfo appInfo = new AppInfo(); appInfo.appId = ejbJarInfo.moduleId; appInfo.path = appInfo.appId; appInfo.ejbJars.add(ejbJarInfo); return appInfo; } private  SystemAppInfo(); static AppInfo preComputedInfo(final ConfigurationFactory factory);  }