Package com.sun.enterprise.deployment.deploy.shared

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


  try {
    System.in.read();
  } catch (java.io.IOException ioe) {
  }

  FileArchive in = new FileArchive();

  try {
    in.open(appDir);
  } catch (java.io.IOException ioe) {
  }


  EjbArchivist ejbArchivist = new EjbArchivist();
View Full Code Here


    }

    private void save() {

  FileArchive in = new FileArchive();

  try {
    in.open(applicationDirectory);
  } catch (java.io.IOException ioe) {
  }

  DescriptorArchivist archivist = new DescriptorArchivist();
View Full Code Here

  try {
    System.in.read();
  } catch (java.io.IOException ioe) {
  }

  FileArchive in = new FileArchive();

  try {
    in.open(appDir);
  } catch (java.io.IOException ioe) {
  }


  ApplicationArchivist archivist = new ApplicationArchivist();
View Full Code Here

   try {
       AppClientArchivist appClientArchivist = new AppClientArchivist();
       appClientArchivist.setXMLValidation(validateXml);
             appClientArchivist.setClassLoader(cl);
      
       FileArchive archive = openDDArchive(modId, modDir);
            
             // Try to load the app from the serialized descriptor file.
             SerializedDescriptorHelper.Loader sdLoader =
                     SerializedDescriptorHelper.load(modId, this);
             Application deserializedApplication = sdLoader.getApplication();
View Full Code Here

        }
        try {
      WebArchivist webArchivist = new WebArchivist();
      webArchivist.setXMLValidation(validateXml);
     
      FileArchive archive = openDDArchive(modId, modDir);
            // Try to load the app from the serialized descriptor file.
            SerializedDescriptorHelper.Loader sdLoader =
                    SerializedDescriptorHelper.load(modId, this);
            Application deserializedApplication = sdLoader.getApplication();
            /*
 
View Full Code Here

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

            if (isVirtual) {
                appDes.setVirtual(true);
            }
            SerializedDescriptorHelper.store(appId, this, appDes);

            FileArchive archive = new FileArchive();
            archive.open(generatedAppDir);

            FileArchive archive2 = new FileArchive();
            archive2.open(appDir);

            DescriptorArchivist archivist = new DescriptorArchivist();
            archivist.write(appDes, archive2, archive);

            // copy the additional webservice elements etc
View Full Code Here

     * @throws SAXParseException
     */
    public void readPersistenceDeploymentDescriptors(
            String appDir, Application application)
            throws IOException, SAXParseException {
        FileArchive archive = new FileArchive();
        archive.open(appDir);
        try {
            ApplicationArchivist.readPersistenceDeploymentDescriptorsRecursively(
                    archive, application);
        } finally {
            archive.close();
        }
    }
View Full Code Here

    // else load from generated/xml dir
    // print a warning if generated/xml dir is not there
    // and load from original dir (upgrade scenario)
    public FileArchive openDDArchive(String appId, String appDir)
        throws IOException, ConfigException {
        FileArchive in = new FileArchive();
        if (isSystemPredeployed(appId)) {
            in.open(appDir);
        } else {
            String xmlDir = getGeneratedXMLLocation(appId);
            if (FileUtils.safeIsDirectory(xmlDir)) {
                if (isGeneratedObsolete(xmlDir)) {
                    _logger.log(Level.INFO, "core.gen_is_obsolete",
                            new Object[] {appId, appDir});
                    in.open(appDir);
                } else {
                    in.open(xmlDir);
                }
            } else {
                // log a warning message in the server log
                _logger.log(Level.WARNING, "core.no_xmldir",
                    new Object[]{xmlDir, appDir});
                in.open(appDir);
            }
        }
        return in;
    }
View Full Code Here

     *         metadata
     */
    public static Application processJavaEEMetaData(File moduleRootDirectory,
        File moduleScratchDirectory, ClassLoader moduleClassLoader,
        boolean isDeploy) throws IOException, SAXParseException {
        FileArchive archive = new FileArchive();
        try {
            if (isDeploy) {
                // If this is deployment scenario, we should process JavaEE
                // annotations and all deployment descriptors should be loaded
                // from module root directory

                archive.open(moduleRootDirectory.getAbsolutePath());
                Archivist moduleArchivist =
                    ArchivistFactory.getArchivistForArchive(archive);
                moduleArchivist.setAnnotationProcessingRequested(true);
                moduleArchivist.setClassLoader(moduleClassLoader);
                return ApplicationArchivist.openArchive(moduleArchivist,
                    archive, true);
            } else {
                // If this is server start up scenario, we do not need to
                // process JavaEE annotations again. The application
                // deployment descriptors will be loaded from
                // moduleScratchDirectory and persistence descriptors from
                // moduleRootDirectory

                archive.open(moduleScratchDirectory.getAbsolutePath());
                Archivist moduleArchivist =
                    ArchivistFactory.getArchivistForArchive(archive);
                ClassLoader tcl = (moduleClassLoader instanceof InstrumentableClassLoader) ?  InstrumentableClassLoader.class.cast(moduleClassLoader).copy() : moduleClassLoader;
                moduleArchivist.setClassLoader(tcl);
                Application application = ApplicationArchivist.openArchive(
                    moduleArchivist, archive, true);
                application.setClassLoader(tcl);
                for (BundleDescriptor bd : (Collection <BundleDescriptor>)
                    application.getBundleDescriptors()) {
                    bd.setClassLoader(tcl);
                }
                // we need to read persistence descriptors separately
                // because they are read from appDir as oppsed to xmlDir.
                FileArchive archive2 = new FileArchive();
                try {
                    archive2.open(moduleRootDirectory.getAbsolutePath());
                    ApplicationArchivist.readPersistenceDeploymentDescriptorsRecursively(archive2, application);
                } finally {
                    archive2.close();
                }
                return application;
            }
        } finally {
            archive.close();
View Full Code Here

TOP

Related Classes of com.sun.enterprise.deployment.deploy.shared.FileArchive

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.