public Archivist getArchivist(ArchiveType moduleType) { return getArchivist(String.valueOf(moduleType)); }
public static void setExtensionArchivistForSubArchivist(ServiceLocator habitat, ReadableArchive archive, ModuleDescriptor md, Application app, Archivist subArchivist) { try { Collection<Sniffer> sniffers = getSniffersForModule(habitat, archive, md, app); ArchivistFactory archivistFactory = habitat.getService(ArchivistFactory.class); subArchivist.setExtensionArchivists(archivistFactory.getExtensionsArchivists(sniffers, subArchivist.getModuleType())); } catch (Exception e) { deplLogger.log(Level.WARNING, EXCEPTION_CAUGHT, new Object[] { e.getMessage(), e }); } }
/** * Only archivists should have access to this API. we'll see how it works, * @param moduleType * @return * @throws IOException */ Archivist getPrivateArchivistFor(XModuleType moduleType) throws IOException { for (Archivist pa : archivists) { Archivist a = Archivist.class.cast(pa); if (a.getModuleType().equals(moduleType)) { return copyOf(a); } } return null; }
Archivist archivist = archivistFactory.getArchivist(archiveType, cl); if (archivist == null) { archivist.setExtensionArchivists(archivistFactory.getExtensionsArchivists(sniffers, archivist.getModuleType()));
public Archivist getArchivist(XModuleType moduleType) throws IOException { return getPrivateArchivistFor(moduleType); }
/** * Only archivists should have access to this API. we'll see how it works, * @param archive * @return * @throws IOException */ Archivist getPrivateArchivistFor(ReadableArchive archive) throws IOException { // do CompositeArchivist first Archivist a = getPrivateArchivistFor(archive, compositeArchivists); if (a == null) { a = getPrivateArchivistFor(archive, archivists); } return a; }
public Archivist getArchivist(String archiveType, ClassLoader cl) { Archivist result = getArchivist(archiveType); if(result != null) { result.setClassLoader(cl); } return result; }
public Archivist getArchivist(ReadableArchive archive, ClassLoader cl) throws IOException { Archivist archivist = getPrivateArchivistFor(archive); if (archivist!=null) { archivist.setClassLoader(cl); } return archivist; }
if (a.hasStandardDeploymentDescriptor(archive) || a.hasRuntimeDeploymentDescriptor(archive)) { return copyOf(a); Archivist a = Archivist.class.cast(pa); if (uri.endsWith(a.getArchiveExtension())) { return copyOf(a); Archivist a = Archivist.class.cast(pa); if (a.postHandles(archive)) { return copyOf(a);
/** * Open a jar file with the default Archivists and return an application * object for the modules contained in the archive. * If the archive is a standalone module, this API will * create an empty application and add the standalone module to it * * @param jarFile the archive file * @param handleRuntimeInfo set to true to read configuration deployment descriptors * @return the application object */ public Application openArchive(URI jarFile, String archiveType, boolean handleRuntimeInfo) throws IOException, SAXException { Archivist archivist = archivistFactory.getArchivist(archiveType); return openArchive(archivist, jarFile, handleRuntimeInfo); }
/** * Open a jar file with the default Archivists and return an application * object for the modules contained in the archive. * If the archive is a standalone module, this API will * create an empty application and add the standalone module to it * * @param jarFile the archive file * @param handleRuntimeInfo set to true to read configuration deployment descriptors * @return the application object */ public Application openArchive(URI jarFile, boolean handleRuntimeInfo) throws IOException, SAXParseException { ReadableArchive in = archiveFactory.openArchive(jarFile); Archivist archivist = archivistFactory.getPrivateArchivistFor(in); return openArchive(archivist, jarFile, handleRuntimeInfo); }
public ConnectorArchivist getConnectorArchvist() throws ConnectorRuntimeException { try{ ArchivistFactory archivistFactory = habitat.getComponent(ArchivistFactory.class); return (ConnectorArchivist)archivistFactory.getArchivist(XModuleType.RAR); }catch(IOException ioe){ _logger.log(Level.WARNING, "unable to get Connector Archivist : ", ioe); ConnectorRuntimeException cre = new ConnectorRuntimeException(ioe.getMessage()); cre.setStackTrace(ioe.getStackTrace()); throw cre; } }
ReadableArchive subSource = source.getSubArchive(aModule.getArchiveUri()); WritableArchive subTarget = target.createSubArchive(aModule.getArchiveUri()); Archivist newArchivist = archivistFactory.get().getPrivateArchivistFor(aModule.getModuleType()); newArchivist.copyInto(subSource, subTarget, overwriteManifest); target.closeEntry(subTarget);
/** * writes a bundle descriptor * @param the bundle descriptor * @param the abstract archive */ public void write(BundleDescriptor bundle, ReadableArchive in, WritableArchive out) throws IOException { Archivist archivist = archivistFactory.getArchivist(in, bundle.getClassLoader()); write(bundle, archivist, in, out); }
Archivist subArchivist = archivistFactory.get().getPrivateArchivistFor(moduleDesc.getModuleType()); String archiveUri = moduleDesc.getArchiveUri(); String runtimeDDPath = subArchivist.getRuntimeDeploymentDescriptorPath();
try final Archivist moduleArchivist = archivistFactory.getArchivist(bundleDesc.getModuleDescriptor().getModuleType()); final DeploymentDescriptorFile ddFile = moduleArchivist.getStandardDDFile();
/** * Perform Optional packages dependencies checking on an archive */ @Override public boolean performOptionalPkgDependenciesCheck(ReadableArchive archive) throws IOException { if (!super.performOptionalPkgDependenciesCheck(archive)) return false; // now check sub modules if (descriptor==null) { throw new IOException("Application object not set on archivist"); } boolean returnValue = true; for (ModuleDescriptor md : descriptor.getModules()) { ReadableArchive sub = archive.getSubArchive(md.getArchiveUri()); if (sub!=null) { Archivist subArchivist = archivistFactory.get().getPrivateArchivistFor(md.getModuleType()); if (!subArchivist.performOptionalPkgDependenciesCheck(sub)) returnValue = false; } } return returnValue; }
/** * Perform Optional packages dependencies checking on an archive */ @Override public boolean performOptionalPkgDependenciesCheck(ReadableArchive archive) throws IOException { if (!super.performOptionalPkgDependenciesCheck(archive)) return false; // now check sub modules if (descriptor==null) { throw new IOException("Application object not set on archivist"); } boolean returnValue = true; for (ModuleDescriptor md : descriptor.getModules()) { ReadableArchive sub = archive.getSubArchive(md.getArchiveUri()); if (sub!=null) { Archivist subArchivist = archivistFactory.get().getArchivist(md.getModuleType()); if (!subArchivist.performOptionalPkgDependenciesCheck(sub)) returnValue = false; } } return returnValue; }
Archivist subArchivist = archivistFactory.get().getPrivateArchivistFor(aModule.getModuleType()); subArchivist.initializeContext(this); subArchivist.setModuleDescriptor(aModule);
ReadableArchive subSource = source.getSubArchive(aModule.getArchiveUri()); WritableArchive subTarget = target.createSubArchive(aModule.getArchiveUri()); Archivist newArchivist = archivistFactory.get().getArchivist(aModule.getModuleType()); ReadableArchive subArchive = archiveFactory.openArchive(subTarget.getURI()); subSource.setParentArchive(subArchive);