Class ApplicationArchivist
- java.lang.Object
-
- com.sun.enterprise.deployment.archivist.Archivist<Application>
-
- com.sun.enterprise.deployment.archivist.ApplicationArchivist
-
@Service @PerLookup public class ApplicationArchivist extends Archivist<Application>
This class is responsible for handling application archive files- Author:
- Jerome Dochez
-
-
Field Summary
-
Fields inherited from class com.sun.enterprise.deployment.archivist.Archivist
annotationProcessingRequested, APPCLIENT_EXTENSION, APPLICATION_EXTENSION, classLoader, confDDFiles, CONNECTOR_EXTENSION, descriptor, EJB_EXTENSION, extensionsArchivists, habitat, handleRuntimeInfo, locator, logger, manifest, MANIFEST_VERSION_VALUE, path, standardDD, UPLOAD_EXTENSION, WEB_EXTENSION, WEB_FRAGMENT_EXTENSION
-
-
Constructor Summary
Constructors Constructor Description ApplicationArchivist()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcopyInto(Application a, ReadableArchive source, WritableArchive target)Copy this archivist to a new abstract archivevoidcopyInto(Application a, ReadableArchive source, WritableArchive target, boolean overwriteManifest)Copy this archivist to a new abstract archivevoidcopyInto(ReadableArchive source, WritableArchive target)Copy this archivist to a new abstract archiveApplicationcreateApplication(ReadableArchive archive, boolean directory)This method creates a top level Application object for an ear.protected StringgetArchiveExtension()List<ConfigurationDeploymentDescriptorFile>getConfigurationDDFiles()ApplicationgetDefaultBundleDescriptor()ArchiveTypegetModuleType()DeploymentDescriptorFilegetStandardDDFile()Applicationopen(ReadableArchive appArchive)open a new application archive file, read all the deployment descriptorsApplicationopenWith(Application application, ReadableArchive archive)booleanperformOptionalPkgDependenciesCheck(ReadableArchive archive)Perform Optional packages dependencies checking on an archiveprotected booleanpostHandles(ReadableArchive abstractArchive)This method will be invoked if and only if the following is true: 1.booleanreadModulesDescriptors(Application app, ReadableArchive appArchive)read the modules deployment descriptor from this application object using the passed archivevoidreadRuntimeDeploymentDescriptor(ReadableArchive archive, Application descriptor)Read the runtime deployment descriptors (can contained in one or many file) set the corresponding information in the passed descriptor.voidvalidate(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 parameterprotected voidwriteContents(ReadableArchive in, WritableArchive out)writes the content of an archive to a JarFile-
Methods inherited from class com.sun.enterprise.deployment.archivist.Archivist
addFileToArchive, copyAnEntry, copyExtraElements, copyInto, copyInto, copyInto, copyInto, copyJarElements, copyStandardDeploymentDescriptors, createModuleDescriptor, getAllWebservicesDeploymentDescriptorPaths, getAnnotationErrorHandler, getClassLoader, getClassPath, getDeploymentDescriptorPath, getDescriptor, getExtensionArchivists, getLibraries, getListOfFilesToSkip, getManifest, getPath, getRuntimeDeploymentDescriptorPath, getRuntimeXMLValidation, getRuntimeXMLValidationLevel, getScanner, getTempFile, getTempFile, getUniqueEntryFilenameFor, getXMLValidation, getXMLValidationLevel, handles, hasRuntimeDeploymentDescriptor, hasStandardDeploymentDescriptor, initializeContext, isAnnotationProcessingRequested, isHandlingRuntimeInfo, isProcessAnnotation, open, open, open, open, open, postAnnotationProcess, postOpen, postRuntimeDDsRead, postStandardDDsRead, postValidate, printDescriptor, processAnnotations, processAnnotations, readAnnotations, readAnnotations, readMetaInfo, readRuntimeDeploymentDescriptor, readStandardDeploymentDescriptor, renameTmp, setAnnotationErrorHandler, setAnnotationProcessingRequested, setArchiveUri, setClassLoader, setClassPath, setDescriptor, setExtensionArchivists, setHandleRuntimeInfo, setManifest, setModuleDescriptor, setRuntimeXMLValidation, setRuntimeXMLValidationLevel, setXMLValidation, setXMLValidationLevel, write, write, write, write, writeContents, writeContents, writeDeploymentDescriptors, writeExtensionDeploymentDescriptors, writeRuntimeDeploymentDescriptors, writeStandardDeploymentDescriptors
-
-
-
-
Method Detail
-
getModuleType
public ArchiveType getModuleType()
- Specified by:
getModuleTypein classArchivist<Application>- Returns:
- the module type handled by this archivist as defined in the application DTD
-
writeContents
protected void writeContents(ReadableArchive in, WritableArchive out) throws IOException
writes the content of an archive to a JarFile- Overrides:
writeContentsin classArchivist<Application>- Parameters:
in- the descriptors to use for writingout- the output stream to write to- Throws:
IOException
-
getDefaultBundleDescriptor
public Application getDefaultBundleDescriptor()
- Specified by:
getDefaultBundleDescriptorin classArchivist<Application>- Returns:
- a default BundleDescriptor for this archivist
-
open
public Application open(ReadableArchive appArchive) throws IOException, SAXParseException
open a new application archive file, read all the deployment descriptors- Overrides:
openin classArchivist<Application>- Parameters:
appArchive- the file path for the J2EE Application archive- Returns:
- the deployment descriptor for this archive
- Throws:
IOExceptionSAXParseException
-
openWith
public Application openWith(Application application, ReadableArchive archive) throws IOException, SAXParseException
- Overrides:
openWithin classArchivist<Application>- Throws:
IOExceptionSAXParseException
-
createApplication
public Application createApplication(ReadableArchive archive, boolean directory) throws IOException, SAXParseException
This method creates a top level Application object for an ear.- Parameters:
archive- the archive for the applicationdirectory- whether the application is packaged as a directory- Throws:
IOExceptionSAXParseException
-
readModulesDescriptors
public boolean readModulesDescriptors(Application app, ReadableArchive appArchive) throws IOException, 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:
IOExceptionSAXParseException
-
readRuntimeDeploymentDescriptor
public void readRuntimeDeploymentDescriptor(ReadableArchive archive, Application descriptor) throws IOException, 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:
readRuntimeDeploymentDescriptorin classArchivist<Application>- Parameters:
archive- the input archivedescriptor- the initialized deployment descriptor- Throws:
IOExceptionSAXParseException
-
validate
public void validate(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:
validatein classArchivist<Application>
-
getStandardDDFile
public DeploymentDescriptorFile getStandardDDFile()
- Specified by:
getStandardDDFilein classArchivist<Application>- Returns:
- the DeploymentDescriptorFile responsible for handling standard deployment descriptor
-
getConfigurationDDFiles
public List<ConfigurationDeploymentDescriptorFile> getConfigurationDDFiles()
- Specified by:
getConfigurationDDFilesin classArchivist<Application>- Returns:
- the list of the DeploymentDescriptorFile responsible for handling the configuration deployment descriptors
-
performOptionalPkgDependenciesCheck
public boolean performOptionalPkgDependenciesCheck(ReadableArchive archive) throws IOException
Perform Optional packages dependencies checking on an archive- Overrides:
performOptionalPkgDependenciesCheckin classArchivist<Application>- Throws:
IOException
-
copyInto
public void copyInto(ReadableArchive source, WritableArchive target) throws IOException
Copy this archivist to a new abstract archive- Overrides:
copyIntoin classArchivist<Application>- Parameters:
source- the archive to copy fromtarget- the new archive to use to copy our contents into- Throws:
IOException
-
copyInto
public void copyInto(Application a, ReadableArchive source, WritableArchive target) throws IOException
Copy this archivist to a new abstract archive- Parameters:
a- the deployment descriptor for an applicationsource- the source archivetarget- the target archive- Throws:
IOException
-
copyInto
public void copyInto(Application a, ReadableArchive source, WritableArchive target, boolean overwriteManifest) throws IOException
Copy this archivist to a new abstract archive- Parameters:
a- the deployment descriptor for an applicationsource- the source archivetarget- the target archiveoverwriteManifest- if true, the manifest in source archive overwrites the one in target- Throws:
IOException
-
postHandles
protected boolean postHandles(ReadableArchive abstractArchive) throws 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 DDNote 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:
postHandlesin classArchivist<Application>- Returns:
- true if the archivist is handling the provided archive
- Throws:
IOException
-
getArchiveExtension
protected String getArchiveExtension()
- Specified by:
getArchiveExtensionin classArchivist<Application>- Returns:
- The archive extension handled by a specific archivist
-
-