com.sun.enterprise.deployment.archivist
Class ApplicationArchivist

java.lang.Object
  extended by com.sun.enterprise.deployment.archivist.Archivist<Application>
      extended by com.sun.enterprise.deployment.archivist.ApplicationArchivist
All Implemented Interfaces:
CompositeArchivist

@Service
@Scoped(value=org.jvnet.hk2.component.PerLookup.class)
public class ApplicationArchivist
extends Archivist<Application>
implements CompositeArchivist

This class is responsible for handling application archive files

Version:
Author:
Jerome Dochez

Field Summary
 
Fields inherited from class com.sun.enterprise.deployment.archivist.Archivist
annotationProcessingRequested, APPCLIENT_EXTENSION, APPLICATION_EXTENSION, classLoader, CONNECTOR_EXTENSION, descriptor, EJB_EXTENSION, handleRuntimeInfo, logger, manifest, MANIFEST_VERSION_VALUE, path, UPLOAD_EXTENSION, WEB_EXTENSION, WEB_FRAGMENT_EXTENSION
 
Constructor Summary
ApplicationArchivist()
          Creates new ApplicationArchivist
 
Method Summary
 void copyInto(Application a, ReadableArchive source, WritableArchive target)
          Copy this archivist to a new abstract archive
 void copyInto(Application a, ReadableArchive source, WritableArchive target, boolean overwriteManifest)
          Copy this archivist to a new abstract archive
 void copyInto(ReadableArchive source, WritableArchive target)
          Copy this archivist to a new abstract archive
 Application createApplication(ReadableArchive archive, boolean directory)
          This method creates a top level Application object for an ear.
protected  java.lang.String getArchiveExtension()
           
 DeploymentDescriptorFile getConfigurationDDFile()
           
 Application getDefaultBundleDescriptor()
          /**
 XModuleType getModuleType()
           
 DeploymentDescriptorFile getStandardDDFile()
           
 DeploymentDescriptorFile getSunConfigurationDDFile()
           
 DeploymentDescriptorFile getWLConfigurationDDFile()
           
 Application open(ReadableArchive appArchive)
          open a new application archive file, read all the deployment descriptors
 Application openWith(Application application, ReadableArchive archive)
           
 boolean performOptionalPkgDependenciesCheck(ReadableArchive archive)
          Perform Optional packages dependencies checking on an archive
protected  boolean postHandles(ReadableArchive abstractArchive)
          This method will be invoked if and only if the following is true: 1.
 boolean readModulesDescriptors(Application app, ReadableArchive appArchive)
          read the modules deployment descriptor from this application object using the passed archive
 void readRuntimeDDFromDeploymentPlan(ReadableArchive planArchive, Application descriptor)
          Read the runtime deployment descriptors (can contained in one or many file) from a deployment plan archive, set the corresponding information in the passed descriptor.
 void readRuntimeDeploymentDescriptor(ReadableArchive archive, Application descriptor)
          Read the runtime deployment descriptors (can contained in one or many file) set the corresponding information in the passed descriptor.
 void validate(java.lang.ClassLoader aClassLoader)
          validates the DOL Objects associated with this archivist, usually it requires that a class loader being set on this archivist or passed as a parameter
protected  void writeContents(ReadableArchive in, WritableArchive out)
          writes the content of an archive to a JarFile
 
Methods inherited from class com.sun.enterprise.deployment.archivist.Archivist
addFileToArchive, applyRuntimeInfo, containsRuntimeDeploymentDescriptors, copyAnEntry, copyExtraElements, copyInto, copyInto, copyInto, copyInto, copyJarElements, copyStandardDeploymentDescriptors, createModuleDescriptor, extractEntry, getAnnotationErrorHandler, getClassLoader, getClassPath, getDeploymentDescriptorPath, getDescriptor, getLibraries, getListOfFilesToSkip, getManifest, getPath, getRuntimeDeploymentDescriptorPath, getRuntimeXMLValidation, getRuntimeXMLValidationLevel, getScanner, getTempFile, getTempFile, getUniqueEntryFilenameFor, getWebServicesDDFile, getWebServicesDeploymentDescriptorPath, getXMLValidation, getXMLValidationLevel, handles, hasRuntimeDeploymentDescriptor, hasStandardDeploymentDescriptor, initializeContext, isAnnotationProcessingRequested, isHandlingRuntimeInfo, isProcessAnnotation, open, open, open, open, open, postAnnotationProcess, postOpen, postRuntimeDDsRead, postStandardDDsRead, printDescriptor, processAnnotations, processAnnotations, readAnnotations, readAnnotations, readMetaInfo, readRuntimeDDFromDeploymentPlan, readRuntimeDeploymentDescriptor, readStandardDeploymentDescriptor, renameTmp, saveRuntimeInfo, setAnnotationErrorHandler, setAnnotationProcessingRequested, setArchiveUri, setClassLoader, setClassPath, setDescriptor, setHandleRuntimeInfo, setManifest, setModuleDescriptor, setRuntimeXMLValidation, setRuntimeXMLValidationLevel, setXMLValidation, setXMLValidationLevel, supportsModuleType, write, write, write, write, writeContents, writeContents, writeDeploymentDescriptors, writeExtraDeploymentDescriptors, writeRuntimeDeploymentDescriptors, writeRuntimeDeploymentDescriptors, writeStandardDeploymentDescriptors, writeStandardDeploymentDescriptors, writeWebServicesDescriptors, writeWLRuntimeDeploymentDescriptors
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplicationArchivist

public ApplicationArchivist()
Creates new ApplicationArchivist

Method Detail

getModuleType

public XModuleType getModuleType()
Specified by:
getModuleType in class Archivist<Application>
Returns:
the module type handled by this archivist as defined in the application DTD

writeContents

protected void writeContents(ReadableArchive in,
                             WritableArchive out)
                      throws java.io.IOException
writes the content of an archive to a JarFile

Overrides:
writeContents in class Archivist<Application>
Parameters:
in - the descriptors to use for writing
out - the output stream to write to
Throws:
java.io.IOException

getDefaultBundleDescriptor

public Application getDefaultBundleDescriptor()
/**

Specified by:
getDefaultBundleDescriptor in class Archivist<Application>
Returns:
a default BundleDescriptor for this archivist

open

public Application open(ReadableArchive appArchive)
                 throws java.io.IOException,
                        org.xml.sax.SAXParseException
open a new application archive file, read all the deployment descriptors

Overrides:
open in class Archivist<Application>
Parameters:
appArchive - the file path for the J2EE Application archive
Returns:
the deployment descriptor for this archive
Throws:
java.io.IOException
org.xml.sax.SAXParseException

openWith

public Application openWith(Application application,
                            ReadableArchive archive)
                     throws java.io.IOException,
                            org.xml.sax.SAXParseException
Overrides:
openWith in class Archivist<Application>
Throws:
java.io.IOException
org.xml.sax.SAXParseException

createApplication

public Application createApplication(ReadableArchive archive,
                                     boolean directory)
                              throws java.io.IOException,
                                     org.xml.sax.SAXParseException
This method creates a top level Application object for an ear.

Parameters:
archive - the archive for the application
directory - whether the application is packaged as a directory
Throws:
java.io.IOException
org.xml.sax.SAXParseException

readModulesDescriptors

public boolean readModulesDescriptors(Application app,
                                      ReadableArchive appArchive)
                               throws java.io.IOException,
                                      org.xml.sax.SAXParseException
read the modules deployment descriptor from this application object using the passed archive

Parameters:
app - application containing the list of modules.
appArchive - containing the sub modules files.
Returns:
true if everything went fine
Throws:
java.io.IOException
org.xml.sax.SAXParseException

readRuntimeDeploymentDescriptor

public void readRuntimeDeploymentDescriptor(ReadableArchive archive,
                                            Application descriptor)
                                     throws java.io.IOException,
                                            org.xml.sax.SAXParseException
Read the runtime deployment descriptors (can contained in one or many file) set the corresponding information in the passed descriptor. By default, the runtime deployment descriptors are all contained in the xml file characterized with the path returned by

Overrides:
readRuntimeDeploymentDescriptor in class Archivist<Application>
Parameters:
archive - the input archive
descriptor - the initialized deployment descriptor
Throws:
java.io.IOException
org.xml.sax.SAXParseException

readRuntimeDDFromDeploymentPlan

public void readRuntimeDDFromDeploymentPlan(ReadableArchive planArchive,
                                            Application descriptor)
                                     throws java.io.IOException,
                                            org.xml.sax.SAXParseException
Read the runtime deployment descriptors (can contained in one or many file) from a deployment plan archive, set the corresponding information in the passed descriptor.

Overrides:
readRuntimeDDFromDeploymentPlan in class Archivist<Application>
Throws:
java.io.IOException
org.xml.sax.SAXParseException

validate

public void validate(java.lang.ClassLoader aClassLoader)
validates the DOL Objects associated with this archivist, usually it requires that a class loader being set on this archivist or passed as a parameter

Overrides:
validate in class Archivist<Application>

getStandardDDFile

public DeploymentDescriptorFile getStandardDDFile()
Specified by:
getStandardDDFile in class Archivist<Application>
Returns:
the DeploymentDescriptorFile responsible for handling standard deployment descriptor

getConfigurationDDFile

public DeploymentDescriptorFile getConfigurationDDFile()
Specified by:
getConfigurationDDFile in class Archivist<Application>
Returns:
if exists the DeploymentDescriptorFile responsible for handling the configuration deployment descriptors

getSunConfigurationDDFile

public DeploymentDescriptorFile getSunConfigurationDDFile()
Overrides:
getSunConfigurationDDFile in class Archivist<Application>
Returns:
if exists the DeploymentDescriptorFile responsible for handling the Sun configuration deployment descriptors

getWLConfigurationDDFile

public DeploymentDescriptorFile getWLConfigurationDDFile()
Overrides:
getWLConfigurationDDFile in class Archivist<Application>
Returns:
if exists the DeploymentDescriptorFile responsible for handling the WL configuration deployment descriptors

performOptionalPkgDependenciesCheck

public boolean performOptionalPkgDependenciesCheck(ReadableArchive archive)
                                            throws java.io.IOException
Perform Optional packages dependencies checking on an archive

Overrides:
performOptionalPkgDependenciesCheck in class Archivist<Application>
Throws:
java.io.IOException

copyInto

public void copyInto(ReadableArchive source,
                     WritableArchive target)
              throws java.io.IOException
Copy this archivist to a new abstract archive

Overrides:
copyInto in class Archivist<Application>
Parameters:
source - the archive to copy from
target - the new archive to use to copy our contents into
Throws:
java.io.IOException

copyInto

public void copyInto(Application a,
                     ReadableArchive source,
                     WritableArchive target)
              throws java.io.IOException
Copy this archivist to a new abstract archive

Parameters:
a - the deployment descriptor for an application
source - the source archive
target - the target archive
Throws:
java.io.IOException

copyInto

public void copyInto(Application a,
                     ReadableArchive source,
                     WritableArchive target,
                     boolean overwriteManifest)
              throws java.io.IOException
Copy this archivist to a new abstract archive

Parameters:
a - the deployment descriptor for an application
source - the source archive
target - the target archive
overwriteManifest - if true, the manifest in source archive overwrites the one in target
Throws:
java.io.IOException

postHandles

protected boolean postHandles(ReadableArchive abstractArchive)
                       throws java.io.IOException
This method will be invoked if and only if the following is true: 1. directory deployment with neither standard nor runtime DD 2. JSR88 DeploymentManager.distribute using InputStream with neither standard nor runtime DD

Note that we will only venture a guess for case 1. JSR88 deployment of an application (ear) using InputStream without any deployment descriptor will NOT be supported at this time.

Specified by:
postHandles in class Archivist<Application>
Returns:
true if the archivist is handling the provided archive
Throws:
java.io.IOException

getArchiveExtension

protected java.lang.String getArchiveExtension()
Specified by:
getArchiveExtension in class Archivist<Application>
Returns:
The archive extension handled by a specific archivist


Copyright © 2012 GlassFish Community. All Rights Reserved.