Examples of AbstractArchive


Examples of com.sun.enterprise.deployment.deploy.shared.AbstractArchive

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

Examples of com.sun.enterprise.deployment.deploy.shared.AbstractArchive

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

Examples of com.sun.enterprise.deployment.deploy.shared.AbstractArchive

                    // either a j2ee jar file or a .class file
                    if (file.endsWith(".class")) {
                        return DEPLOY_SUCCESS;
                    }
                }
                AbstractArchive arch = openFileAsArchive(file);
                if (arch != null) {
                    result = DEPLOY_SUCCESS;
                    arch.close();
                } else {
                    result = DEPLOY_PENDING;
                }
            } catch (AutoDeploymentException ade) {
                result = DEPLOY_FAILURE;
View Full Code Here

Examples of com.sun.enterprise.deployment.deploy.shared.AbstractArchive

         *@return the AbstractArchive for the file (null if it shoudl be tried later)
         *@throws AutoDeploymenException if the manager has been unable to open
         *the file as an archive past the configured expiration time
         */
        AbstractArchive openFileAsArchive(String file) throws AutoDeploymentException {
            AbstractArchive archive = null;
            File f = new File(file);
            if (shouldOpen(f)) {
                try {
                    /*
                     Try to open the file as an archive and then remove the file, if
View Full Code Here

Examples of com.sun.enterprise.deployment.deploy.shared.AbstractArchive

        }

        String sep = DeploymentStatus.KEY_SEPARATOR;
        Application app = request.getDescriptor();
        String moduleID = request.getName();
        AbstractArchive moduleArchive = null;
        String key = null;
        String keyPrefix = null;

        FileArchive archive = new FileArchive();
        archive.open(RelativePathResolver.resolvePath(
                        getGeneratedAppLocation(request)));

        for (Iterator it = app.getWebServiceDescriptors().iterator();
                it.hasNext();) {
            WebService webService = (WebService) it.next();
            // No work needed if webservice is configured for URL publishing
            if (!webService.hasFilePublishing()) {
                continue;
            }

            // For file publishing, URL is a file URL for a directory
            String clientPublishURL =
                    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);

            // Collect the names of all entries in or below the
            // dedicated wsdl directory.
            BundleDescriptor bundle = webService.getBundleDescriptor();
            Enumeration entries = moduleArchive.entries(bundle.getWsdlDir());

            // Strictly speaking, we only need to write the files needed by
            // imports of this web service's wsdl file.  However, it's not
            // worth actual parsing the whole chain just to figure this
            // out.  In the worst case, some unnecessary files under
            // META-INF/wsdl or WEB-INF/wsdl will be written to the publish
            // directory.
            int counter = 0;
            while(entries.hasMoreElements()) {
                String name = (String) entries.nextElement();
                key = keyPrefix + sep + DeploymentStatus.WSDL_FILE_ENTRIES +
                            sep + String.valueOf(counter);
                status.addProperty(key, stripWsdlDir(name,bundle));

                //full path to the wsdl file location on the server
                String wsdlFileLocation =
                        moduleArchive.getArchiveUri() + File.separator +
                        name.replace('/', File.separatorChar);
                key = key + sep + DeploymentStatus.WSDL_LOCATION;
                status.addProperty(key, wsdlFileLocation);
                counter++;
            }
View Full Code Here

Examples of com.sun.enterprise.deployment.deploy.shared.AbstractArchive

            String defaultTarget =  (AMXUtil.isEE()) ? "domain" : "server";
            targets = new String[] {defaultTarget};
        }
       
       archivePath = archivePath.replace('\\', '/' );
        AbstractArchive archive = (new ArchiveFactory()).openArchive(archivePath);
        DeploymentFacility df= DeploymentFacilityFactory.getLocalDeploymentFacility();
        JESProgressObject progressObject = null;
       
        progressObject = df.deploy(df.createTargets(targets), archive, null , props)//null for deployment plan
        DeploymentStatus status = null;
View Full Code Here

Examples of com.sun.enterprise.deployment.deploy.shared.AbstractArchive

        app.setName(appName);

        List<AbstractArchive> unknowns = new ArrayList();
        File[] files = getEligibleEntries(new File(appRoot), directory);
        for (File subModule : files) {
            AbstractArchive subArchive = null;
            try {
                try {
                    if (!directory) {
                        subArchive = new InputJarArchive();
                        ((InputJarArchive)subArchive).open(subModule.getAbsolutePath());
                    } else {
                        subArchive = new FileArchive();
                        ((FileArchive)subArchive).open(subModule.getAbsolutePath());
                    }
                } catch (IOException ex) {
                    _logger.log(Level.WARNING, ex.getMessage());
                }

                //for archive deployment, we check the sub archives by its
                //file extension; for directory deployment, we check the sub
                //directories by its name. We are now supporting directory
                //names with both "_suffix" and ".suffix".

                //Section EE.8.4.2.1.a
                String name = subModule.getName();
                String uri = deriveArchiveUri(appRoot, subModule, directory);
                if ( (!directory && name.endsWith(".war"))
                        || (directory &&
                            (name.endsWith("_war") ||
                             name.endsWith(".war"))) ) {
                    String contextRoot =
                    uri.substring(uri.lastIndexOf('/')+1, uri.lastIndexOf('.'));
                    ModuleDescriptor md = new ModuleDescriptor();
                    md.setArchiveUri(uri);
                    md.setModuleType(ModuleType.WAR);
                    md.setContextRoot(contextRoot);
                    app.addModule(md);
                }
                //Section EE.8.4.2.1.b
                else if ( (!directory && name.endsWith(".rar"))
                            || (directory &&
                                (name.endsWith("_rar") ||
                                 name.endsWith(".rar"))) ) {
                    ModuleDescriptor md = new ModuleDescriptor();
                    md.setArchiveUri(uri);
                    md.setModuleType(ModuleType.RAR);
                    app.addModule(md);
                }
                else if ( (!directory && name.endsWith(".jar"))
                            || (directory &&
                                (name.endsWith("_jar") ||
                                 name.endsWith(".jar"))) ) {
                    try {
                        //Section EE.8.4.2.1.d.i
                        AppClientArchivist acArchivist = new AppClientArchivist();
                        if (acArchivist.hasStandardDeploymentDescriptor(subArchive)
                            || acArchivist.hasRuntimeDeploymentDescriptor(subArchive)
                            || acArchivist.getMainClassName(subArchive.getManifest()) != null) {

                            ModuleDescriptor md = new ModuleDescriptor();
                            md.setArchiveUri(uri);
                            md.setModuleType(ModuleType.CAR);
                            md.setManifest(subArchive.getManifest());
                            app.addModule(md);
                            continue;
                        }

                        //Section EE.8.4.2.1.d.ii
                        EjbArchivist ejbArchivist  = new EjbArchivist();
                        if (ejbArchivist.hasStandardDeploymentDescriptor(subArchive)
                            || ejbArchivist.hasRuntimeDeploymentDescriptor(subArchive)) {

                            ModuleDescriptor md = new ModuleDescriptor();
                            md.setArchiveUri(uri);
                            md.setModuleType(ModuleType.EJB);
                            app.addModule(md);
                            continue;
                        }
                    } catch (IOException ex) {
                        _logger.log(Level.WARNING, ex.getMessage());
                    }

                    //Still could not decide between an ejb and a library
                    unknowns.add(subArchive);
                } else {
                    //ignored
                }
            } finally {
                if (subArchive != null) {
                    try {
                        subArchive.close();
                    } catch (IOException ioe) {
                        _logger.log(Level.WARNING, localStrings.getLocalString("enterprise.deployment.errorClosingSubArch", "Error closing subarchive {0}", new Object[] {subModule.getAbsolutePath()}), ioe);
                    }
                }
            }
View Full Code Here

Examples of com.sun.enterprise.deployment.deploy.shared.AbstractArchive

        final String targetName = getOption(TARGET_OPTION);               
       
        final String deploymentPlan = getOption(DEPLOYMENTPLAN_OPTION);
        JESProgressObject progressObject = null;
        try {
            AbstractArchive arch = (new ArchiveFactory()).openArchive(filespecToJarURI(filePath));
            AbstractArchive plan = null;
            if (deploymentPlan != null) {
                plan = (new ArchiveFactory()).openArchive(filespecToJarURI(deploymentPlan));
            }
            //value of the map is String only
            Map deployOptions = createDeploymentProperties();
View Full Code Here

Examples of com.sun.enterprise.deployment.deploy.shared.AbstractArchive

        String methodSig = className + "doDeploy(String,String,String,String) "; // used for logging.
        boolean deploymentSuccessful = true;
        String deploymentError = null;
        Throwable deploymentException = null;
        String archivePath = null;
        AbstractArchive arch = null;
        try {
            if (!isDummyApp(appLocation)) {
                if(!(USED_WITH_NON_SOAP_WSDL.equalsIgnoreCase(System.getProperty(USED_WITH)))) {
                    appLocation = processWSDLs(appLocation);
                }
                archivePath = (new File(appLocation)).isDirectory()
                    ? createArchive(appLocation, serviceUnitName)
                    : appLocation;
               
                logger.log(Level.FINE,
                        methodSig + " appName = " + serviceUnitName + ", archivePath = " +
                        archivePath + ", target = " + target);

                Map deployOptions = getDefaultDeploymentOptions(archivePath,
                        serviceUnitName,
                        target);
                arch = (new ArchiveFactory()).openArchive(archivePath);
                AbstractArchive plan = null;
                Target[] targets = deployer.createTargets(new String[]{target});
                logger.log(Level.FINE, methodSig + " calling backend deploy");
                JESProgressObject progressObject =
                        deployer.deploy(targets, arch, plan, deployOptions);
                DeploymentStatus status = deployer.waitFor(progressObject);
View Full Code Here

Examples of com.sun.enterprise.deployment.deploy.shared.AbstractArchive

          
        /*
         *Create archives for the module file and, if present, the deployment plan file, and
         *then delegate to the variant of deploy that accepts archives as arguments.
         */
        AbstractArchive appArchive = null;
        AbstractArchive planArchive = null;
        ArchiveFactory archiveFactory = new ArchiveFactory();
       
        try {
            appArchive = archiveFactory.openArchive(toJarURI(moduleArchive));
       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.