Examples of ZipExporter


Examples of org.jboss.shrinkwrap.api.exporter.ZipExporter

    }

    public ProtocolMetaData deploy(final Archive<?> archive) throws DeploymentException {
        try {
            // Export the bundle bytes
            ZipExporter exporter = archive.as(ZipExporter.class);
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            exporter.exportTo(baos);

            ByteArrayInputStream inputStream = new ByteArrayInputStream(baos.toByteArray());
            Bundle bundle = syscontext.installBundle(archive.getName(), inputStream);

            if (packageAdmin.resolveBundles(new Bundle[] { bundle }) == false)
View Full Code Here

Examples of org.jboss.shrinkwrap.api.exporter.ZipExporter

            // ignore
        }
    }

    private Bundle installBundle(JavaArchive archive) throws BundleException {
        ZipExporter exporter = archive.as(ZipExporter.class);
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        exporter.exportTo(baos);
        ByteArrayInputStream inputStream = new ByteArrayInputStream(baos.toByteArray());
        return syscontext.installBundle(archive.getName(), inputStream);
    }
View Full Code Here

Examples of org.jboss.shrinkwrap.api.exporter.ZipExporter

            // ignore
        }
    }

    private Bundle installBundle(JavaArchive archive) throws BundleException {
        ZipExporter exporter = archive.as(ZipExporter.class);
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        exporter.exportTo(baos);
        ByteArrayInputStream inputStream = new ByteArrayInputStream(baos.toByteArray());
        return syscontext.installBundle(archive.getName(), inputStream);
    }
View Full Code Here

Examples of org.jboss.shrinkwrap.api.exporter.ZipExporter

            }
        }
    }

    private VirtualFile toVirtualFile(Archive<?> archive) throws IOException {
        ZipExporter exporter = archive.as(ZipExporter.class);
        return AbstractVFS.toVirtualFile(archive.getName(), exporter.exportAsInputStream());
    }
View Full Code Here

Examples of org.jboss.shrinkwrap.api.exporter.ZipExporter

    @Override
    public ProtocolMetaData deploy(final Archive<?> archive) throws DeploymentException {
        try {
            // Export the bundle bytes
            ZipExporter exporter = archive.as(ZipExporter.class);
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            exporter.exportTo(baos);

            String location = archive.getName();
            ByteArrayInputStream inputStream = new ByteArrayInputStream(baos.toByteArray());
            log.info("Installing bundle: " + location);
            installBundle(location, inputStream);
View Full Code Here

Examples of org.jboss.shrinkwrap.api.exporter.ZipExporter

    @Override
    public ProtocolMetaData deploy(final Archive<?> archive) throws DeploymentException {
        try {
            // Export the bundle bytes
            ZipExporter exporter = archive.as(ZipExporter.class);
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            exporter.exportTo(baos);

            ByteArrayInputStream inputStream = new ByteArrayInputStream(baos.toByteArray());
            Bundle bundle = syscontext.installBundle(archive.getName(), inputStream);

            FrameworkWiring frameworkWiring = syscontext.getBundle().adapt(FrameworkWiring.class);
View Full Code Here

Examples of org.jboss.shrinkwrap.api.exporter.ZipExporter

            VFSUtils.safeClose(virtualFile);
        }
    }

    private VirtualFile toVirtualFile(Archive<?> archive) throws IOException {
        ZipExporter exporter = archive.as(ZipExporter.class);
        return AbstractVFS.toVirtualFile(archive.getName(), exporter.exportAsInputStream());
    }
View Full Code Here

Examples of org.jboss.shrinkwrap.api.exporter.ZipExporter

    @Override
    public ProtocolMetaData deploy(final Archive<?> archive) throws DeploymentException {
        try {
            // Export the bundle bytes
            ZipExporter exporter = archive.as(ZipExporter.class);
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            exporter.exportTo(baos);

            String location = archive.getName();
            ByteArrayInputStream inputStream = new ByteArrayInputStream(baos.toByteArray());
            log.info("Installing bundle: " + location);
            installBundle(location, inputStream);
View Full Code Here

Examples of org.jboss.shrinkwrap.api.exporter.ZipExporter

         ClassLoader prevCl = Thread.currentThread().getContextClassLoader();
         try
         {
            Thread.currentThread().setContextClassLoader(JavaArchiveImpl.class.getClassLoader());
            Archive<?> archive = (Archive<?>)apMethod.invoke(null, requestedCommand.getArguments()[0]);
            ZipExporter ze = archive.as(ZipExporter.class);
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            ze.exportZip(baos);
            testRunner.commandResult(requestedCommand.getId(), baos.toByteArray());
         }
         catch (RuntimeException rte)
         {
            throw rte;
View Full Code Here

Examples of org.jboss.shrinkwrap.api.exporter.ZipExporter

     
      // [TODO] Can this be done in memory?
      File target = File.createTempFile(archiveName + "-", ".jar");
      try
      {
         ZipExporter exporter = archive.as(ZipExporter.class);
         exporter.exportZip(target, true);
         VirtualFile virtualFile = AbstractVFS.getRoot(target.toURI().toURL());
         BundleInfo.createBundleInfo(virtualFile);
      }
      finally
      {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.