ClassCatalogpublic class StoredClassCatalog extends java.lang.Object implements ClassCatalog
ClassCatalog that is stored in a Database.
A single StoredClassCatalog object is normally used along
with a set of databases that stored serialized objects.
| Constructor | Description |
|---|---|
StoredClassCatalog(Database database) |
Creates a catalog based on a given database.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
Close a catalog database and release any cached resources.
|
java.io.ObjectStreamClass |
getClassFormat(byte[] classID) |
Return the ObjectStreamClass for the given class ID.
|
byte[] |
getClassID(java.io.ObjectStreamClass classFormat) |
Return the class ID for the current version of the given class
description.
|
java.lang.ClassLoader |
getClassLoader() |
For BDB JE, returns the ClassLoader property of the catalog database
environment.
|
public StoredClassCatalog(Database database) throws DatabaseException, java.lang.IllegalArgumentException
database - an open database to use as the class catalog. It must
be a BTREE database and must not allow duplicates.DatabaseException - if an error occurs accessing the database.java.lang.IllegalArgumentException - if the database is not a BTREE database
or if it configured to allow duplicates.public void close()
throws DatabaseException
ClassCatalogclose in interface ClassCatalogDatabaseException - if an error occurs closing the catalog
database.public byte[] getClassID(java.io.ObjectStreamClass classFormat)
throws DatabaseException,
java.lang.ClassNotFoundException
ClassCatalogClassCatalog.getClassFormat(byte[]).
This function causes a new class ID to be assigned if the class
description has changed.getClassID in interface ClassCatalogclassFormat - The class description for which to return the
class ID.DatabaseException - if an error occurs accessing the catalog
database.java.lang.ClassNotFoundException - if the class does not exist.public java.io.ObjectStreamClass getClassFormat(byte[] classID)
throws DatabaseException,
java.lang.ClassNotFoundException
ClassCataloggetClassFormat in interface ClassCatalogclassID - The class ID for which to return the class format.DatabaseException - if an error occurs accessing the catalog
database.java.lang.ClassNotFoundException - if the class does not exist.public java.lang.ClassLoader getClassLoader()
For BDB, this method returns null because no Environment ClassLoader property is available. This method may be overridden to return a ClassLoader.
getClassLoader in interface ClassCatalogCopyright (c) 1996, 2020 Oracle and/or its affiliates. All rights reserved.