protected Archive openArchive(String uri) throws OpenFailureException { Archive archive = CommonarchiveFactory.eINSTANCE.openEJBJarFile(getArchiveOptions(), uri); return archive; }
public void createModuleFile() throws SaveFailureException { try { CommonarchiveFactory caf = ((CommonarchivePackage) EPackage.Registry.INSTANCE.getEPackage(CommonarchivePackage.eNS_URI)).getCommonarchiveFactory(); EJBComponentLoadStrategyImpl ls = new EJBComponentLoadStrategyImpl(getComponent()); ls.setExportSource(isExportSource()); setModuleFile(caf.openEJBJarFile(ls, getDestinationPath().toOSString())); } catch (Exception e) { throw new SaveFailureException(EJBArchiveOpsResourceHandler.ARCHIVE_OPERATION_OpeningArchive, e); } }
public Archive asArchive(boolean includeSource, boolean includeClasspathComponents) throws OpenFailureException { if (isBinary()) { return ((EnterpriseBinaryComponentHelper) getBinaryComponentHelper()).accessArchive(); } else { EJBComponentLoadStrategyImpl loader = new EJBComponentLoadStrategyImpl(getComponent(), includeClasspathComponents); loader.setExportSource(includeSource); String uri = ModuleURIUtil.getHandleString(getComponent()); return CommonarchiveFactory.eINSTANCE.openEJBJarFile(loader, uri); } }
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; }