Package com.sun.enterprise.deployment.util

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


        Application application = (Application) descriptor;
        Node appNode = super.writeDescriptor(parent, nodeName, descriptor);
 
        // web*
  for (Iterator modules=application.getModules();modules.hasNext();) {
      ModuleDescriptor module = (ModuleDescriptor) modules.next();
      if (module.getModuleType().equals(ModuleType.WAR)) {
    Node web = appendChild(appNode, RuntimeTagNames.WEB);
    appendTextChild(web, RuntimeTagNames.WEB_URI, module.getArchiveUri());
    appendTextChild(web, RuntimeTagNames.CONTEXT_ROOT, module.getContextRoot());
      }
  }
 
  // pass-by-reference ?
  if (application.isPassByReferenceDefined()) {
View Full Code Here


        archivist.setDescriptor(application);

        Iterator<ModuleDescriptor> bundles = application.getModules();
        // archive all the modules first.
        while (bundles.hasNext()) {
            ModuleDescriptor bundle = bundles.next();
            String moduleName = bundle.getArchiveUri(); // eg., EJBImplementWSDL.jar
            String massagedModuleName = FileUtils.makeFriendlyFilename(moduleName); // eg., EJBImplementWSDL_jar
            String explodedModulePath = explodedDir + File.separator + massagedModuleName;
            String moduleArhivePath = explodedDir + File.separator + moduleName;
            createJar(explodedModulePath, moduleArhivePath);
            DeploymentContext.deleteDirectory(new File(explodedModulePath)); // delete EJBImplementWSDL_jar
View Full Code Here

            ApplicationDeploymentDescriptorFile addf =
                new ApplicationDeploymentDescriptorFile();
            fis = new FileInputStream(f);
            Application app = (Application) addf.read(fis);
            for (Iterator itr=app.getModules();itr.hasNext();) {
                ModuleDescriptor md = (ModuleDescriptor) itr.next();
                String uri = md.getArchiveUri();
                if (bundleName.equals(uri)) {
                    altDD = md.getAlternateDescriptor();
                    break;
                }
            }
        } catch (Exception e) {
            _logger.log(Level.FINE, "Error while reading alt-dd", e);
View Full Code Here

       
        // ok we should now have the list of modules, so we can happily explode them...
        Iterator<ModuleDescriptor> bundles = appDesc.getModules();
        while (bundles.hasNext()) {
           
            ModuleDescriptor bundle = bundles.next();
           
            String moduleName = bundle.getArchiveUri();
            String massagedModuleName =  FileUtils.makeFriendlyFilename(moduleName);
            File archiveFile = new File(destination, moduleName);
            File moduleDir = new File(destination, massagedModuleName);
            explodeJar(archiveFile, moduleDir);
           
View Full Code Here

         *to be returned.
         */
        for (Iterator it = app.getModulesByType(ModuleType.CAR); it.hasNext();) {
            Object o = it.next();
            if (o instanceof ModuleDescriptor) {
                ModuleDescriptor moduleDescriptor = (ModuleDescriptor) o;
                BundleDescriptor bd = moduleDescriptor.getDescriptor();
                if (bd instanceof ApplicationClientDescriptor) {
                    ApplicationClientDescriptor appclientDescriptor = (ApplicationClientDescriptor) bd;
                    JavaWebStartAccessDescriptor jwsAD = appclientDescriptor.getJavaWebStartAccessDescriptor();
                    if (jwsAD == null || jwsAD.isEligible()) {
                        mds.add(moduleDescriptor);
View Full Code Here

        InputSource source = null;
        if (location.startsWith("/")) // NOI18N
            location = location.substring(1);
        else
            location = "WEB-INF/" + location; // NOI18N
        ModuleDescriptor moduleDesc = webd.getModuleDescriptor();
        String archBase = context.getAbstractArchive().getArchiveUri();
        String uri = null;
        if(moduleDesc.isStandalone()){
            uri = archBase;
        } else {
            uri = archBase + File.separator +
                FileUtils.makeFriendlyFileName(moduleDesc.getArchiveUri());
        }
        FileArchive arch = new FileArchive();
        arch.open(uri);
        InputStream is = arch.getEntry(location);
        try {
        // is can be null if wrong location of tld is specified in web.xml
            if (is == null)
                throw new IOException(smh.getLocalString
                        (getClass().getName() + ".exception1", // NOI18N
                                "Wrong tld [ {0} ] specified in the web.xml of [ {1} ]", // NOI18N
                                new Object[]{location, moduleDesc.getArchiveUri()}));
            source = new InputSource(is);
            document = builder.parse(source);
        } finally {
            try{
                if(is != null)
View Full Code Here

   
    private void readFacesConfigDocument(WebBundleDescriptor webd) throws Exception {
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        factory.setValidating(false);
        DocumentBuilder builder = factory.newDocumentBuilder();
        ModuleDescriptor moduleDesc = webd.getModuleDescriptor();
        String archBase = context.getAbstractArchive().getArchiveUri();
        String uri = null;
        if(moduleDesc.isStandalone()){
            uri = archBase;
        } else {
            uri = archBase + File.separator +
                    FileUtils.makeFriendlyFileName(moduleDesc.getArchiveUri());
        }
        FileArchive arch = new FileArchive();
        arch.open(uri);
        InputStream is = arch.getEntry(facesConfigFileName);
        InputSource source = new InputSource(is);
View Full Code Here

    private File getJspOutDir(){
        // frameworkContext.getJspOutDir() will be non-null only when the
        // call is from deployment backend and precompilejsp is set
        File jspOutDir = frameworkContext.getJspOutDir();
        if(jspOutDir != null) {
            ModuleDescriptor moduleDescriptor = webd.getModuleDescriptor();
            if(moduleDescriptor.isStandalone())
                return jspOutDir;
            return new File(jspOutDir, FileUtils.makeFriendlyFilename(moduleDescriptor.getArchiveUri()));
        }
        Random random=new Random();
        String prefix=System.getProperty("java.io.tmpdir")+File.separator+".jspc";
        do{
            float f=random.nextFloat();
View Full Code Here

                PersistenceUnitDescriptor.class.cast(descriptor);
        RootDeploymentDescriptor rootDD = pu.getParent().getParent();
        if(rootDD.isApplication()) {
            moduleName = Result.APP;
        } else {
            ModuleDescriptor mdesc =
                    BundleDescriptor.class.cast(rootDD).getModuleDescriptor();
            final ModuleType moduleType = mdesc.getModuleType();
            if(moduleType == ModuleType.EJB) {
                moduleName = Result.EJB;
            } else if (moduleType == ModuleType.WAR) {
                moduleName = Result.WEB;
            } else if (moduleType == ModuleType.CAR) {
View Full Code Here

        RootDeploymentDescriptor rootDD =
                PersistenceUnitDescriptor.class.cast(descriptor).getParent().getParent();
        if(rootDD.isApplication()) {
            return archBase;
        } else {
            ModuleDescriptor mdesc =
                    BundleDescriptor.class.cast(rootDD).getModuleDescriptor();
            if(mdesc.isStandalone()) {
                return archBase;
            } else {
                return archBase + File.separator +
                        FileUtils.makeFriendlyFileName(mdesc.getArchiveUri());
            }
        }
    }
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.