Package com.sun.enterprise.deployment.util

Examples of com.sun.enterprise.deployment.util.ModuleDescriptor


                    Application application = (Application) rootDD.read(null, in);

                    // all web modules in the J2EE application
                    for (Iterator modules = application.getModules();
                            modules.hasNext();) {
                        ModuleDescriptor aModule = (ModuleDescriptor) modules.next();

                        if (!((aModule.getModuleType()).equals(ModuleType.EJB))) {
                            _logger.fine(
                                "Skipping non ejb jar module descriptor: " +
                                aModule.getModuleType());

                            continue;
                        }

                        // alt dd
                        if (aModule.getAlternateDescriptor() != null) {
                            File f = new File(aModule.getAlternateDescriptor());

                            // Get the path of the parent of alt dd file.
                            // add this path to total path, if this is not
                            // null.
                            String parent = f.getParent();

                            if (parent == null) {
                                parent = "";
                            }

                            // path to the sun-xxx.xml file
                            String instanceRoot = System.getProperty(SystemPropertyConstants.INSTANCE_ROOT_PROPERTY);
                            File generated = new File(instanceRoot,
                                    PEFileLayout.GENERATED_DIR);
                            File xml = new File(generated, PEFileLayout.XML_DIR);
                            File j2eeApps = new File(xml,
                                    PEFileLayout.J2EE_APPS_DIR);
                            File generatedAppRoot = new File(j2eeApps,
                                    applicationName);
                            String generatedAppPath = generatedAppRoot.getAbsolutePath();

                            File altWebapp = new File(generatedAppPath,
                                    parent + File.separator + SUN_PREFIX +
                                    f.getName());

                            if (altWebapp.exists()) {
                                _logger.fine("Adding alt-web-app path " +
                                    altWebapp.getAbsolutePath());

                                // adding to the list
                                list.add(altWebapp.getAbsolutePath());
                            } else {
                                _logger.fine("Invalid path: " +
                                    altWebapp.getAbsolutePath());
                            }
                        } else { // no alt dd

                            String aUri = aModule.getArchiveUri();

                            if (aUri != null) {
                                String instanceRoot = System.getProperty(SystemPropertyConstants.INSTANCE_ROOT_PROPERTY);
                                File generated = new File(instanceRoot,
                                        PEFileLayout.GENERATED_DIR);
View Full Code Here


                getParent();
        String puRoot = persistenceUnitDescriptor.getPuRoot();
        if(rootDD.isApplication()){
            return puRoot;
        } else {
            ModuleDescriptor module = BundleDescriptor.class.cast(rootDD).
                    getModuleDescriptor();
            if(module.isStandalone()) {
                return puRoot;
            } else {
                // The module is embedded in an ear (an ejb jar or war)
                final String moduleLocation =        // Would point to the directory where module is expanded. For example myejb_jar
                        DeploymentUtils.getRelativeEmbeddedModulePath(
                        providerContainerContractInfo.getApplicationLocation(), module.getArchiveUri());
                return moduleLocation + '/' + puRoot; // see we always '/'
            }
        }
    }
View Full Code Here

            return libraryURLs;
        }

        File appRoot = new File(parentArchive.getURI());

        ModuleDescriptor moduleDesc = ((BundleDescriptor)bundleDesc).getModuleDescriptor();
        Application app = ((BundleDescriptor)moduleDesc.getDescriptor()).getApplication();

        // add libraries jars inside application lib directory
        libraryURLs.addAll(ASClassLoaderUtil.getAppLibDirLibrariesAsList(
            appRoot, app.getLibraryDirectory(), null));
View Full Code Here

            application.setAppName(name);
            application.setClassLoader(cl);

            if (application.isVirtual()) {
                ModuleDescriptor md = application.getStandaloneBundleDescriptor().getModuleDescriptor();
                md.setModuleName(name);
            }

            try {
                applicationFactory.openWith(application, sourceArchive,
                    archivist);
            } catch(SAXParseException e) {
                throw new IOException(e);
            }
        }
        else {
            // for case where user specified --name
            // and it's a standalone module
            try {
                application = applicationFactory.openArchive(
                    name, archivist, sourceArchive, true);

                application.setAppName(name);

                ModuleDescriptor md = application.getStandaloneBundleDescriptor().getModuleDescriptor();
                md.setModuleName(name);
            } catch(SAXParseException e) {
                throw new IOException(e);
            }
        }
View Full Code Here

            // Get portion of request uri representing location within a module
            String wsdlPath = endpoint.getWsdlContentPath(requestUri);

            if( wsdlPath != null) {
                ModuleDescriptor module =
                    webService.getBundleDescriptor().getModuleDescriptor();

                if( wsdlPath.equals(webService.getWsdlFileUri())){
                    // If the request is for the main wsdl document, return
                    // the final wsdl instead of the wsdl from the module.
View Full Code Here

    private static String getClientModuleID(ServiceReferenceDescriptor srd) {

        String rvalue = "#default-client-context#";

        if (srd != null) {
            ModuleDescriptor md = null;
            BundleDescriptor bd = (BundleDescriptor) srd.getBundleDescriptor();

            if (bd != null) {
                md = bd.getModuleDescriptor();
            }

            Application a = bd.getApplication();
            if (a != null) {
                if (a.isVirtual()) {
                    rvalue = a.getRegistrationName();
                } else if (md != null) {
                    rvalue = FileUtils.makeFriendlyFilename(md.getArchiveUri());
                }
            } else if (md != null) {
                rvalue = FileUtils.makeFriendlyFilename(md.getArchiveUri());
            }
        }

        return rvalue;
    }
View Full Code Here

                        "enterprise.deployment.cannotreadDDs",
                        "Cannot read the Deployment Descriptors for module {0}",
                        new Object[]{in.getURI()}));
                return null;
            }
            ModuleDescriptor newModule = archivist.createModuleDescriptor(aBundle);
            newModule.setArchiveUri(in.getURI().getSchemeSpecificPart());
            application = Application.createApplication(habitat,appName,newModule);
        }

        // now read the runtime deployment descriptor
        if (handleRuntimeInfo) {
View Full Code Here

        Application application = null;
        if (desc instanceof Application) {
            application = (Application)desc;
        } else if (desc instanceof BundleDescriptor) {
            BundleDescriptor aBundle = (BundleDescriptor)desc;
            ModuleDescriptor newModule = archivist.createModuleDescriptor(aBundle);
            newModule.setArchiveUri(archive.getURI().getSchemeSpecificPart());
            String moduleName = newModule.getModuleName();
            application = Application.createApplication(habitat, moduleName,
                newModule);
        }
        return application;
    }
View Full Code Here

    public String getAbsolutePuRoot() {
        RootDeploymentDescriptor rootDD = getParent();
        if(rootDD.isApplication()){
            return getPuRoot();
        } else {
            ModuleDescriptor module = BundleDescriptor.class.cast(rootDD).
                    getModuleDescriptor();
            if(module.isStandalone()) {
                return getPuRoot();
            } else {
                final String moduleLocation = module.getArchiveUri();
                return moduleLocation + '/' + getPuRoot(); // see we always '/'
            }
        }
    }
View Full Code Here

            return libraryURLs;
        }

        File appRoot = new File(parentArchive.getURI());

        ModuleDescriptor moduleDesc = ((BundleDescriptor)bundleDesc).getModuleDescriptor();
        Application app = ((BundleDescriptor)moduleDesc.getDescriptor()).getApplication();

        // add libraries jars inside application lib directory
        libraryURLs.addAll(ASClassLoaderUtil.getAppLibDirLibrariesAsList(
            appRoot, app.getLibraryDirectory(), null));
View Full Code Here

TOP

Related Classes of com.sun.enterprise.deployment.util.ModuleDescriptor

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.