• Icon: Task Task
    • Resolution: Done
    • Icon: Major Major
    • 1.0.0.Alpha5
    • None
    • OSGi Containers
    • None

      Currently the OSGiDeploymentPackager transforms a JavaArchive into a VF

      private VirtualFile toVirtualFile(Archive<?> archive) throws IOException, MalformedURLException

      { // [TODO] Can this be done in memory? ZipExporter exporter = archive.as(ZipExporter.class); String archiveName = archive.getName(); int dotIndex = archiveName.lastIndexOf("."); if (dotIndex > 0) archiveName = archiveName.substring(0, dotIndex); File target = File.createTempFile(archiveName + "-", ".jar"); exporter.exportZip(target, true); target.deleteOnExit(); return AbstractVFS.getRoot(target.toURI().toURL()); }

      We should be able to install the Archive directly and in-memory

            [ARQ-192] Install OSGi bundles in memory

            Done

            // Export the bundle bytes
            ZipExporter exporter = archive.as(ZipExporter.class);
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            exporter.exportZip(baos);

            BundleContext sysContext = framework.getBundleContext();
            InputStream inputStream = new ByteArrayInputStream(baos.toByteArray());
            Bundle bundle = sysContext.installBundle(archive.getName(), inputStream);

            Thomas Diesler added a comment - Done // Export the bundle bytes ZipExporter exporter = archive.as(ZipExporter.class); ByteArrayOutputStream baos = new ByteArrayOutputStream(); exporter.exportZip(baos); BundleContext sysContext = framework.getBundleContext(); InputStream inputStream = new ByteArrayInputStream(baos.toByteArray()); Bundle bundle = sysContext.installBundle(archive.getName(), inputStream);

            Pursuant to linked forum discussion, recommend using the ShrinkWrap VFS3 extension and resolving this issue as "Won't Fix"; provided by another level.

            Andrew Rubinger (Inactive) added a comment - Pursuant to linked forum discussion, recommend using the ShrinkWrap VFS3 extension and resolving this issue as "Won't Fix"; provided by another level.

              tdiesler@redhat.com Thomas Diesler
              tdiesler@redhat.com Thomas Diesler
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: