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());
        
         BundleContext sysContext = frameworkInst.get().getBundleContext();
         Bundle bundle = sysContext.installBundle(archive.getName(), inputStream);
View Full Code Here

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

      ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
      try
      {
         // Read the archive in the context of the arquillian-osgi-bundle
         Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
         ZipExporter exporter = archive.as(ZipExporter.class);
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         exporter.exportZip(baos);

         inputStream = new ByteArrayInputStream(baos.toByteArray());
      }
      finally
      {
View Full Code Here

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

   }

   public byte[] getTestArchive(String name)
   {
      JavaArchive archive = delegate.getTestArchive(name);
      ZipExporter exporter = archive.as(ZipExporter.class);
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      exporter.exportZip(baos);
      return baos.toByteArray();
   }
View Full Code Here

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);

            BundleContext context = bundleContextInst.get();
            ByteArrayInputStream inputStream = new ByteArrayInputStream(baos.toByteArray());
            Bundle bundle = context.installBundle(archive.getName(), 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);

            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());
            syscontext.installBundle(archive.getName(), inputStream);

        } catch (RuntimeException rte) {
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

      }
   }

   private void validateBundleArchive(Archive<?> archive) throws Exception
   {
      ZipExporter exporter = archive.as(ZipExporter.class);
      InputStream inputStream = exporter.exportAsInputStream();
      VirtualFile virtualFile = AbstractVFS.toVirtualFile(inputStream);
      BundleInfo.createBundleInfo(virtualFile);
   }
View Full Code Here

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

   }

   private Bundle installBundle(BundleContext context, Archive<?> archive) throws BundleException
   {
      // Export the bundle bytes
      ZipExporter exporter = archive.as(ZipExporter.class);
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      exporter.exportZip(baos);

      InputStream inputStream = new ByteArrayInputStream(baos.toByteArray());
      return context.installBundle(archive.getName(), inputStream);
   }
View Full Code Here

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

      ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
      try
      {
         // Read the archive in the context of the arquillian-osgi-bundle
         Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
         ZipExporter exporter = archive.as(ZipExporter.class);
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         exporter.exportZip(baos);

         inputStream = new ByteArrayInputStream(baos.toByteArray());
      }
      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.