Package com.sun.enterprise.deployment.util

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


                "getDescrForApplication",
                new Object[]{appName}, new String[]{"java.lang.String"});
        Iterator appModules = app.getModules();
        List result = new ArrayList();
        while (appModules.hasNext()) {
            ModuleDescriptor module = (ModuleDescriptor) appModules.next();
            if (SipUtil.SIP_MODULE_TYPE.equals(module.getModuleType().toString())) {
                SipBundleDescriptor desc = (SipBundleDescriptor) module.getDescriptor();
                HashMap oneRow = new HashMap();
                String componentName = module.getArchiveUri();
                if (componentName == null) {
                    componentName = "";
                }
                oneRow.put("componentName", componentName);
View Full Code Here


     */
    public void write(Application application, AbstractArchive out)
        throws IOException
    {
        if (application.isVirtual()) {
            ModuleDescriptor aModule = (ModuleDescriptor) application.getModules().next();
            Archivist moduleArchivist = ArchivistFactory.getArchivistForType(aModule.getModuleType());
            write(aModule.getDescriptor(), moduleArchivist,  out);
        } else {
            // this is a real application.
           
            // let's start by writing out all submodules deployment descriptors
            for (Iterator modules = application.getModules();modules.hasNext();) {
                ModuleDescriptor aModule = (ModuleDescriptor) modules.next();
                Archivist moduleArchivist = ArchivistFactory.getArchivistForType(aModule.getModuleType());
                if (aModule.getAlternateDescriptor()!=null) {
                    // the application is using alternate deployment descriptors
                    String runtimeDDPath = "sun-" + aModule.getAlternateDescriptor();
                    DeploymentDescriptorFile ddFile = moduleArchivist.getConfigurationDDFile();
                    if (ddFile!=null) {
                        OutputStream os = out.putNextEntry(runtimeDDPath);
                        ddFile.write(aModule.getDescriptor(), os);
                        out.closeEntry();
                    }
                } else {
                    AbstractArchive moduleArchive = out.getEmbeddedArchive(aModule.getArchiveUri());
                    write(aModule.getDescriptor(),  moduleArchivist, moduleArchive);
                }
            }
           
            // now let's write the application runtime descriptor
            ApplicationArchivist archivist = new ApplicationArchivist();
View Full Code Here

            }
        }

        for (Iterator modules = app.getModules(); modules.hasNext();) {
           
            ModuleDescriptor md = (ModuleDescriptor) modules.next();

            String moduleUri = md.getArchiveUri();
            String moduleRoot;
            if (app.isVirtual()) {
                moduleRoot = appRoot;
            } else {
                moduleRoot = DeploymentUtils.getEmbeddedModulePath(
                    appRoot, moduleUri);
            }
            if(md.getDescriptor() instanceof WebBundleDescriptor) {
                classpath.addAll(getModuleClassPath(ModuleType.WAR,  moduleRoot, appRoot));            
            } else {
                classpath.addAll(getModuleClassPath(md.getModuleType(),  moduleRoot, appRoot));            
            }
        }
        return classpath;       
    }
View Full Code Here

     * @param the abstract archive
     */
    public void write(Application application, AbstractArchive in,
        AbstractArchive out) throws IOException {
        if (application.isVirtual()) {
            ModuleDescriptor aModule = (ModuleDescriptor) application.getModules().next();
            Archivist moduleArchivist = ArchivistFactory.getArchivistForType(aModule.getModuleType());
            write(aModule.getDescriptor(), moduleArchivist, in, out);
        } else {
            // this is a real application.
           
            // let's start by writing out all submodules deployment descriptors
            for (Iterator modules = application.getModules();modules.hasNext();) {
                ModuleDescriptor aModule = (ModuleDescriptor) modules.next();
                Archivist moduleArchivist = ArchivistFactory.getArchivistForType(aModule.getModuleType());
                if (aModule.getAlternateDescriptor()!=null) {
                    // the application is using alternate deployment descriptors

                    // write or copy standard deployment descriptor
                    String ddPath = aModule.getAlternateDescriptor();
                    DeploymentDescriptorFile ddFile =
                        moduleArchivist.getStandardDDFile();           
                    
                    BundleDescriptor bundle =
                            (BundleDescriptor)aModule.getDescriptor();
                    if (!bundle.isFullFlag()) {
                        if (ddFile != null) {
                            OutputStream os = out.putNextEntry(ddPath);
                            ddFile.write(bundle, os);
                            out.closeEntry();
                        }
                    } else {
                        if (aModule.getModuleType().equals(ModuleType.WAR)) {
                            WebBundleDescriptor webBundle =
                                (WebBundleDescriptor) aModule.getDescriptor();
                            if (webBundle.hasWebServices()) {
                                if (ddFile != null) {
                                    OutputStream os = out.putNextEntry(ddPath);
                                    ddFile.write(webBundle, os);
                                    out.closeEntry();
                                }
                            } else {
                                Archivist.copyAnEntry(in, out, ddPath);
                            }
                        } else {
                            Archivist.copyAnEntry(in, out, ddPath);
                        }
                    }

                    String runtimeDDPath = "sun-" + ddPath;
                    DeploymentDescriptorFile confDDFile = moduleArchivist.getConfigurationDDFile();
                    if (confDDFile!=null) {
                        OutputStream os = out.putNextEntry(runtimeDDPath);
                        confDDFile.write(aModule.getDescriptor(), os);
                        out.closeEntry();
                    }
                } else {
                    String archiveUri = in.getArchiveUri();
                    String moduleUri = aModule.getArchiveUri();
                    AbstractArchive moduleArchive;
                    AbstractArchive moduleArchive2 = in.getEmbeddedArchive(archiveUri);
                    if (new File(archiveUri).isDirectory() &&
                        archiveUri.endsWith(".ear") &&
                        new File(archiveUri, moduleUri).isDirectory() &&
                        (moduleUri.endsWith(".war") ||
                         moduleUri.endsWith(".rar") ||
                         moduleUri.endsWith(".jar")) ) {
                        // this is the case where we support the directory deployment
                        // of directory names ending with module type suffix.
                        File subDir = new File(out.getArchiveUri(), moduleUri);
                        if (!subDir.exists()) {
                            subDir.mkdirs();
                        }
                        moduleArchive = new FileArchive();
                        ((FileArchive)moduleArchive).open(subDir.getPath());
                    } else {
                         moduleArchive = out.getEmbeddedArchive(moduleUri);
                    }
                    write(aModule.getDescriptor(),  moduleArchivist, moduleArchive2, moduleArchive);
                }
            }
           
            // now let's write the application descriptor
            ApplicationArchivist archivist = new ApplicationArchivist();
View Full Code Here

     * @param modId the module ID
     * @param desc the Archive descriptor that needs to be wrapped
     * @return Application  the Java EE Application Descriptor object
     */
    public Application getApplication(String modId, ArchiveDescriptor desc) {       
        ModuleDescriptor modDesc = new ModuleDescriptor();
        modDesc.setDescriptor((BundleDescriptor)desc);
        return Application.createApplication(modId, modDesc);
    }
View Full Code Here

        Application app = request.getDescriptor();
        if (app!=null) {
            if (!app.isVirtual()) {
                int counter = 0;
                for (Iterator it = app.getModules(); it.hasNext();) {
                    ModuleDescriptor md = (ModuleDescriptor) it.next();

                    key = moduleID + sep +
                          DeploymentStatus.MODULE_ID + sep +
                          String.valueOf(counter);
                    String subModuleID = moduleID + "#" + md.getArchiveUri();
                    status.addProperty(key, subModuleID); //subModuleID
                    if( XModuleType.isExtensionModule(md.getModuleType())) {
                        key = subModuleID + sep + DeploymentStatus.XMODULE_TYPE;
                    } else {
                        key = subModuleID + sep + DeploymentStatus.MODULE_TYPE;
                    }
                    //subModuleType
                    status.addProperty(key, String.valueOf(md.getModuleType().getValue()));

                    if (ModuleType.WAR.equals(md.getModuleType())) {
                        WebBundleDescriptor wbd =
                            (WebBundleDescriptor) md.getDescriptor();
                        key = subModuleID + sep + DeploymentStatus.CONTEXT_ROOT;
                        status.addProperty(key, getContextRoot(wbd)); //contextRoot
                    }
                    counter++;
                }
View Full Code Here

                    webService.getClientPublishUrl().toExternalForm();
            if (app.isVirtual()) { //standalone module
                keyPrefix = moduleID;
                moduleArchive = archive;
            else {
                ModuleDescriptor md =
                        webService.getBundleDescriptor().getModuleDescriptor();
                keyPrefix = moduleID + "#" + md.getArchiveUri();
                moduleArchive = archive.getEmbeddedArchive(md.getArchiveUri());
            }

            key = keyPrefix + sep + DeploymentStatus.WSDL_PUBLISH_URL;
            status.addProperty(key, clientPublishURL);
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 {
                final String moduleLocation =
                        DeploymentUtils.getRelativeEmbeddedModulePath(
                        applicationLocation, module.getArchiveUri());
                return moduleLocation + '/' + puRoot; // see we always '/'
            }
        }
    }
View Full Code Here

                // for application
                // first add the one under app root
                expectedXMLPaths.add(SUN_RESOURCE_XML_PATH);
                // then add the ones under sub module root
                for (Iterator itr = app.getModules();itr.hasNext();) {
                    ModuleDescriptor aModule =
                        (ModuleDescriptor) itr.next();
                    String moduleUri = FileUtils.makeFriendlyFileName(
                        aModule.getArchiveUri());
                    String subModulePath = moduleUri +
                       File.separator + SUN_RESOURCE_XML_PATH;
                    expectedXMLPaths.add(subModulePath);
                }
            }
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

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.