All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.beans.mb.JarRepositoryModel

java.lang.Object
   |
   +----com.ibm.beans.mb.RepositoryModel
           |
           +----com.ibm.beans.mb.JarRepositoryModel

public class JarRepositoryModel
extends RepositoryModel
This class contains the function for reading and writing a JAR file repository. In addition to element files, the JAR file repository should contain a META-INF/MANIFEST.MF file. This manifest can be a Sun-style manifest or an IBM Bean Extender manifest.

The URL syntax for specifying a JAR file repository is:

beans.jar:[drive_letter:]/<path>/<filename>.jar
 

For example:

beans.jar:/this/is/a/path/to/a/JarRepository.jar
 

Note that RepositoryModels are obtained from the RepositoryModelFactory. Typical use of a RepositoryModel is:

    RepositoryModelFactory.initialize();
    ...
    repo = RepositoryModelFactory.createRepositoryModel();
    repo.doOpen(); // reads repository (if necessary)
    ...
    repo.doClose(); // writes repository (if necessary)
    RepositoryModelFactory.destroyRepositoryModel(repo);
 

This RepositoryModel currently does not support write upon signed repositories. Signed repositories automatically become READ_ONLY when opened.

See Also:
RepositoryModel, RepositoryModelFactory

Constructor Index

 o JarRepositoryModel(URL, int)
Constructs a JarRepositoryModel.

Method Index

 o doClose()
Closes the RepositoryModel.
 o doOpen()
Opens the JarRepositoryModel, discovers what files exist in the repository, and builds a set of ManagedBeans and MBElements to reflect the repository contents.
 o reconstituteManagedBean(ManagedBean)
Re-loads the MBElement data for the specified ManagedBean from this RepositoryModel.

Constructors

 o JarRepositoryModel
 protected JarRepositoryModel(URL url,
                              int mode)
Constructs a JarRepositoryModel.

Parameters:
url - The location of the repository.
mode - READ_ONLY, WRITE_ONLY, or READ_WRITE.
See Also:
RepositoryModel, RepositoryModelFactory

Methods

 o doOpen
 public synchronized void doOpen() throws FileNotFoundException, InstantiationException, IllegalAccessException, InstantiationError, IOException
Opens the JarRepositoryModel, discovers what files exist in the repository, and builds a set of ManagedBeans and MBElements to reflect the repository contents.

Throws: FileNotFoundException
Thrown when the repository cannot be found in the file system.
Throws: IOException
Thrown if there are problems reading the repository.
Throws: InstantiationException
Thrown if an error occurs while building an MBElement.
Throws: IllegalAccessException
Thrown if an error occurs while building an MBElement
Throws: InstantiationError
Thrown if an attempt is made to build an unknown subclass of MBElement or if a file listed in the manifest does not exist.
Overrides:
doOpen in class RepositoryModel
 o doClose
 public synchronized void doClose() throws IOException
Closes the RepositoryModel. If the RepositoryModel was opened in WRITE_ONLY or READ_WRITE mode, the repository is written to the location specified by getRepositoryName().

Throws: IOException
Thrown if an IO problem occurs while writing the RepositoryModel.
Overrides:
doClose in class RepositoryModel
 o reconstituteManagedBean
 public synchronized boolean reconstituteManagedBean(ManagedBean mb) throws IOException
Re-loads the MBElement data for the specified ManagedBean from this RepositoryModel. Use this method after a ManagedBean is deserialized.

Parameters:
mb - The ManagedBean to be reconstituted.
Returns:
true if successful, false otherwise.
Throws: IOException
Thrown if an IO problem occurs while reading the RepositoryModel or the miscellaneous MBElement files.
Overrides:
reconstituteManagedBean in class RepositoryModel

All Packages  Class Hierarchy  This Package  Previous  Next  Index