Package com.sun.enterprise.deployment.util

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


            }

            //there should only be one appclient in this ear file
            for (Iterator modules = Application.class.cast(descriptor).getModules();
                    modules.hasNext();) {
                ModuleDescriptor md = ModuleDescriptor.class.cast(modules.next());
                if (md.getModuleType().equals(ModuleType.CAR)) {
                    appclientSource = source.getEmbeddedArchive(md.getArchiveUri());
                    if (source2 != null) {
                        appclientSource2 =
                            source2.getEmbeddedArchive(md.getArchiveUri());
                    }
                    break;
                }
            }
        } else {
            appclientSource = source;
            appclientSource2 = source2;
        }

        //copy over all content of the appclient
        if (appclientSource != null) {
            ClientJarMakerUtils.populateModuleJar(
                appclientSource, appclientSource2, target);
        } else {
            //this is a workaround because otherwise the appclient jar could
            //be empty which causes problems when closing the archive (there is
            //a requirement on having at least one entry in the archive before
            //closing)
            ClientJarMakerUtils.copyDeploymentDescriptors(
                new ApplicationArchivist(), source, source2, target);
        }

        // for backward compatibility, we need to include the content
        // of the ejb module as well, since many clients currently are
        // packaged without their ejb dependencies.  We will copy the
        // .class entries only.  We copy them here _after_ the appclient
        // classes have been copied so that if any duplicates exist,
        // the class in the original appclient jar prevails.
        if (descriptor.isApplication()) {
            for (Iterator modules = Application.class.cast(descriptor).getModules();
                    modules.hasNext();) {
                ModuleDescriptor md = ModuleDescriptor.class.cast(modules.next());
                if (md.getModuleType().equals(ModuleType.EJB)) {
                    AbstractArchive subSource =
                        source.getEmbeddedArchive(md.getArchiveUri());
                    for (Enumeration e = subSource.entries();e.hasMoreElements();) {
                        String entryName = String.class.cast(e.nextElement());
                        if (!entryName.endsWith(".class")) {
                            continue;
                        }
View Full Code Here


    }   

    protected String getAbstractArchiveUri(EjbDescriptor desc) {
        String archBase = getVerifierContext().getAbstractArchive().
                getArchiveUri();
        final ModuleDescriptor moduleDescriptor = desc.getEjbBundleDescriptor().
                getModuleDescriptor();
        if (moduleDescriptor.isStandalone()) {
            return archBase; // it must be a stand-alone module; no such physical dir exists
        } else {
            return archBase + File.separator +
                    FileUtils.makeFriendlyFileName(moduleDescriptor.getArchiveUri());
        }
    }
View Full Code Here

        RootDeploymentDescriptor rootDD = persistenceUnitDescriptor.getParent().                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

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

                        ModuleDescriptor aModule =
                            (ModuleDescriptor) modules.next();

                        if (!((aModule.getModuleType())
                                .equals(ModuleType.WAR))) {

                            _logger.fine("Skipping non web 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);
View Full Code Here

                    // 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);
View Full Code Here

   

    protected String getAbstractArchiveUri(WebBundleDescriptor desc) {
        String archBase = getVerifierContext().getAbstractArchive().
                getArchiveUri();
        final ModuleDescriptor moduleDescriptor = desc.getModuleDescriptor();
        if (moduleDescriptor.isStandalone()) {
            return archBase; // it must be a stand-alone module; no such physical dir exists
        } else {
            return archBase + File.separator +
                    FileUtils.makeFriendlyFileName(moduleDescriptor.getArchiveUri());
        }
    }
View Full Code Here

    public abstract Result check(ApplicationClientDescriptor descriptor);    

    protected String getAbstractArchiveUri(ApplicationClientDescriptor desc) {
        String archBase = getVerifierContext().getAbstractArchive().
                getArchiveUri();
        final ModuleDescriptor moduleDescriptor = desc.getModuleDescriptor();
        if (moduleDescriptor.isStandalone()) {
            return archBase; // it must be a stand-alone module; no such physical dir exists
        } else {
            return archBase + File.separator +
                    FileUtils.makeFriendlyFileName(moduleDescriptor.getArchiveUri());
        }
    }
View Full Code Here

     }

    protected String getAbstractArchiveUri(WebServiceEndpoint desc) {
        String archBase = getVerifierContext().getAbstractArchive().
                getArchiveUri();
        final ModuleDescriptor moduleDescriptor = desc.getBundleDescriptor().
                getModuleDescriptor();
        if (moduleDescriptor.isStandalone()) {
            return archBase; // it must be a stand-alone module; no such physical dir exists
        } else {
            return archBase + File.separator +
                    FileUtils.makeFriendlyFileName(moduleDescriptor.getArchiveUri());
        }
    }
View Full Code Here

    public abstract Result check(ServiceReferenceDescriptor descriptor);    
   
    protected String getAbstractArchiveUri(ServiceReferenceDescriptor desc) {
        String archBase = getVerifierContext().getAbstractArchive().
                getArchiveUri();
        final ModuleDescriptor moduleDescriptor = desc.getBundleDescriptor().
                getModuleDescriptor();
        if (moduleDescriptor.isStandalone()) {
            return archBase; // it must be a stand-alone module; no such physical dir exists
        } else {
            return archBase + File.separator +
                    FileUtils.makeFriendlyFileName(moduleDescriptor.getArchiveUri());
        }
    }
View Full Code Here

    private String jarName = "";
    private String componentName = "";
   
    public ComponentNameConstructor(EjbDescriptor ejbDsc) {
      EjbBundleDescriptor ejbBundle = ejbDsc.getEjbBundleDescriptor();
        ModuleDescriptor moduleDesc = ejbBundle.getModuleDescriptor();
        if(!moduleDesc.isStandalone()){ // print app name only for embedded ones
            this.appName = ejbBundle.getApplication().getRegistrationName();
        }
      this.jarName = moduleDesc.getArchiveUri();
      this.componentName = ejbDsc.getName();
    }
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.