Class Archivist<T extends BundleDescriptor>
- java.lang.Object
-
- com.sun.enterprise.deployment.archivist.Archivist<T>
-
- Direct Known Subclasses:
AppClientArchivist
,ApplicationArchivist
,ConnectorArchivist
,EjbArchivist
,WebArchivist
@Contract public abstract class Archivist<T extends BundleDescriptor> extends Object
This abstract class contains all common behaviour for Achivisits. Archivists classes are responsible for reading and writing correct J2EE Archives- Author:
- Jerome Dochez
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
annotationProcessingRequested
protected static String
APPCLIENT_EXTENSION
protected static String
APPLICATION_EXTENSION
protected ClassLoader
classLoader
protected List<ConfigurationDeploymentDescriptorFile>
confDDFiles
protected static String
CONNECTOR_EXTENSION
protected T
descriptor
protected static String
EJB_EXTENSION
protected List<ExtensionsArchivist>
extensionsArchivists
protected org.glassfish.hk2.api.ServiceLocator
habitat
protected boolean
handleRuntimeInfo
protected org.glassfish.hk2.api.ServiceLocator
locator
protected static Logger
logger
protected Manifest
manifest
static String
MANIFEST_VERSION_VALUE
protected String
path
protected DeploymentDescriptorFile<T>
standardDD
protected static String
UPLOAD_EXTENSION
protected static String
WEB_EXTENSION
protected static String
WEB_FRAGMENT_EXTENSION
-
Constructor Summary
Constructors Constructor Description Archivist()
Creates new Archivist
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected static void
addFileToArchive(WritableArchive archive, String filePath, String entryName)
add a file to an output abstract archivevoid
copyAnEntry(ReadableArchive in, WritableArchive out, String entryName)
void
copyExtraElements(ReadableArchive in, WritableArchive out)
void
copyInto(ReadableArchive source, WritableArchive target)
Copy source archivist to a target abstract archive.void
copyInto(ReadableArchive source, WritableArchive target, boolean overwriteManifest)
Copy source archivist to a target abstract archive.void
copyInto(ReadableArchive source, WritableArchive target, Vector entriesToSkip)
Copy source archivist to a target abstract archive.void
copyInto(ReadableArchive source, WritableArchive target, Vector entriesToSkip, boolean overwriteManifest)
Copy this archivist to a new abstract archivevoid
copyInto(WritableArchive target)
Copy this archivist to a new abstract archiveprotected void
copyJarElements(ReadableArchive in, WritableArchive out, Vector ignoreList)
copy all contents of a jar file to a new jar file except for all the deployment descriptors filesvoid
copyStandardDeploymentDescriptors(ReadableArchive in, WritableArchive out)
ModuleDescriptor
createModuleDescriptor(T descriptor)
creates a new module descriptor for this archivistVector
getAllWebservicesDeploymentDescriptorPaths()
ErrorHandler
getAnnotationErrorHandler()
protected abstract String
getArchiveExtension()
ClassLoader
getClassLoader()
Gets the classloader for this archivistString
getClassPath()
abstract List<ConfigurationDeploymentDescriptorFile>
getConfigurationDDFiles()
abstract T
getDefaultBundleDescriptor()
String
getDeploymentDescriptorPath()
T
getDescriptor()
List<ExtensionsArchivist>
getExtensionArchivists()
Vector
getLibraries(Archive archive)
Vector
getListOfFilesToSkip(ReadableArchive archive)
Manifest
getManifest()
abstract ArchiveType
getModuleType()
String
getPath()
String
getRuntimeDeploymentDescriptorPath(ReadableArchive archive)
boolean
getRuntimeXMLValidation()
String
getRuntimeXMLValidationLevel()
ModuleScanner
getScanner()
Returns the scanner for this archivist, usually it is the scanner registered with the same module type as this archivist, but subclasses can return a different versionabstract DeploymentDescriptorFile<T>
getStandardDDFile()
protected static File
getTempFile(File fileOrDir)
Utility method to get a tmp file in the current user directory of the provided directoryprotected static File
getTempFile(String fileOrDirPath)
utility method to get a tmp file in the current user directory of the provided directoryprotected String
getUniqueEntryFilenameFor(Archive archive, String trialName)
boolean
getXMLValidation()
String
getXMLValidationLevel()
boolean
handles(ReadableArchive archive)
Returns true if this archivist is capable of handling the archive type Here we check for the existence of the deployment descriptorsboolean
hasRuntimeDeploymentDescriptor(ReadableArchive archive)
boolean
hasStandardDeploymentDescriptor(ReadableArchive archive)
protected void
initializeContext(Archivist other)
initializes this instance from another archivist, this is used to transfer contextual information between archivists, for example whether we should handle runtime information and suchboolean
isAnnotationProcessingRequested()
boolean
isHandlingRuntimeInfo()
protected boolean
isProcessAnnotation(BundleDescriptor descriptor)
T
open(File file)
open a new archive file using a file descriptorT
open(String path)
Open a new archive file, read the XML descriptor and set the constructed DOL descriptor instanceT
open(ReadableArchive archive)
Open a new archive file, read the deployment descriptors and annotations and set the constructed DOL descriptor instanceT
open(ReadableArchive archive, Application app)
T
open(ReadableArchive descriptorArchive, ReadableArchive contentArchive)
T
open(ReadableArchive descriptorArchive, ReadableArchive contentArchive, Application app)
Creates the DOL object graph for an app for which the descriptor(s) reside in one archive and the content resides in another.Application
openWith(Application app, ReadableArchive archive)
boolean
performOptionalPkgDependenciesCheck(ReadableArchive archive)
Perform Optional packages dependencies checking on an archiveprotected void
postAnnotationProcess(T descriptor, ReadableArchive archive)
perform any action after annotation processedprotected abstract boolean
postHandles(ReadableArchive archive)
Returns true if this archivist is capable of handling the archive type Here we check for the existence of the deployment descriptorsprotected void
postOpen(T descriptor, ReadableArchive archive)
perform any post deployment descriptor reading actionvoid
postRuntimeDDsRead(T descriptor, ReadableArchive archive)
perform any action after all runtime DDs readprotected void
postStandardDDsRead(T descriptor, ReadableArchive archive, Map<ExtensionsArchivist,RootDeploymentDescriptor> extensions)
perform any action after all standard DDs is readprotected void
postValidate(BundleDescriptor bundleDesc, ReadableArchive archive)
void
printDescriptor()
print the current descriptor associated with this archivistprotected ProcessingResult
processAnnotations(RootDeploymentDescriptor bundleDesc, ModuleScanner scanner, ReadableArchive archive)
Process annotations in a bundle descriptor, the annotation processing is dependent on the type of descriptor being passed.ProcessingResult
processAnnotations(T bundleDesc, ReadableArchive archive)
Process annotations in a bundle descriptor, the annotation processing is dependent on the type of descriptor being passed.protected void
readAnnotations(ReadableArchive archive, T descriptor, Map<ExtensionsArchivist,RootDeploymentDescriptor> extensions)
Read all Java EE annotationsprotected void
readAnnotations(ReadableArchive archive, T descriptor, Map<ExtensionsArchivist,RootDeploymentDescriptor> extensions, ModuleScanner scanner)
Object
readMetaInfo(ReadableArchive archive)
void
readRuntimeDeploymentDescriptor(ReadableArchive archive, T descriptor)
Read the runtime deployment descriptors (can contained in one or many file) set the corresponding information in the passed descriptor.void
readRuntimeDeploymentDescriptor(ReadableArchive archive, T descriptor, boolean warnIfMultipleDDs)
Read the runtime deployment descriptors (can contained in one or many file) set the corresponding information in the passed descriptor.T
readStandardDeploymentDescriptor(ReadableArchive archive)
Read the standard deployment descriptors (can contained in one or many file) and return the corresponding initialized descriptor instance.protected boolean
renameTmp(String from, String to)
rename a tmp filevoid
setAnnotationErrorHandler(ErrorHandler annotationErrorHandler)
sets annotation ErrorHandler for this archivistvoid
setAnnotationProcessingRequested(boolean annotationProcessingRequested)
sets if this archivist process annotationvoid
setArchiveUri(String path)
Sets the path for this archivist's archive filevoid
setClassLoader(ClassLoader classLoader)
Sets the classloader for this archivistvoid
setClassPath(String newClassPath)
Sets the class-path for this archivevoid
setDescriptor(T descriptor)
Archivist read XML deployment descriptors and keep the parsed result in the DOL descriptor instances.void
setExtensionArchivists(List<ExtensionsArchivist> archivists)
Set the applicable extension archivists for this archivistvoid
setHandleRuntimeInfo(boolean handleRuntimeInfo)
sets if this archivist saves the runtime infovoid
setManifest(Manifest m)
sets the manifest file for this archivevoid
setModuleDescriptor(ModuleDescriptor<T> module)
Archivists can be associated with a module descriptor once the XML deployment descriptors have been read and the DOL tree is initialized.void
setRuntimeXMLValidation(boolean validate)
Turn on or off the XML Validation for runtime deployment descriptors loadingvoid
setRuntimeXMLValidationLevel(String level)
Sets the runtime xml validation error reporting/recovering level.void
setXMLValidation(boolean validate)
Turn on or off the XML Validation for all standard deployment descriptors loadingvoid
setXMLValidationLevel(String level)
Sets the xml validation error reporting/recovering level.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 parametervoid
write()
void
write(String outPath)
saves the archivevoid
write(ReadableArchive in, String outPath)
save the archivevoid
write(ReadableArchive in, WritableArchive out)
protected void
writeContents(ReadableArchive in, WritableArchive out)
writes the content of an archive to another archiveprotected void
writeContents(ReadableArchive in, WritableArchive out, Vector entriesToSkip)
writes the content of an archive to a JarFileprotected void
writeContents(WritableArchive out)
writes the content of an archive to a JarFilevoid
writeDeploymentDescriptors(ReadableArchive in, WritableArchive out)
writes the deployment descriptors (standard and runtime) to a JarFile using the right deployment descriptor pathvoid
writeExtensionDeploymentDescriptors(ReadableArchive in, WritableArchive out)
Write extension descriptorsvoid
writeRuntimeDeploymentDescriptors(ReadableArchive in, WritableArchive out)
writes the runtime deployment descriptors to an abstract archivevoid
writeStandardDeploymentDescriptors(WritableArchive out)
writes the standard deployment descriptors to an abstract archive
-
-
-
Field Detail
-
logger
protected static final Logger logger
-
MANIFEST_VERSION_VALUE
public static final String MANIFEST_VERSION_VALUE
- See Also:
- Constant Field Values
-
path
protected String path
-
handleRuntimeInfo
protected boolean handleRuntimeInfo
-
annotationProcessingRequested
protected boolean annotationProcessingRequested
-
manifest
protected Manifest manifest
-
standardDD
protected DeploymentDescriptorFile<T extends BundleDescriptor> standardDD
-
confDDFiles
protected List<ConfigurationDeploymentDescriptorFile> confDDFiles
-
classLoader
protected ClassLoader classLoader
-
APPLICATION_EXTENSION
protected static final String APPLICATION_EXTENSION
- See Also:
- Constant Field Values
-
APPCLIENT_EXTENSION
protected static final String APPCLIENT_EXTENSION
- See Also:
- Constant Field Values
-
WEB_EXTENSION
protected static final String WEB_EXTENSION
- See Also:
- Constant Field Values
-
WEB_FRAGMENT_EXTENSION
protected static final String WEB_FRAGMENT_EXTENSION
- See Also:
- Constant Field Values
-
EJB_EXTENSION
protected static final String EJB_EXTENSION
- See Also:
- Constant Field Values
-
CONNECTOR_EXTENSION
protected static final String CONNECTOR_EXTENSION
- See Also:
- Constant Field Values
-
UPLOAD_EXTENSION
protected static final String UPLOAD_EXTENSION
- See Also:
- Constant Field Values
-
descriptor
protected T extends BundleDescriptor descriptor
-
habitat
@Inject protected org.glassfish.hk2.api.ServiceLocator habitat
-
locator
@Inject protected org.glassfish.hk2.api.ServiceLocator locator
-
extensionsArchivists
protected List<ExtensionsArchivist> extensionsArchivists
-
-
Method Detail
-
initializeContext
protected void initializeContext(Archivist other)
initializes this instance from another archivist, this is used to transfer contextual information between archivists, for example whether we should handle runtime information and such
-
setExtensionArchivists
public void setExtensionArchivists(List<ExtensionsArchivist> archivists)
Set the applicable extension archivists for this archivist- Parameters:
descriptor
- for this archivist instnace
-
getExtensionArchivists
public List<ExtensionsArchivist> getExtensionArchivists()
-
setDescriptor
public void setDescriptor(T descriptor)
Archivist read XML deployment descriptors and keep the parsed result in the DOL descriptor instances. Sets the descriptor for a particular Archivist type- Parameters:
descriptor
- for this archivist instnace
-
getDescriptor
public T getDescriptor()
- Returns:
- the Descriptor for this archvist
-
open
public T open(ReadableArchive archive) throws IOException, SAXParseException
Open a new archive file, read the deployment descriptors and annotations and set the constructed DOL descriptor instance- Parameters:
archive
- the archive file path- Returns:
- the deployment descriptor for this archive
- Throws:
IOException
SAXParseException
-
open
public T open(ReadableArchive descriptorArchive, ReadableArchive contentArchive) throws IOException, SAXParseException
- Throws:
IOException
SAXParseException
-
open
public T open(ReadableArchive descriptorArchive, ReadableArchive contentArchive, Application app) throws IOException, SAXParseException
Creates the DOL object graph for an app for which the descriptor(s) reside in one archive and the content resides in another.This allows the app client container to use both the generated JAR which contains the descriptors that are filled in during deployment and also the developer's original JAR which contains the classes that might be subject to annotation processing.
- Parameters:
descriptorArchive
- archive containing the descriptor(s)contentArchive
- archive containing the classes, etc.app
- owning DOL application (if any)- Returns:
- DOL object graph for the application
- Throws:
IOException
SAXParseException
-
open
public T open(ReadableArchive archive, Application app) throws IOException, SAXParseException
- Throws:
IOException
SAXParseException
-
openWith
public Application openWith(Application app, ReadableArchive archive) throws IOException, SAXParseException
- Throws:
IOException
SAXParseException
-
open
public T open(String path) throws IOException, SAXParseException
Open a new archive file, read the XML descriptor and set the constructed DOL descriptor instance- Parameters:
path
- the archive file path- Returns:
- the deployment descriptor for this archive
- Throws:
IOException
SAXParseException
-
open
public T open(File file) throws IOException, SAXParseException
open a new archive file using a file descriptor- Parameters:
file
- the archive to open- Throws:
IOException
SAXParseException
-
postStandardDDsRead
protected void postStandardDDsRead(T descriptor, ReadableArchive archive, Map<ExtensionsArchivist,RootDeploymentDescriptor> extensions) throws IOException
perform any action after all standard DDs is read- Parameters:
descriptor
- the deployment descriptor for the modulearchive
- the module archiveextensions
- map of extension archivists- Throws:
IOException
-
postAnnotationProcess
protected void postAnnotationProcess(T descriptor, ReadableArchive archive) throws IOException
perform any action after annotation processed- Parameters:
descriptor
- the deployment descriptor for the modulearchive
- the module archive- Throws:
IOException
-
postRuntimeDDsRead
public void postRuntimeDDsRead(T descriptor, ReadableArchive archive) throws IOException
perform any action after all runtime DDs read- Parameters:
descriptor
- the deployment descriptor for the modulearchive
- the module archive- Throws:
IOException
-
postOpen
protected void postOpen(T descriptor, ReadableArchive archive) throws IOException
perform any post deployment descriptor reading action- Parameters:
descriptor
- the deployment descriptor for the modulearchive
- the module archive- Throws:
IOException
-
readAnnotations
protected void readAnnotations(ReadableArchive archive, T descriptor, Map<ExtensionsArchivist,RootDeploymentDescriptor> extensions) throws IOException
Read all Java EE annotations- Throws:
IOException
-
readAnnotations
protected void readAnnotations(ReadableArchive archive, T descriptor, Map<ExtensionsArchivist,RootDeploymentDescriptor> extensions, ModuleScanner scanner) throws IOException
- Throws:
IOException
-
getScanner
public ModuleScanner getScanner()
Returns the scanner for this archivist, usually it is the scanner registered with the same module type as this archivist, but subclasses can return a different version
-
processAnnotations
public ProcessingResult processAnnotations(T bundleDesc, ReadableArchive archive) throws AnnotationProcessorException, IOException
Process annotations in a bundle descriptor, the annotation processing is dependent on the type of descriptor being passed.
-
processAnnotations
protected ProcessingResult processAnnotations(RootDeploymentDescriptor bundleDesc, ModuleScanner scanner, ReadableArchive archive) throws AnnotationProcessorException, IOException
Process annotations in a bundle descriptor, the annotation processing is dependent on the type of descriptor being passed.
-
readStandardDeploymentDescriptor
public T readStandardDeploymentDescriptor(ReadableArchive archive) throws IOException, SAXParseException
Read the standard deployment descriptors (can contained in one or many file) and return the corresponding initialized descriptor instance. By default, the standard deployment descriptors are all contained in the xml file characterized with the path returned by- Returns:
- the initialized descriptor
- Throws:
IOException
SAXParseException
-
readRuntimeDeploymentDescriptor
public void readRuntimeDeploymentDescriptor(ReadableArchive archive, T 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- Parameters:
archive
- the archivedescriptor
- the initialized deployment descriptor- Throws:
IOException
SAXParseException
-
readRuntimeDeploymentDescriptor
public void readRuntimeDeploymentDescriptor(ReadableArchive archive, T descriptor, boolean warnIfMultipleDDs) 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- Parameters:
archive
- the archivedescriptor
- the initialized deployment descriptorwarnIfMultipleDDs
- whether to log warnings if both the GlassFish and the legacy Sun descriptors are present- Throws:
IOException
SAXParseException
-
write
public void write() throws IOException
- Throws:
IOException
-
write
public void write(String outPath) throws IOException
saves the archive- Parameters:
outPath
- the file to use- Throws:
IOException
-
write
public void write(ReadableArchive in, String outPath) throws IOException
save the archive- Parameters:
in
- archive to copy old elements fromoutPath
- the file to use- Throws:
IOException
-
write
public void write(ReadableArchive in, WritableArchive out) throws IOException
- Throws:
IOException
-
writeContents
protected void writeContents(WritableArchive out) throws IOException
writes the content of an archive to a JarFile- Parameters:
out
- jar output stream to write to- Throws:
IOException
-
writeContents
protected void writeContents(ReadableArchive in, WritableArchive out) throws IOException
writes the content of an archive to another archive- Parameters:
in
- input archiveout
- output archive- Throws:
IOException
-
writeContents
protected void writeContents(ReadableArchive in, WritableArchive out, Vector entriesToSkip) throws IOException
writes the content of an archive to a JarFile- Parameters:
in
- input archiveout
- archive output stream to write toentriesToSkip
- files to not write from the original archive- Throws:
IOException
-
writeDeploymentDescriptors
public void writeDeploymentDescriptors(ReadableArchive in, WritableArchive out) throws IOException
writes the deployment descriptors (standard and runtime) to a JarFile using the right deployment descriptor path- Parameters:
in
- the input archiveout
- the abstract archive file to write to- Throws:
IOException
-
writeStandardDeploymentDescriptors
public void writeStandardDeploymentDescriptors(WritableArchive out) throws IOException
writes the standard deployment descriptors to an abstract archive- Parameters:
out
- archive to write to- Throws:
IOException
-
writeRuntimeDeploymentDescriptors
public void writeRuntimeDeploymentDescriptors(ReadableArchive in, WritableArchive out) throws IOException
writes the runtime deployment descriptors to an abstract archive- Parameters:
in
- the input archiveout
- output archive- Throws:
IOException
-
writeExtensionDeploymentDescriptors
public void writeExtensionDeploymentDescriptors(ReadableArchive in, WritableArchive out) throws IOException
Write extension descriptors- Parameters:
in
- the input archiveout
- the output archive- Throws:
IOException
-
getDeploymentDescriptorPath
public String getDeploymentDescriptorPath()
- Returns:
- the location of the DeploymentDescriptor file for a particular type of J2EE Archive
-
getRuntimeDeploymentDescriptorPath
public String getRuntimeDeploymentDescriptorPath(ReadableArchive archive) throws IOException
- Returns:
- the location of the runtime deployment descriptor file for a particular type of J2EE Archive
- Throws:
IOException
-
setModuleDescriptor
public void setModuleDescriptor(ModuleDescriptor<T> module)
Archivists can be associated with a module descriptor once the XML deployment descriptors have been read and the DOL tree is initialized.
-
performOptionalPkgDependenciesCheck
public boolean performOptionalPkgDependenciesCheck(ReadableArchive archive) throws IOException
Perform Optional packages dependencies checking on an archive- Throws:
IOException
-
getModuleType
public abstract ArchiveType getModuleType()
- Returns:
- the module type handled by this archivist as defined in the application DTD/Schema
-
getStandardDDFile
public abstract DeploymentDescriptorFile<T> getStandardDDFile()
- Returns:
- the DeploymentDescriptorFile responsible for handling standard deployment descriptor
-
getConfigurationDDFiles
public abstract List<ConfigurationDeploymentDescriptorFile> getConfigurationDDFiles()
- Returns:
- the list of the DeploymentDescriptorFile responsible for handling the configuration deployment descriptors
-
getDefaultBundleDescriptor
public abstract T getDefaultBundleDescriptor()
- Returns:
- a default BundleDescriptor for this archivist
-
getArchiveExtension
protected abstract String getArchiveExtension()
- Returns:
- The archive extension handled by a specific archivist
-
postHandles
protected abstract boolean postHandles(ReadableArchive archive) throws IOException
Returns true if this archivist is capable of handling the archive type Here we check for the existence of the deployment descriptors- Returns:
- true if the archivist is handling the provided archive
- Throws:
IOException
-
hasStandardDeploymentDescriptor
public boolean hasStandardDeploymentDescriptor(ReadableArchive archive) throws IOException
- Throws:
IOException
-
hasRuntimeDeploymentDescriptor
public boolean hasRuntimeDeploymentDescriptor(ReadableArchive archive) throws IOException
- Throws:
IOException
-
handles
public boolean handles(ReadableArchive archive)
Returns true if this archivist is capable of handling the archive type Here we check for the existence of the deployment descriptors- Parameters:
archive
- the input archive- Returns:
- true if this archivist can handle this archive
-
createModuleDescriptor
public ModuleDescriptor createModuleDescriptor(T descriptor)
creates a new module descriptor for this archivist- Returns:
- the new module descriptor
-
printDescriptor
public void printDescriptor()
print the current descriptor associated with this archivist
-
setHandleRuntimeInfo
public void setHandleRuntimeInfo(boolean handleRuntimeInfo)
sets if this archivist saves the runtime info- Parameters:
handleRuntimeInfo
- to true to save the runtime info
-
isHandlingRuntimeInfo
public boolean isHandlingRuntimeInfo()
- Returns:
- true if this archivist will save the runtime info
-
setAnnotationProcessingRequested
public void setAnnotationProcessingRequested(boolean annotationProcessingRequested)
sets if this archivist process annotation- Parameters:
annotationProcessingRequested
- to true to process annotation
-
isAnnotationProcessingRequested
public boolean isAnnotationProcessingRequested()
- Returns:
- true if this archivist will process annotation
-
setAnnotationErrorHandler
public void setAnnotationErrorHandler(ErrorHandler annotationErrorHandler)
sets annotation ErrorHandler for this archivist- Parameters:
annotationErrorHandler
-
-
getAnnotationErrorHandler
public ErrorHandler getAnnotationErrorHandler()
- Returns:
- annotation ErrorHandler of this archivist
-
setManifest
public void setManifest(Manifest m)
sets the manifest file for this archive- Parameters:
m
- manifest to use at saving time
-
getManifest
public Manifest getManifest()
- Returns:
- the manifest file for this archive
-
setClassPath
public void setClassPath(String newClassPath)
Sets the class-path for this archive- Parameters:
newClassPath
- the new class-path
-
getClassPath
public String getClassPath()
- Returns:
- the class-path as set in the manifest associated with the archive
-
getLibraries
public Vector getLibraries(Archive archive)
- Returns:
- a list of libraries included in the archivist
-
getUniqueEntryFilenameFor
protected String getUniqueEntryFilenameFor(Archive archive, String trialName) throws IOException
- Throws:
IOException
-
getTempFile
protected static File getTempFile(String fileOrDirPath) throws IOException
utility method to get a tmp file in the current user directory of the provided directory- Parameters:
fileOrDirPath
- path to a file or directory to use as temp location (use parent directory if a file is provided)- Throws:
IOException
-
getListOfFilesToSkip
public Vector getListOfFilesToSkip(ReadableArchive archive) throws IOException
- Returns:
- the list of files that should not be copied from the old archive when a save is performed.
- Throws:
IOException
-
getTempFile
protected static File getTempFile(File fileOrDir) throws IOException
Utility method to get a tmp file in the current user directory of the provided directory- Parameters:
fileOrDir
- file or directory to use as temp location (use parent directory if a file is provided)- Throws:
IOException
-
addFileToArchive
protected static void addFileToArchive(WritableArchive archive, String filePath, String entryName) throws IOException
add a file to an output abstract archive- Parameters:
archive
- abstraction to use when adding the filefilePath
- to the file to addentryName
- the entry name in the archive- Throws:
IOException
-
copyJarElements
protected void copyJarElements(ReadableArchive in, WritableArchive out, Vector ignoreList) throws IOException
copy all contents of a jar file to a new jar file except for all the deployment descriptors files- Parameters:
in
- jar fileout
- jar fileignoreList
- vector of entry name to not copy from to source jar file- Throws:
IOException
-
renameTmp
protected boolean renameTmp(String from, String to) throws IOException
rename a tmp file- Parameters:
from
- nameto
- name- Throws:
IOException
-
setArchiveUri
public void setArchiveUri(String path)
Sets the path for this archivist's archive file
-
getPath
public String getPath()
- Returns:
- the path for this archivist's archive file
-
setClassLoader
public void setClassLoader(ClassLoader classLoader)
Sets the classloader for this archivist- Parameters:
classLoader
- classLoader
-
getClassLoader
public ClassLoader getClassLoader()
Gets the classloader for this archivist- Returns:
- classLoader
-
setXMLValidation
public void setXMLValidation(boolean validate)
Turn on or off the XML Validation for all standard deployment descriptors loading- Parameters:
validate
- set to true to turn on XML validation
-
getXMLValidation
public boolean getXMLValidation()
- Returns:
- true if the Deployment Descriptors XML will be validated while reading.
-
setRuntimeXMLValidation
public void setRuntimeXMLValidation(boolean validate)
Turn on or off the XML Validation for runtime deployment descriptors loading- Parameters:
validate
- set to true to turn on XML validation
-
getRuntimeXMLValidation
public boolean getRuntimeXMLValidation()
- Returns:
- true if the runtime XML will be validated while reading.
-
setXMLValidationLevel
public void setXMLValidationLevel(String level)
Sets the xml validation error reporting/recovering level. The reporting level is active only when xml validation is turned on @see setXMLValidation. so far, two values can be passed, medium which reports the xml validation and continue and full which reports the xml validation and stop the xml parsing.
-
getXMLValidationLevel
public String getXMLValidationLevel()
- Returns:
- the xml validation reporting level
-
setRuntimeXMLValidationLevel
public void setRuntimeXMLValidationLevel(String level)
Sets the runtime xml validation error reporting/recovering level. The reporting level is active only when xml validation is turned on @see setXMLValidation. so far, two values can be passed, medium which reports the xml validation and continue and full which reports the xml validation and stop the xml parsing.
-
getRuntimeXMLValidationLevel
public String getRuntimeXMLValidationLevel()
- Returns:
- the runtime xml validation reporting level
-
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
-
postValidate
protected void postValidate(BundleDescriptor bundleDesc, ReadableArchive archive)
-
copyInto
public void copyInto(WritableArchive target) throws IOException
Copy this archivist to a new abstract archive- Parameters:
target
- the new archive to use to copy our contents into- Throws:
IOException
-
copyInto
public void copyInto(ReadableArchive source, WritableArchive target) throws IOException
Copy source archivist to a target abstract archive. By default, every entry in source archive will be copied to the target archive, including the manifest of the source archive.- Parameters:
source
- the source archive to copy fromtarget
- the target archive to copy to- Throws:
IOException
-
copyInto
public void copyInto(ReadableArchive source, WritableArchive target, boolean overwriteManifest) throws IOException
Copy source archivist to a target abstract archive. By default, every entry in source archive will be copied to the target archive.- Parameters:
source
- the source archive to copy fromtarget
- the target archive to copy tooverwriteManifest
- if true, the manifest in source archive overwrites the one in target archive- Throws:
IOException
-
copyInto
public void copyInto(ReadableArchive source, WritableArchive target, Vector entriesToSkip) throws IOException
Copy source archivist to a target abstract archive. By default, the manifest in source archive overwrites the one in target archive.- Parameters:
source
- the source archive to copy fromtarget
- the target archive to copy toentriesToSkip
- the entries that will be skipped by target archive- Throws:
IOException
-
copyInto
public void copyInto(ReadableArchive source, WritableArchive target, Vector entriesToSkip, boolean overwriteManifest) throws IOException
Copy this archivist to a new abstract archive- Parameters:
source
- the source archive to copy fromtarget
- the target archive to copy toentriesToSkip
- the entries that will be skipped by target archiveoverwriteManifest
- if true, the manifest in source archive overwrites the one in target archive- Throws:
IOException
-
copyAnEntry
public void copyAnEntry(ReadableArchive in, WritableArchive out, String entryName) throws IOException
- Throws:
IOException
-
copyStandardDeploymentDescriptors
public void copyStandardDeploymentDescriptors(ReadableArchive in, WritableArchive out) throws IOException
- Throws:
IOException
-
copyExtraElements
public void copyExtraElements(ReadableArchive in, WritableArchive out) throws IOException
- Throws:
IOException
-
readMetaInfo
public Object readMetaInfo(ReadableArchive archive)
-
isProcessAnnotation
protected boolean isProcessAnnotation(BundleDescriptor descriptor)
-
getAllWebservicesDeploymentDescriptorPaths
public Vector getAllWebservicesDeploymentDescriptorPaths()
-
-