public abstract class DeploymentModule extends DefaultArchive implements PropertyStorage, Stateful
Stateful.State| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
MODULE_ID_KEY |
static java.lang.String |
MODULEIO_DIRECTORY |
static java.lang.String |
MODULEIO_FILE |
static java.lang.String |
MODULEIO_PACKINGLIST_DIRECTORY |
static java.lang.String |
MODULEIO_PACKINGLIST_FILE |
DATA_KEYARCHIVE_ENTRY_NAME_COMPARATOR, BUFFER_SIZE| Modifier | Constructor and Description |
|---|---|
protected |
DeploymentModule() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
addChangeListener(DeploymentModuleListener listener) |
static void |
addModuleIOFactory(DeploymentModuleIOFactory factory) |
abstract void |
addTag(java.lang.Object tag)
Add an immutable tag to a DeploymentModule.
|
static void |
close(java.lang.Object... streams) |
static void |
close(java.lang.Throwable throwable,
java.lang.Object... streams)
Utility method to close Input or Output streams, useful in an catch
block.
|
abstract void |
commit()
Flush all output streams and persists the DeploymentModule.
|
static DeploymentModule |
create(Archive archive,
java.lang.String ioModule,
java.util.logging.Logger logger,
java.lang.Object[] initialTags) |
static DeploymentModule |
create(java.lang.String ioModule) |
static DeploymentModule |
create(java.lang.String ioModule,
java.util.logging.Logger logger) |
abstract DeploymentModule[] |
getContainedModules() |
abstract java.util.logging.Logger |
getLogger()
Get the logger appropriate for this Deployment Module.
|
abstract java.lang.String |
getModuleId()
Get the ID for this module
|
abstract DeploymentModuleIO |
getModuleIO()
Get the DeploymentModuleIO that persists this DeploymentModule
|
abstract java.io.PrintWriter |
getPrintWriter()
Deprecated.
Use getLogger() instead.
|
abstract java.lang.Object[] |
getTags()
Get a list of all tags attached to this module.
|
abstract java.net.URL |
getURL()
Returns the URL where the module is persisted.
|
void |
initializeState()
Transition from 'Uninitialized' to 'Initialized'.
|
void |
invalidateState()
Transition from 'Valid' to 'Initialized' state.
|
abstract void |
load() |
abstract java.io.InputStream |
openInputStream(ArchiveEntry entry) |
abstract java.io.OutputStream |
openOutputStream(ArchiveEntry entry)
Open an output stream that can be used to create a replacement for
contents that entry.Url points to.
|
abstract void |
release()
Release all temporary resources held by the module.
|
void |
releaseState()
Release state and any resources its holding.
|
abstract void |
removeChangeListener(DeploymentModuleListener listener) |
abstract java.lang.Object |
removeTag(java.lang.Object tag)
Remove a tag.
|
abstract void |
rollback()
Discard all output streams that have been opened, revert to last committed.
|
abstract void |
setModuleId(java.lang.String id)
Set an ID for this module.
|
abstract void |
setModuleIO(java.lang.String ioModule) |
abstract void |
setURL(java.net.URL targetURL)
Set the URL which should be used as the location to which this DeploymentModule
should be written, or read from.
|
addContents, addContents, addContents, addContents, addDirectoryTrees, containsEntry, copyTo, copyToImpl, create, getArchiveEntries, getCdaPackets, getCollisions, getCompressionLevel, getEntryByName, getJarFileCreatedBy, getMainAttribute, getManifest, getManifestAsString, getMissingEntryNames, hasContents, isCompressed, isIncludeManifest, mergeManifest, mergeManifest, removeEntry, renameEntry, setCompressed, setCompressionLevel, setCreatedBy, setIncludeManifest, setMainAttribute, setMainClass, setReportNameCollisions, writeJarFile, writeJarFileclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetPropertiespublic static final java.lang.String MODULEIO_FILE
public static final java.lang.String MODULEIO_DIRECTORY
public static final java.lang.String MODULEIO_PACKINGLIST_FILE
public static final java.lang.String MODULEIO_PACKINGLIST_DIRECTORY
public static final java.lang.String MODULE_ID_KEY
public static DeploymentModule create(java.lang.String ioModule)
public static DeploymentModule create(Archive archive, java.lang.String ioModule, java.util.logging.Logger logger, java.lang.Object[] initialTags)
public static DeploymentModule create(java.lang.String ioModule, java.util.logging.Logger logger)
public abstract java.net.URL getURL()
public abstract void setURL(java.net.URL targetURL)
throws java.io.IOException
targetURL - java.io.IOException - if the URL is invalid, read-only, or if the I/O module does not
allow the URL to be changed.public abstract void setModuleIO(java.lang.String ioModule)
public abstract DeploymentModule[] getContainedModules()
public abstract void load()
throws java.io.IOException
java.io.IOExceptionpublic abstract java.io.OutputStream openOutputStream(ArchiveEntry entry) throws java.io.IOException
entry - java.io.IOExceptionpublic abstract java.io.InputStream openInputStream(ArchiveEntry entry) throws java.io.IOException
entry - java.io.IOExceptionpublic static void close(java.lang.Throwable throwable,
java.lang.Object... streams)
throws java.lang.Throwable
try
{
in1 = module.openInputStream( archiveEntry1);
out1 = module.openInputStream( archiveEntry1 );
in2 = module.openInputStream( archiveEntry2);
out2 = module.openOutputStream( archiveEntry2);
}
catch (Exception e)
{
module.close(e, in1, out1, in2, out2);
}
throwable - the current propagating exception.java.lang.Throwablepublic static void close(java.lang.Object... streams)
public abstract void commit()
throws DeployException
DeployExceptionpublic abstract void rollback()
throws DeployException
DeployExceptionpublic abstract void release()
throws DeployException
DeployExceptionpublic abstract void addChangeListener(DeploymentModuleListener listener)
public abstract void removeChangeListener(DeploymentModuleListener listener)
public static void addModuleIOFactory(DeploymentModuleIOFactory factory)
public abstract java.util.logging.Logger getLogger()
public abstract java.io.PrintWriter getPrintWriter()
public abstract void addTag(java.lang.Object tag)
tag - public abstract java.lang.Object[] getTags()
public abstract java.lang.Object removeTag(java.lang.Object tag)
public abstract DeploymentModuleIO getModuleIO()
public abstract void setModuleId(java.lang.String id)
id - public abstract java.lang.String getModuleId()
public void initializeState()
throws StateException
StatefulinitializeState in interface StatefulStateException - if state could not be initialized.public void invalidateState()
throws StateException
StatefulinvalidateState in interface StatefulStateException - if called on a released or uninitialized object.public void releaseState()
throws StateException
StatefulreleaseState in interface StatefulStateException - if called on an uninitialized or released object.