All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.beans.mb.RepositoryModelFactory
java.lang.Object
|
+----com.ibm.beans.mb.RepositoryModelFactory
- public final class RepositoryModelFactory
- extends Object
- implements Serializable
This class defines a static singleton object that is
accessed when a RepositoryModel needs to be created or
destroyed.
A typically use of the RepositoryModelFactory is:
RepositoryModelFactory.initialize();
...
repo = RepositoryModelFactory.createRepositoryModel();
repo.doOpen(); // reads repository (if necessary)
...
repo.doClose(); // writes repository (if necessary)
RepositoryModelFactory.destroyRepositoryModel(repo);
RepositoryModelFactory will also generate custom, user-supplied
RepositoryModels. See the section on ManagedBeans/Repositories
in the Guide To Features and the documentation
for RepositoryModelFactoryInterface for more details.
- See Also:
- RepositoryModel, RepositoryModelFactoryInterface
-
RepositoryModelFactory()
- Constructor for RepositoryModelFactory.
-
convertFilenameToURL(String)
- Converts a repository file name to a URL name.
-
convertNameIntoCanonicalName(String)
- Converts a repository name into canonical form.
-
createRepositoryModel(Class, String, int)
- Creates a RepositoryModel
if one is not instantiated.
-
createRepositoryModel(String, int)
- Creates a RepositoryModel
if one is not instantiated.
-
createRepositoryModel(URL, int)
- Creates a RepositoryModel
if one is not instantiated.
-
destroyRepositoryModel(RepositoryModel)
- Destroys a RepositoryModel once the user is finished with it.
-
initialize()
- Initializes the entire Bean Management subsystem.
RepositoryModelFactory
protected RepositoryModelFactory()
- Constructor for RepositoryModelFactory.
initialize
public static synchronized void initialize()
- Initializes the entire Bean Management subsystem. This
method must be called before any attempt is made to construct a
URL specifying a repository. Ideally, this call goes in the
main() method of the application. Because the Java runtime does not
provide any way to programmatically initialize something
at start-up time, the developer must call this initialization method.
The BeanBagModel constructors call this method, so if you are using
BeanBagModels, you probably won't have to make this initialization.
This method needs to be called only once, but calling it multiple
times will not cause problems.
createRepositoryModel
public static synchronized RepositoryModel createRepositoryModel(URL url,
int mode) throws NoSuchMethodException, InstantiationException, IllegalAccessException, MalformedURLException, InvocationTargetException
- Creates a RepositoryModel
if one is not instantiated. If one already
exists, it is returned to the caller.
Supported access modes are multiple read access (with no
writers) or single write access. Currently, network
repositories are READ_ONLY.
This method accepts a URL object that specifies a repository.
Below are the repository types currently supported by the
Bean Management subsystem and the URL syntax used to
specify them:
- DirectoryRepositoryModel -
beans.directory:[drive_letter:]/<path>
For example:
beans.directory:/f:/this/is/a/path/to/a/DirectoryRepository
- JarRepositoryModel -
beans.jar:[drive_letter:]/<path>/<filename>.jar
For example:
beans.jar:/this/is/a/path/to/a/JarRepository.jar
- ZipRepositoryModel -
beans.zip:[drive_letter:]/<path>/<filename>.zip
For example:
beans.zip:/C:/this/is/a/path/to/a/ZipRepository.zip
- NetRepositoryModel -
beans.net://<hostname[:port]>/<servername>/[<item-key>]
For example:
beans.net://repoman.ibm.com/myServer/myClass.class
to specify a repository by class name, or
beans.net://repoman.ibm.com/myServer/CA2718A8128B3141C1618D0618E0496F
to specify a repository by warehouse item id. The hostname or
servername value may be an asterisk "*", in which case a locally
configured default value will be used. See the section on Network Deployment
in the Guide To Features for more details.
- Parameters:
- url - The location of this repository.
- mode - READ_ONLY, WRITE_ONLY, or READ_WRITE.
- Returns:
- The requested RepositoryModel, or null if the create request
is denied. For instance, null is returned if a WRITE_ONLY
request is made on a repository that is already accessed READ_ONLY.
- Throws: NoSuchMethodException
- Thrown if an error occurs while constructing
the repository access object.
- Throws: InstantiationException
- Thrown if an error occurs while building
the RepositoryModel.
- Throws: IllegalAccessException
- Thrown if an error occurs while building
the RepositoryModel.
- Throws: MalformedURLException
- Thrown if the repository name is incorrectly
formatted.
- Throws: InvocationTargetException
- Thrown if an error occurs while building
the RepositoryModel.
- See Also:
- RepositoryModel, URL
createRepositoryModel
public static synchronized RepositoryModel createRepositoryModel(String stringURL,
int mode) throws NoSuchMethodException, InstantiationException, IllegalAccessException, MalformedURLException, InvocationTargetException
- Creates a RepositoryModel
if one is not instantiated. If one already
exists, it is returned to the caller.
Supported access modes are multiple read access (with no
writers) or single write access. Currently, network
repositories are READ_ONLY.
This method accepts a String object containing a URL which
specifies a repository.
Below are the repository types currently supported by the
Bean Management subsystem and the URL syntax used to
specify them:
- DirectoryRepositoryModel -
beans.directory:[drive_letter:]/<path>
For example:
beans.directory:/f:/this/is/a/path/to/a/DirectoryRepository
- JarRepositoryModel -
beans.jar:[drive_letter:]/<path>/<filename>.jar
For example:
beans.jar:/this/is/a/path/to/a/JarRepository.jar
- ZipRepositoryModel -
beans.zip:[drive_letter:]/<path>/<filename>.zip
For example:
beans.zip:/C:/this/is/a/path/to/a/ZipRepository.zip
- NetRepositoryModel -
beans.net://<hostname[:port]>/<servername>/[<item-key>]
For example:
beans.net://repoman.ibm.com/myServer/myClass.class
to specify a repository by class name, or
beans.net://repoman.ibm.com/myServer/CA2718A8128B3141C1618D0618E0496F
to specify a repository by warehouse item id. The hostname or
servername value may be an asterisk "*", in which case a locally
configured default value will be used. See the section on Network Deployment
in the Guide To Features for more details.
- Parameters:
- url - The location of this repository.
- mode - READ_ONLY, WRITE_ONLY, or READ_WRITE.
- Returns:
- The requested RepositoryModel, or null if the create request
is denied. For instance, null is returned if a WRITE_ONLY
request is made on a repository that is already accessed READ_ONLY.
- Throws: NoSuchMethodException
- Thrown if an error occurs while constructing
the repository access object.
- Throws: InstantiationException
- Thrown if an error occurs while building
the RepositoryModel.
- Throws: IllegalAccessException
- Thrown if an error occurs while building
the RepositoryModel.
- Throws: MalformedURLException
- Thrown if the repository name is incorrectly
formatted.
- Throws: InvocationTargetException
- Thrown if an error occurs while building
the RepositoryModel.
- See Also:
- RepositoryModel, URL
createRepositoryModel
public static synchronized RepositoryModel createRepositoryModel(Class c,
String name,
int mode) throws NoSuchMethodException, InstantiationException, IllegalAccessException, MalformedURLException, InvocationTargetException
- Creates a RepositoryModel
if one is not instantiated. If one already
exists, it is returned to the caller.
Supported access modes are multiple read access (with no
writers) or single write access.
This is the original interface and does not provide the capability of
creating network repositories or using URL syntax to specify a
repository.
- Parameters:
- c - The RepositoryModel class to use to access this RepositoryModel.
This should always be null.
- name - The location of this repository, typically the location of
a directory or a JAR file in the file system.
- mode - READ_ONLY, WRITE_ONLY, or READ_WRITE.
- Returns:
- The requested RepositoryModel or null if the create request
is denied. For instance, null is returned if a WRITE_ONLY
request is made on a repository that is already accessed READ_ONLY.
- Throws: NoSuchMethodException
- Thrown if an error occurs while constructing
the repository access object.
- Throws: InstantiationException
- Thrown if an error occurs while building
the RepositoryModel.
- Throws: IllegalAccessException
- Thrown if an error occurs while building
the RepositoryModel.
- Throws: MalformedURLException
- Thrown if the repository name is incorrectly
formatted.
- Throws: InvocationTargetException
- Thrown if an error occurs while building
the RepositoryModel.
- See Also:
- RepositoryModel
destroyRepositoryModel
public static synchronized void destroyRepositoryModel(RepositoryModel r)
- Destroys a RepositoryModel once the user is finished with it.
In actuality, the RepositoryModel reference count is decremented.
The RepositoryModel is removed from the RepositoryModelFactory
hash table when the reference count reaches zero.
- Parameters:
- r - The RepositoryModel to be destroyed.
- See Also:
- RepositoryModel
convertFilenameToURL
public static String convertFilenameToURL(String name)
- Converts a repository file name to a URL name.
- Parameters:
- name - The repository file name. For example:
"..\\myRepos\\buttons.jar"
- Returns:
- The URL form of the name. For example:
"beans.jar:/F:\\myStuff\\myRepos\\buttons.jar"
convertNameIntoCanonicalName
protected static String convertNameIntoCanonicalName(String name)
- Converts a repository name into canonical form.
- Parameters:
- name - The repository name. For example:
"..\\myRepos\\buttons.jar"
- Returns:
- The canonical form of the name. For example:
"F:\\myStuff\\myRepos\\buttons.jar"
All Packages Class Hierarchy This Package Previous Next Index