Package org.jboss.shrinkwrap.api.exporter

Examples of org.jboss.shrinkwrap.api.exporter.ZipExporter.exportTo()


    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


      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

    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

    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

    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

    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

    private JarFile toJarFile(JavaArchive archive) throws IOException {
        ZipExporter exporter = archive.as(ZipExporter.class);
        File targetFile = new File("target/shrinkwrap/" + archive.getName());
        targetFile.getParentFile().mkdirs();
        exporter.exportTo(targetFile, true);
        return new JarFile(targetFile);
    }

    private JavaArchive getModuleB() {
        JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "moduleB");
View Full Code Here

        if (targetFile.exists()) {
            Assert.assertTrue(targetFile.delete());
        }

        ZipExporter exporter = module.as(ZipExporter.class);
        exporter.exportTo(targetFile, true);

        return targetDir;
    }

    protected void testArchive(Archive module, Archive... libs) throws Throwable {
View Full Code Here

    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

    JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "foo.jar");
    jar.addClass(FSTestCase.class);
    WebArchive war = ShrinkWrap.create(WebArchive.class);
    war.addAsLibraries(jar);
    ZipExporter exporter = war.as(ZipExporter.class);
    exporter.exportTo(warFile, true);
    this.warFile = warFile;
  }

  public void testFoo() throws Exception {
    FS fs = new FS().mount(FSTestCase.class);
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.