Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

oracle.jdeveloper.deploy
Class DeploymentModule

java.lang.Object
  extended by oracle.jdeveloper.deploy.DefaultArchive
      extended by oracle.jdeveloper.deploy.DeploymentModule
All Implemented Interfaces:
PropertyStorage, Copyable, Archive

public abstract class DeploymentModule
extends DefaultArchive
implements PropertyStorage

A DeploymentModule provides an interface for managing events and the persistence of a deployable Archive.


Field Summary
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
           
 
Fields inherited from interface oracle.javatools.data.PropertyStorage
DATA_KEY
 
Fields inherited from interface oracle.jdeveloper.deploy.Archive
ARCHIVE_ENTRY_NAME_COMPARATOR, BUFFER_SIZE
 
Constructor Summary
protected DeploymentModule()
           
 
Method Summary
static 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.io.PrintWriter printWriter, java.lang.Object[] initialTags)
           
static DeploymentModule create(java.lang.String ioModule)
           
static DeploymentModule create(java.lang.String ioModule, java.io.PrintWriter printWriter)
           
abstract  DeploymentModule[] getContainedModules()
           
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()
           
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.
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.
static 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.
 
Methods inherited from class oracle.jdeveloper.deploy.DefaultArchive
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, writeJarFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.javatools.data.PropertyStorage
getProperties
 

Field Detail

MODULEIO_FILE

public static final java.lang.String MODULEIO_FILE
See Also:
Constant Field Values

MODULEIO_DIRECTORY

public static final java.lang.String MODULEIO_DIRECTORY
See Also:
Constant Field Values

MODULEIO_PACKINGLIST_FILE

public static final java.lang.String MODULEIO_PACKINGLIST_FILE
See Also:
Constant Field Values

MODULEIO_PACKINGLIST_DIRECTORY

public static final java.lang.String MODULEIO_PACKINGLIST_DIRECTORY
See Also:
Constant Field Values

MODULE_ID_KEY

public static final java.lang.String MODULE_ID_KEY
See Also:
Constant Field Values
Constructor Detail

DeploymentModule

protected DeploymentModule()
Method Detail

create

public static DeploymentModule create(java.lang.String ioModule)

create

public static DeploymentModule create(Archive archive,
                                      java.lang.String ioModule,
                                      java.io.PrintWriter printWriter,
                                      java.lang.Object[] initialTags)

create

public static DeploymentModule create(java.lang.String ioModule,
                                      java.io.PrintWriter printWriter)

getURL

public abstract java.net.URL getURL()
Returns the URL where the module is persisted.

Returns:
URL to location where the module is or will be persisted, or null if a URL is not available yet.

setURL

public abstract void setURL(java.net.URL targetURL)
                     throws java.io.IOException
Set the URL which should be used as the location to which this DeploymentModule should be written, or read from.

Parameters:
targetURL -
Throws:
java.io.IOException - if the URL is invalid, read-only, or if the I/O module does not allow the URL to be changed.

setModuleIO

public abstract void setModuleIO(java.lang.String ioModule)

getContainedModules

public abstract DeploymentModule[] getContainedModules()

load

public abstract void load()
                   throws java.io.IOException
Throws:
java.io.IOException

openOutputStream

public abstract java.io.OutputStream openOutputStream(ArchiveEntry entry)
                                               throws java.io.IOException
Open an output stream that can be used to create a replacement for contents that entry.Url points to.

Parameters:
entry -
Returns:
Throws:
java.io.IOException

openInputStream

public abstract java.io.InputStream openInputStream(ArchiveEntry entry)
                                             throws java.io.IOException
Parameters:
entry -
Returns:
Throws:
java.io.IOException

close

public static void close(java.lang.Throwable throwable,
                         java.lang.Object... streams)
                  throws java.lang.Throwable
Utility method to close Input or Output streams, useful in an catch block. IOExceptions are thrown away. Original exception is rethrown if not null.
Example:
 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);
 }
 

Parameters:
throwable - the current propagating exception.
Throws:
java.lang.Throwable

close

public static void close(java.lang.Object... streams)

commit

public abstract void commit()
                     throws DeployException
Flush all output streams and persists the DeploymentModule.

Throws:
DeployException

rollback

public abstract void rollback()
                       throws DeployException
Discard all output streams that have been opened, revert to last committed.

Throws:
DeployException

release

public abstract void release()
                      throws DeployException
Release all temporary resources held by the module. Calling release() closes all input and output streams that are currently open and discards all modification history, so this should only be called after either a commit or rollback.

Throws:
DeployException

addChangeListener

public static void addChangeListener(DeploymentModuleListener listener)

removeChangeListener

public static void removeChangeListener(DeploymentModuleListener listener)

addModuleIOFactory

public static void addModuleIOFactory(DeploymentModuleIOFactory factory)

getPrintWriter

public abstract java.io.PrintWriter getPrintWriter()

addTag

public abstract void addTag(java.lang.Object tag)
Add an immutable tag to a DeploymentModule. Tags are used as 'labels' to identify characteristics of a DeploymentModule. tag.equals() is used to compare tags.

Parameters:
tag -

getTags

public abstract java.lang.Object[] getTags()
Get a list of all tags attached to this module.

Returns:

removeTag

public abstract java.lang.Object removeTag(java.lang.Object tag)
Remove a tag.

Returns:
the removed tag.

getModuleIO

public abstract DeploymentModuleIO getModuleIO()
Get the DeploymentModuleIO that persists this DeploymentModule

Returns:
The DeploymentModuleIO that persists this DeploymentModule

setModuleId

public abstract void setModuleId(java.lang.String id)
Set an ID for this module.

Parameters:
id -

getModuleId

public abstract java.lang.String getModuleId()
Get the ID for this module

Returns:
The ID.

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

Copyright © 1997, 2011, Oracle. All rights reserved.