Search in sources :

Example 16 with ContainerInfo

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

the class ContainerUtils method getContainerInfos.

public static List<ContainerInfo> getContainerInfos(final AppModule module, final ConfigurationFactory configFactory) throws OpenEJBException {
    final List<ContainerInfo> containerInfos = new ArrayList<>();
    if (module.getContainers().isEmpty()) {
        return containerInfos;
    }
    final String prefix = module.getModuleId() + "/";
    for (final Container container : module.getContainers()) {
        if (container.getId() == null) {
            throw new IllegalStateException("a container can't get a null id: " + container.getType() + " from " + module.getModuleId());
        }
        if (!container.getId().startsWith(prefix)) {
            container.setId(prefix + container.getId());
        }
        final ContainerInfo containerInfo = configFactory.createContainerInfo(container);
        containerInfo.originAppName = module.getModuleId();
        final Object applicationWideProperty = containerInfo.properties.remove("ApplicationWide");
        if (applicationWideProperty != null) {
            containerInfo.applicationWide = Boolean.parseBoolean(applicationWideProperty.toString().trim());
        }
        containerInfos.add(containerInfo);
    }
    return containerInfos;
}
Also used : Container(org.apache.openejb.config.sys.Container) ContainerInfo(org.apache.openejb.assembler.classic.ContainerInfo) ArrayList(java.util.ArrayList)

Example 17 with ContainerInfo

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

the class ServerContext method createContainer.

public void createContainer(final Container service) throws OpenEJBException {
    final ContainerInfo serviceInfo = factory.configureService(service, ContainerInfo.class);
    assembler.createContainer(serviceInfo);
}
Also used : ContainerInfo(org.apache.openejb.assembler.classic.ContainerInfo)

Aggregations

ContainerInfo (org.apache.openejb.assembler.classic.ContainerInfo)17 MdbContainerInfo (org.apache.openejb.assembler.classic.MdbContainerInfo)9 Container (org.apache.openejb.config.sys.Container)7 ArrayList (java.util.ArrayList)5 OpenEJBException (org.apache.openejb.OpenEJBException)4 SingletonSessionContainerInfo (org.apache.openejb.assembler.classic.SingletonSessionContainerInfo)4 StatelessSessionContainerInfo (org.apache.openejb.assembler.classic.StatelessSessionContainerInfo)4 AppInfo (org.apache.openejb.assembler.classic.AppInfo)3 BmpEntityContainerInfo (org.apache.openejb.assembler.classic.BmpEntityContainerInfo)3 CmpEntityContainerInfo (org.apache.openejb.assembler.classic.CmpEntityContainerInfo)3 ManagedContainerInfo (org.apache.openejb.assembler.classic.ManagedContainerInfo)3 OpenEjbConfiguration (org.apache.openejb.assembler.classic.OpenEjbConfiguration)3 StatefulSessionContainerInfo (org.apache.openejb.assembler.classic.StatefulSessionContainerInfo)3 MessageDrivenBean (org.apache.openejb.jee.MessageDrivenBean)3 File (java.io.File)2 EJBContainer (javax.ejb.embeddable.EJBContainer)2 EjbJarInfo (org.apache.openejb.assembler.classic.EjbJarInfo)2 EjbJar (org.apache.openejb.jee.EjbJar)2 EnterpriseBean (org.apache.openejb.jee.EnterpriseBean)2 EjbDeployment (org.apache.openejb.jee.oejb3.EjbDeployment)2