public Translator[] getChildren(Object o, int versionID) { if (o == null) return CommonTranslators.EMPTY_CHILDREN; else if (((Module) o).isEjbModule()) return EJB_TRANSLATORS; else if (((Module) o).isConnectorModule()) return CONNECTOR_TRANSLATORS; else if (((Module) o).isWebModule()) return WEB_TRANSLATORS; else if (((Module) o).isJavaModule()) return JAVA_TRANSLATORS; else throw new IllegalStateException("Internal error: Module Type excepted"); //$NON-NLS-1$ }
binaryModule = ejbEdit.getEJBJar(); } else if (module.isConnectorModule()) { ConnectorArtifactEdit connectorEdit = ConnectorArtifactEdit.getConnectorArtifactEditForRead(component); if (connectorEdit != null) {
/** * An alt-dd is about to be loaded; register the appropriate resource factory for the uri so it * will get loaded correctly. */ protected void registerResourceFactory(Module aModule, String aUri) { org.eclipse.emf.ecore.resource.Resource.Factory factory = null; if (aModule.isEjbModule()) factory = EJBJarResourceFactory.getRegisteredFactory(); else if (aModule.isWebModule()) factory = WebAppResourceFactory.getRegisteredFactory(); else if (aModule.isJavaModule()) factory = ApplicationClientResourceFactory.getRegisteredFactory(); else if (aModule.isConnectorModule()) factory = ConnectorResourceFactory.getRegisteredFactory(); if (factory != null) { ResourceSet set = getResourceSet(); ((FileNameResourceFactoryRegistry) set.getResourceFactoryRegistry()).registerLastFileSegment(aUri, factory); } }
protected ModuleRef createModuleRef(Module aModule, ModuleFile aFile) { ModuleRef newRef = null; if (aModule.isEjbModule()) newRef = getCommonArchiveFactory().createEJBModuleRef(); else if (aModule.isWebModule()) newRef = getCommonArchiveFactory().createWebModuleRef(); else if (aModule.isConnectorModule()) newRef = getCommonArchiveFactory().createConnectorModuleRef(); else if (aModule.isJavaModule()) newRef = getCommonArchiveFactory().createClientModuleRef(); newRef.setModule(aModule); newRef.setModuleFile(aFile); return newRef; }
moduleVersion = webApp.getVersion(); else if (j2eeModule.isConnectorModule()) { moduleEdit = ComponentUtilities.getArtifactEditForRead(moduleComponent, J2EEProjectUtilities.JCA); Connector connector = (Connector) moduleEdit.getContentModelRoot();
protected Archive openNestedArchive(Module m, ArchiveOptions archiveOptions) throws OpenFailureException { String aUri = m.getUri(); try { /* * Since we have a clue about the type of archive to open Use the appropriate open * method, so if a failure occurrs, we can get a more specific message */ if (m.isWebModule()) return getCommonArchiveFactory().openWARFile(archiveOptions, aUri); else if (m.isEjbModule()) return getCommonArchiveFactory().openEJBJarFile(archiveOptions, aUri); else if (m.isJavaModule()) return getCommonArchiveFactory().openApplicationClientFile(archiveOptions, aUri); else if (m.isConnectorModule()) return getCommonArchiveFactory().openRARFile(archiveOptions, aUri); } catch (OpenFailureException ex) { throw new OpenFailureException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.nested_open_fail_EXC_, (new Object[]{aUri, getURI()})), ex); // = "Unable to open module file "{0}" in EAR file "{1}"" } //Should never reach the code below return null; }
moduleVersion = webApp.getVersion(); else if (j2eeModule.isConnectorModule()) { moduleEdit = ComponentUtilities.getArtifactEditForRead(moduleComponent, J2EEProjectUtilities.JCA); Connector connector = (Connector) moduleEdit.getContentModelRoot();
protected void checkType(Module moduleDescriptor, File aFile) { if (aFile == null) { String message = CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.A_file_does_not_exist_for_module, new Object[]{moduleDescriptor.getUri()}); throw new NoModuleFileException(message); } //Added for defect 113929 boolean isValid = true; String type = CommonArchiveResourceHandler.Module_file; if (moduleDescriptor.isWebModule() && !aFile.isWARFile()) { isValid = false; type = CommonArchiveResourceHandler.A_WAR_file; } else if (moduleDescriptor.isEjbModule() && !aFile.isEJBJarFile()) { isValid = false; type = CommonArchiveResourceHandler.An_EJB_JAR_file; } else if (moduleDescriptor.isJavaModule() && !aFile.isApplicationClientFile()) { isValid = false; type = CommonArchiveResourceHandler.An_Application_Client_JAR_file; } else if (moduleDescriptor.isConnectorModule() && !aFile.isRARFile()) { isValid = false; type = CommonArchiveResourceHandler.A_RAR_file; } else if (!aFile.isModuleFile()) isValid = false; if (isValid) return; String earUri = ""; //$NON-NLS-1$ if (getEarFile() != null) earUri = getEarFile().getURI(); String message = CommonArchiveResourceHandler.getString("File_not_correct_type", new Object[]{aFile.getURI(), earUri, type}); //$NON-NLS-1$ throw new ArchiveRuntimeException(message); }