public void initAppModule(final AppModule appModule) { if (this.appModule == appModule) { return; } if (this.appModule != null) { throw new UnsupportedOperationException("AppModule is already set"); } this.appModule = appModule; if (resources != null) { this.appModule.getResources().addAll(resources.getResource()); this.appModule.getContainers().addAll(resources.getContainer()); this.appModule.getServices().addAll(resources.getService()); } }
@Override public void initResources(final Resources resources) { appModule.getContainers().addAll(resources.getContainer()); appModule.getResources().addAll(resources.getResource()); appModule.getServices().addAll(resources.getService()); } });
public static List<ContainerInfo> getContainerInfos(final AppModule module, final ConfigurationFactory configFactory) throws OpenEJBException { final List<ContainerInfo> containerInfos = new ArrayList<ContainerInfo>(); 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; } }
private MdbContainerDetails findModuleContainer(final AppModule appModule, final ConfigurationFactory configurationFactory, final String containerId) { // try the containers on the AppModule final Collection<org.apache.openejb.config.sys.Container> containers = appModule.getContainers(); for (final org.apache.openejb.config.sys.Container appMopduleContainer : containers) { if (appMopduleContainer.getId().equals(containerId) || appMopduleContainer.getId().equals(appModule.getModuleId() + "/" + containerId)) { try { final ContainerInfo containerInfo = configurationFactory.createContainerInfo(appMopduleContainer); if (containerInfo != null && MdbContainerInfo.class.isInstance(containerInfo)) { return convert(MdbContainerInfo.class.cast(containerInfo)); } } catch (OpenEJBException e) { e.printStackTrace(); } } } return null; }
final Resources asResources = Resources.class.cast(obj); appModule.getResources().addAll(asResources.getResource()); appModule.getContainers().addAll(asResources.getContainer()); notBusinessModuleNumber++; } else if (obj instanceof AppModule) {