private String installResource(final String beanName, final ResourceInfo resourceInfo) throws OpenEJBException { final String resourceAdapterId = resourceInfo.properties.getProperty("ResourceAdapter"); if (resourceAdapterId != null) { final String newResourceId = getResourceId(beanName, resourceAdapterId, null, null); if (!resourceAdapterId.equals(newResourceId)) { resourceInfo.properties.setProperty("ResourceAdapter", newResourceId); } } final String dataSourceId = resourceInfo.properties.getProperty("DataSource"); if (dataSourceId != null && dataSourceId.length() > 0) { final String newResourceId = getResourceId(beanName, dataSourceId, null, null); if (!dataSourceId.equals(newResourceId)) { resourceInfo.properties.setProperty("DataSource", newResourceId); } } configFactory.install(resourceInfo); return resourceInfo.id; }
private String installResource(final String beanName, final ResourceInfo resourceInfo) throws OpenEJBException { final String resourceAdapterId = resourceInfo.properties.getProperty("ResourceAdapter"); if (resourceAdapterId != null) { final String newResourceId = getResourceId(beanName, resourceAdapterId, null, null); if (!resourceAdapterId.equals(newResourceId)) { resourceInfo.properties.setProperty("ResourceAdapter", newResourceId); } } final String dataSourceId = resourceInfo.properties.getProperty("DataSource"); if (dataSourceId != null && dataSourceId.length() > 0) { final String newResourceId = getResourceId(beanName, dataSourceId, null, null); if (!dataSourceId.equals(newResourceId)) { resourceInfo.properties.setProperty("DataSource", newResourceId); } } configFactory.install(resourceInfo); return resourceInfo.id; }
private String installResource(String beanName, ResourceInfo resourceInfo) throws OpenEJBException { String resourceAdapterId = resourceInfo.properties.getProperty("ResourceAdapter"); if (resourceAdapterId != null) { String newResourceId = getResourceId(beanName, resourceAdapterId, null, null); if (resourceAdapterId != newResourceId) { resourceInfo.properties.setProperty("ResourceAdapter", newResourceId); } } String dataSourceId = resourceInfo.properties.getProperty("DataSource"); if (dataSourceId != null && dataSourceId.length() > 0) { String newResourceId = getResourceId(beanName, dataSourceId, null, null); if (dataSourceId != newResourceId) { resourceInfo.properties.setProperty("DataSource", newResourceId); } } configFactory.install(resourceInfo); return resourceInfo.id; }
private static String findSingletonContainer(final ConfigurationFactory configFactory) throws OpenEJBException { for (final ContainerInfo containerInfo : configFactory.getContainerInfos()) { if (SingletonSessionContainerInfo.class.isInstance(containerInfo)) { return containerInfo.id; } } if (configFactory.isOffline()) { throw new IllegalStateException("system application (openejb) needs a singleton container. " + "Noone is defined and container is in offline mode. " + "Please define one in tomee.xml."); } final ContainerInfo containerInfo = configFactory.configureService(SingletonSessionContainerInfo.class); configFactory.install(containerInfo); return containerInfo.id; }
private String createContainer(final Class<? extends ContainerInfo> containerInfoType, final EjbDeployment ejbDeployment, final EnterpriseBean bean) throws OpenEJBException { if (!autoCreateContainers) { throw new OpenEJBException("A container of type " + getType(bean) + " must be declared in the configuration file for bean: " + bean.getEjbName()); } // get the container info (data used to build the container) final ContainerInfo containerInfo = configFactory.configureService(containerInfoType); logger.info("Auto-creating a container for bean " + ejbDeployment.getDeploymentId() + ": Container(type=" + getType(bean) + ", id=" + containerInfo.id + ")"); // if the is an MDB container we need to resolve the resource adapter final String resourceAdapterId = containerInfo.properties.getProperty("ResourceAdapter"); if (resourceAdapterId != null) { final String newResourceId = getResourceId(ejbDeployment.getDeploymentId(), resourceAdapterId, null, null); if (resourceAdapterId.equals(newResourceId)) { containerInfo.properties.setProperty("ResourceAdapter", newResourceId); } } // install the container configFactory.install(containerInfo); return containerInfo.id; }
private String createContainer(final Class<? extends ContainerInfo> containerInfoType, final EjbDeployment ejbDeployment, final EnterpriseBean bean) throws OpenEJBException { if (!autoCreateContainers) { throw new OpenEJBException("A container of type " + getType(bean) + " must be declared in the configuration file for bean: " + bean.getEjbName()); } // get the container info (data used to build the container) final ContainerInfo containerInfo = configFactory.configureService(containerInfoType); logger.info("Auto-creating a container for bean " + ejbDeployment.getDeploymentId() + ": Container(type=" + getType(bean) + ", id=" + containerInfo.id + ")"); // if the is an MDB container we need to resolve the resource adapter final String resourceAdapterId = containerInfo.properties.getProperty("ResourceAdapter"); if (resourceAdapterId != null) { final String newResourceId = getResourceId(ejbDeployment.getDeploymentId(), resourceAdapterId, null, null); if (resourceAdapterId.equals(newResourceId)) { containerInfo.properties.setProperty("ResourceAdapter", newResourceId); } } // install the container configFactory.install(containerInfo); return containerInfo.id; }
private String createContainer(Class<? extends ContainerInfo> containerInfoType, EjbDeployment ejbDeployment, EnterpriseBean bean) throws OpenEJBException { if (!autoCreateContainers) { throw new OpenEJBException("A container of type " + getType(bean) + " must be declared in the configuration file for bean: " + bean.getEjbName()); } // get the container info (data used to build the container) ContainerInfo containerInfo = configFactory.configureService(containerInfoType); logger.info("Auto-creating a container for bean " + ejbDeployment.getDeploymentId() + ": Container(type=" + getType(bean) + ", id=" + containerInfo.id + ")"); // if the is an MDB container we need to resolve the resource adapter String resourceAdapterId = containerInfo.properties.getProperty("ResourceAdapter"); if (resourceAdapterId != null) { String newResourceId = getResourceId(ejbDeployment.getDeploymentId(), resourceAdapterId, null, null); if (resourceAdapterId != newResourceId) { containerInfo.properties.setProperty("ResourceAdapter", newResourceId); } } // install the container configFactory.install(containerInfo); return containerInfo.id; }