public Archivist getArchivist(ArchiveType moduleType) { return getArchivist(String.valueOf(moduleType)); }
public Archivist getArchivist(String archiveType, ClassLoader cl) { Archivist result = getArchivist(archiveType); if(result != null) { result.setClassLoader(cl); } return result; }
/** * 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); }
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; } }
/** * 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); }
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().getArchivist(md.getModuleType()); if (!subArchivist.performOptionalPkgDependenciesCheck(sub)) returnValue = false; } } return returnValue; }
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);
Archivist subArchivist = archivistFactory.get().getArchivist(aModule.getModuleType()); subArchivist.initializeContext(this); subArchivist.setModuleDescriptor(aModule);
/** * writes an application deployment descriptors * @param the application object * @param the abstract archive */ public void write(Application application, ReadableArchive in, WritableArchive out) throws IOException { if (application.isVirtual()) { ModuleDescriptor aModule = (ModuleDescriptor) application.getModules().iterator().next(); Archivist moduleArchivist = archivistFactory.getArchivist(aModule.getModuleType()); write((BundleDescriptor)aModule.getDescriptor(), moduleArchivist, in, out); } else { // this is a real application. // let's start by writing out all submodules deployment descriptors for (ModuleDescriptor aModule : application.getModules()) { Archivist moduleArchivist = archivistFactory.getArchivist(aModule.getModuleType()); WritableArchive moduleArchive = out.createSubArchive(aModule.getArchiveUri()); ReadableArchive moduleArchive2 = in.getSubArchive(aModule.getArchiveUri()); write((BundleDescriptor)aModule.getDescriptor(), moduleArchivist, moduleArchive2, moduleArchive); } // now let's write the application descriptor ApplicationArchivist archivist = archivistProvider.get(); archivist.setDescriptor(application); archivist.writeDeploymentDescriptors(in, out); } }
/** * This method creates an Application object from reading the * standard deployment descriptor. * @param archive the archive for the application */ public Application createApplicationFromStandardDD( ReadableArchive archive) throws IOException, SAXParseException { Archivist archivist = archivistFactory.getArchivist(archive, null); String xmlValidationLevel = dasConfig.getDeployXmlValidation(); archivist.setXMLValidationLevel(xmlValidationLevel); if (xmlValidationLevel.equals("none")) { archivist.setXMLValidation(false); } RootDeploymentDescriptor desc = archivist.readStandardDeploymentDescriptor(archive); Application application = null; if (desc instanceof Application) { application = (Application)desc; } else if (desc instanceof BundleDescriptor) { BundleDescriptor aBundle = (BundleDescriptor)desc; ModuleDescriptor newModule = archivist.createModuleDescriptor(aBundle); newModule.setArchiveUri(archive.getURI().getSchemeSpecificPart()); String moduleName = newModule.getModuleName(); application = Application.createApplication(habitat, moduleName, newModule); } return application; }
/** * This method creates an Application object from reading the * standard deployment descriptor. * @param archive the archive for the application */ public Application createApplicationFromStandardDD( ReadableArchive archive, String archiveType) throws IOException, SAXException { Archivist archivist = archivistFactory.getArchivist(archiveType, null); String xmlValidationLevel = dasConfig.getDeployXmlValidation(); archivist.setXMLValidationLevel(xmlValidationLevel); if (xmlValidationLevel.equals("none")) { archivist.setXMLValidation(false); } BundleDescriptor desc = archivist.readStandardDeploymentDescriptor(archive); Application application = null; if (desc instanceof Application) { application = (Application)desc; } else { ModuleDescriptor newModule = archivist.createModuleDescriptor(desc); newModule.setArchiveUri(archive.getURI().getSchemeSpecificPart()); String moduleName = newModule.getModuleName(); application = Application.createVirtualApplication(moduleName, newModule); } return application; }
Archivist ejbArchivist = archivistFactory.get().getArchivist( DOLUtils.ejbType()); if (ejbArchivist.hasStandardDeploymentDescriptor(subArchive)
for (EjbBundleDescriptor ejbBundle : ejbExtensions) { Archivist ejbArchivist = archivistFactory.getArchivist(XModuleType.EJB); write(ejbBundle, ejbArchivist, in, out);
Archivist archivist = archivistFactory.getArchivist(archiveType, cl); if (archivist == null) {
Archivist archivist = archivistFactory.get().getArchivist(md.getModuleType()); archivist.initializeContext(this); archivist.setRuntimeXMLValidation(
Archivist newArchivist = archivistFactory.get().getArchivist(aModule.getModuleType()); newArchivist.initializeContext(this); newArchivist.setRuntimeXMLValidation(this.getRuntimeXMLValidation());
if (application.isVirtual()) { ModuleDescriptor aModule = (ModuleDescriptor) application.getModules().iterator().next(); Archivist moduleArchivist = archivistFactory.getArchivist(aModule.getModuleType()); write((BundleDescriptor)aModule.getDescriptor(), moduleArchivist, in, out); } else { Archivist moduleArchivist = archivistFactory.getArchivist(aModule.getModuleType()); if (aModule.getAlternateDescriptor()!=null) {