Package org.jboss.shrinkwrap.api.asset

Examples of org.jboss.shrinkwrap.api.asset.ArchiveAsset


            {
                FileAsset fileAsset = (FileAsset) asset;
                if (fileAsset.getSource().getName().endsWith(".jar"))
                {
                    Archive<?> fileArchive = ShrinkWrap.createFromZipFile(JavaArchive.class, fileAsset.getSource());
                    asset = new ArchiveAsset(fileArchive, ZipExporter.class);
                }
            }
            if (asset instanceof ArchiveAsset)
            {
                ArchiveAsset archiveAsset = (ArchiveAsset) asset;
                JavaArchive jarArchive = (JavaArchive) archiveAsset.getArchive();
                scanJarArchive(jarArchive);
            }
        }

    }
View Full Code Here


    public static Archive<?> createDeployment() {
        final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "subdirectory.ear");

        final JavaArchive jarOne = ShrinkWrap.create(JavaArchive.class, "ejb.jar");
        jarOne.addClass(MessageBean.class);
        ear.addAsModule(new ArchiveAsset(jarOne, ZipExporter.class), "subdir/ejb/ejb.jar");

        final WebArchive war = ShrinkWrap.create(WebArchive.class, "web.war");
        war.addClass(MessageServlet.class);
        ear.addAsModule(new ArchiveAsset(war, ZipExporter.class), "subdir/web/web.war");

        logger.info(ear.toString(true));
        return ear;
    }
View Full Code Here

                        + "Agent-Class: org.jboss.byteman.agent.Main\n"
                        + "Can-Redefine-Classes: true\n"
                        + "Can-Retransform-Classes: true\n"));

            // add byteman archive as a resource in the jar, needed to install
            jar.add(new ArchiveAsset(agentJar, ZipExporter.class), BytemanConfiguration.BYTEMAN_JAR);
        }
        return jar;
    }
View Full Code Here

        // and now scan all the jars in the WAR
        Map<ArchivePath, Node> jars = archive.getContent(Filters.include("/WEB-INF/lib/.*\\.jar"));
        for (Map.Entry<ArchivePath, Node> jarEntry : jars.entrySet())
        {
            ArchiveAsset archiveAsset = (ArchiveAsset) jarEntry.getValue().getAsset();
            JavaArchive jarArchive = (JavaArchive) archiveAsset.getArchive();
            scanJarArchive(jarArchive);
        }

    }
View Full Code Here

        final ArchivePath path = node.getPath();
        processNode(relativePath, path, node, isDirectory || explodeWar);

        if (explodeWar) {
            ArchiveAsset war = (ArchiveAsset) node.getAsset();
            processArchive(relativePath + path.get(), war.getArchive());
        } else {
            Set<Node> children = node.getChildren();
            for (Node child : children) {
                processNode(relativePath, child);
            }
View Full Code Here

      final Collection<Node> nodes = new LinkedList<Node>(getPersistenceDescriptors(archive));
      for (Node node : collectSubArchives(archive))
      {
         if (node.getAsset() instanceof ArchiveAsset)
         {
            final ArchiveAsset archiveAsset = (ArchiveAsset) node.getAsset();
            nodes.addAll(collectPersistenceXml(archiveAsset.getArchive()));
         }
      }
      return nodes;
   }
View Full Code Here

      final Collection<Node> nodes = new LinkedList<Node>(getWebAppDescriptors(archive));
      for (Node node : collectSubArchives(archive))
      {
         if (node.getAsset() instanceof ArchiveAsset)
         {
            final ArchiveAsset archiveAsset = (ArchiveAsset) node.getAsset();
            nodes.addAll(collectWebXml(archiveAsset.getArchive()));
         }
      }
      return nodes;
   }
View Full Code Here

      {
         if( !(nestedArchiveEntry.getValue().getAsset() instanceof ArchiveAsset))
         {
            continue;
         }
         ArchiveAsset nestedArchive = (ArchiveAsset)nestedArchiveEntry.getValue().getAsset();
         Map<ArchivePath, Node> classes = nestedArchive.getArchive().getContent(Filters.include(".*/beans.xml"));
         for(final Map.Entry<ArchivePath, Node> entry : classes.entrySet())
         {
            try
            {
               beansXmls.add(
                     new URL(null, "archive://" + nestedArchive.getArchive().getName() +  entry.getKey().get(), new URLStreamHandler()
                     {
                        @Override
                        protected java.net.URLConnection openConnection(URL u) throws java.io.IOException
                        {
                           return new URLConnection(u)
View Full Code Here

         {
            if( !(nestedArchiveEntry.getValue().getAsset() instanceof ArchiveAsset))
            {
               continue;
            }
            ArchiveAsset nestedArchive = (ArchiveAsset)nestedArchiveEntry.getValue().getAsset();
            Map<ArchivePath, Node> markerFiles = nestedArchive.getArchive().getContent(Filters.include(".*/beans.xml"));
            if (markerFiles.isEmpty()) {
               continue;
            }

            Map<ArchivePath, Node> classes = nestedArchive.getArchive().getContent(Filters.include(".*\\.class"));
            for(Map.Entry<ArchivePath, Node> classEntry : classes.entrySet())
            {
               Class<?> loadedClass = classLoader.loadClass(
                     findClassName(classEntry.getKey()));

View Full Code Here

      final Collection<Node> nodes = new LinkedList<Node>(getPersistenceDescriptors(archive));
      for (Node node : collectSubArchives(archive))
      {
         if (node.getAsset() instanceof ArchiveAsset)
         {
            final ArchiveAsset archiveAsset = (ArchiveAsset) node.getAsset();
            nodes.addAll(collectPersistenceXml(archiveAsset.getArchive()));
         }
      }
      return nodes;
   }
View Full Code Here

TOP

Related Classes of org.jboss.shrinkwrap.api.asset.ArchiveAsset

Copyright © 2018 www.massapicom. 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.