Package org.jboss.shrinkwrap.descriptor.api.application6

Examples of org.jboss.shrinkwrap.descriptor.api.application6.ApplicationDescriptor


        final Node appXml = ear.get(ParseUtils.APPLICATION_XML);
        if (appXml != null) {
            InputStream stream = appXml.getAsset().openStream();
            try {
                ApplicationDescriptor ad = Descriptors.importAs(ApplicationDescriptor.class).fromStream(stream);

                List<JavaArchive> libs = new ArrayList<JavaArchive>();
                String libDir = ad.getLibraryDirectory();
                if (libDir != null) {
                    libDir = "lib"; // default?
                }
                Node lib = ear.get(libDir);
                if (lib != null) {
                    // defensive copy
                    final Set<Node> children = new HashSet<Node>(lib.getChildren());
                    for (Node child : children) {
                        if (child.getPath().get().endsWith(".jar")) {
                            JavaArchive jar = ear.getAsType(JavaArchive.class, child.getPath());
                            libs.add(jar);
                        }
                    }
                }

                List<ModuleType<ApplicationDescriptor>> allModules = ad.getAllModule();
                for (ModuleType<ApplicationDescriptor> mt : allModules) {
                    String uri = mt.getOrCreateWeb().getWebUri();
                    if (uri != null) {
                        WebArchive war = ear.getAsType(WebArchive.class, uri);
                        handleWar(root, libs, war, uri);
View Full Code Here


        final Node appXml = ear.get(ParseUtils.APPLICATION_XML);
        if (appXml != null) {
            InputStream stream = appXml.getAsset().openStream();
            try {
                ApplicationDescriptor ad = Descriptors.importAs(ApplicationDescriptor.class).fromStream(stream);

                List<JavaArchive> libs = new ArrayList<JavaArchive>();
                String libDir = ad.getLibraryDirectory();
                if (libDir != null) {
                    libDir = "lib"; // default?
                }
                Node lib = ear.get(libDir);
                if (lib != null) {
                    // defensive copy
                    final Set<Node> children = new HashSet<Node>(lib.getChildren());
                    for (Node child : children) {
                        if (child.getPath().get().endsWith(".jar")) {
                            JavaArchive jar = ear.getAsType(JavaArchive.class, child.getPath());
                            libs.add(jar);
                        }
                    }
                }

                List<ModuleType<ApplicationDescriptor>> allModules = ad.getAllModule();
                for (ModuleType<ApplicationDescriptor> mt : allModules) {
                    String uri = mt.getOrCreateWeb().getWebUri();
                    if (uri != null) {
                        WebArchive war = ear.getAsType(WebArchive.class, uri);
                        handleWar(root, libs, war, uri);
View Full Code Here

            final EnterpriseArchive ear = (EnterpriseArchive) archive;
            final Node appXml = archive.get(ParseUtils.APPLICATION_XML);
            if (appXml != null) {
                InputStream stream = appXml.getAsset().openStream();
                try {
                    ApplicationDescriptor ad = Descriptors.importAs(ApplicationDescriptor.class).fromStream(stream);
                    List<ModuleType<ApplicationDescriptor>> allModules = ad.getAllModule();
                    for (ModuleType<ApplicationDescriptor> mt : allModules) {
                        String uri = mt.getOrCreateWeb().getWebUri();
                        if (uri != null) {
                            WebArchive war = ear.getAsType(WebArchive.class, uri);
                            handleWar(host, port, war, list);
View Full Code Here

        String contextRoot = null;
        InputStream is = null;
        try {
            is = node.getAsset().openStream();
            ApplicationDescriptor descriptor = Descriptors.importAs(ApplicationDescriptor.class).fromStream(is);
            List<ModuleType<ApplicationDescriptor>> modules = descriptor.getAllModule();
            // get all modules and find a web module which defines contextRoot for given WAR
            for (ModuleType<ApplicationDescriptor> module : modules) {
                WebType<ModuleType<ApplicationDescriptor>> webModule = module.getOrCreateWeb();
                if (deploymentName.equals(webModule.getWebUri())) {
                    contextRoot = removeFirstSlash(webModule.getContextRoot());
View Full Code Here

TOP

Related Classes of org.jboss.shrinkwrap.descriptor.api.application6.ApplicationDescriptor

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.