/** * On start, register the service */ public void start(BundleContext bundleContext) throws Exception { ArchiveManager archiveManager = ArchiveManager.getInstance(); serviceRegistration = bundleContext.registerService(IArchiveManager.class, archiveManager, null); }
/** * Gets the unique instance of this class. * @return the unique instance. */ public static ArchiveManager getInstance() { if (archiveManager == null) { archiveManager = new ArchiveManager(); } return archiveManager; }
/** * Private constructor as only one instance is built. */ private ArchiveManager() { addFactory(new DefaultArchiveFactory()); addFactory(new URLArchiveFactory()); }
/** * Extract all the metadatas from the application client. * @param clientFileName the client * @param classLoader the classloader used for the client * @return the metadata structure associated to this client * @throws ClientContainerDeploymentDescException if an error occured during annotation/XML parsing */ public static ICarDeployableMetadata getCarMetadata(final String clientFileName, final ClassLoader classLoader) throws ClientContainerDeploymentDescException { // Analyze metadata of the client File clientFile = new File(clientFileName); // First, get an archive IArchive archive = ArchiveManager.getInstance().getArchive(clientFile); ICarDeployableMetadata carDeployableMetadata; CARDeployable carDeployable; try { // Workaround for http://bugs.sun.com/view_bug.do?bug_id=6548436 carDeployable = CARDeployable.class.cast(DeployableHelper.getDeployable(archive)); // check if client is uncompressed if (!clientFile.isDirectory()) { carDeployable = UnpackDeployableHelper.unpack(carDeployable); logger.log(BasicLevel.DEBUG, "Unpack an application-client to create metadata"); } carDeployableMetadata = new CarDeployableMetadataFactory().createDeployableMetadata(carDeployable, classLoader); } catch (Exception e) { throw new ClientContainerDeploymentDescException(e); } return carDeployableMetadata; }
final EarUnpackOpts earUnpackOpts, IDeployableHelper deployableHelper) throws DeployerException { IArchive tmpArchive = ArchiveManager.getInstance().getArchive(file);
/** * Extract all the metadatas from the webapp. * @param fWar the webapp * @return the metadata structure associated to this webapp * @throws WebContainerDeploymentDescException if an error occured during annotation/XML parsing */ public static IWarDeployableMetadata getWarMetadata(final File fWar) throws WebContainerDeploymentDescException { // Analyze metadata of the webapp // First, get an archive IArchive webArchive = ArchiveManager.getInstance().getArchive(fWar); IWarDeployableMetadata warDeployableMetadata; WARDeployable warDeployable; try { // Workaround for http://bugs.sun.com/view_bug.do?bug_id=6548436 warDeployable = WARDeployable.class.cast(DeployableHelper.getDeployable(webArchive)); // check if war is uncompressed if (!fWar.isDirectory()) { warDeployable = UnpackDeployableHelper.unpack(warDeployable); logger.log(BasicLevel.DEBUG, "Unpack a war to create metadata"); } warDeployableMetadata = WarDeployableMetadataFactoryHolder.getWarDeployableMetadataFactory() .createDeployableMetadata(warDeployable); } catch (Exception e) { throw new WebContainerDeploymentDescException(e); } return warDeployableMetadata; }
ArchiveManager archiveManager = ArchiveManager.getInstance(); bundleContext.registerService(IArchiveManager.class.getName(), archiveManager, null);
/** * Gets the unique instance of this class. * @return the unique instance. */ public static ArchiveManager getInstance() { if (archiveManager == null) { archiveManager = new ArchiveManager(); } return archiveManager; }
/** * Private constructor as only one instance is built. */ private ArchiveManager() { addFactory(new DefaultArchiveFactory()); addFactory(new URLArchiveFactory()); }
IArchive builtArchive = ArchiveManager.getInstance().getArchive(unpackedFolder); IArchive tmpArchive = ArchiveManager.getInstance().getArchive(entryFile);
ArchiveManager archiveManager = ArchiveManager.getInstance(); bundleContext.registerService(IArchiveManager.class.getName(), archiveManager, null);
if (deployable == null) { IArchive fileArchive = ArchiveManager.getInstance().getArchive(file); localDeployable = DeployableHelper.getDeployable(fileArchive); } else {
IArchive archive = ArchiveManager.getInstance().getArchive(file); if (archive == null) { throw new FragmentDeploymentException("Null archive for file " + file);