Berkeley DB
version 4.2.52

com.sleepycat.bdb
Class StoredClassCatalog

java.lang.Object
  |
  +--com.sleepycat.bdb.StoredClassCatalog
All Implemented Interfaces:
ClassCatalog

public class StoredClassCatalog
extends Object
implements ClassCatalog

Java serialization catalog used for compact storage of database objects.


Constructor Summary
StoredClassCatalog(DbEnv env, String file, String database, int openFlags)
          Open a catalog database.
 
Method Summary
 void close()
          Close a catalog database and release any cached resources.
 ObjectStreamClass getClassFormat(byte[] classID)
          Return the ObjectStreamClass for the given class ID.
 ObjectStreamClass getClassFormat(String className)
          Return the ObjectStreamClass for the given class name.
 byte[] getClassID(String className)
          Return the class ID for the current version of the given class name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StoredClassCatalog

public StoredClassCatalog(DbEnv env,
                          String file,
                          String database,
                          int openFlags)
                   throws FileNotFoundException,
                          DbException
Open a catalog database. To save resources, only a single catalog object should be used for each unique catalog file.

Parameters:
env - is the environment in which to open the catalog.
file - is the name of the catalog file.
database - the database name to be used within the specified store. If null then the filename is the database name.
openFlags - Flags for calling Db.open such as Db.DB_CREATE and Db.DB_AUTO_COMMIT.
Method Detail

close

public void close()
           throws IOException
Description copied from interface: ClassCatalog
Close a catalog database and release any cached resources.

Specified by:
close in interface ClassCatalog
IOException

getClassID

public byte[] getClassID(String className)
                  throws IOException,
                         ClassNotFoundException
Description copied from interface: ClassCatalog
Return the class ID for the current version of the given class name. This is used for storing in serialization streams in place of a full class descriptor, since it is much more compact. To get back the ObjectStreamClass for a class ID, call ClassCatalog.getClassFormat(byte[]). This function causes a new class ID to be assigned if the class description has changed.

Specified by:
getClassID in interface ClassCatalog
Parameters:
className - The fully qualified class name for which to return the class ID.
Returns:
The class ID for the current version of the class.
IOException
ClassNotFoundException

getClassFormat

public ObjectStreamClass getClassFormat(String className)
                                 throws IOException,
                                        ClassNotFoundException
Description copied from interface: ClassCatalog
Return the ObjectStreamClass for the given class name. This is always the current class format. Calling this method is equivalent to calling java.io.ObjectStreamClass.lookup, but this method causes a new class ID to be assigned if the class description has changed.

Specified by:
getClassFormat in interface ClassCatalog
Parameters:
className - The fully qualified class name for which to return the class format.
Returns:
The class format for the current version of the class.
IOException
ClassNotFoundException

getClassFormat

public ObjectStreamClass getClassFormat(byte[] classID)
                                 throws IOException,
                                        ClassNotFoundException
Description copied from interface: ClassCatalog
Return the ObjectStreamClass for the given class ID. This may or may not be the current class format, depending on whether the class has changed since the class ID was generated.

Specified by:
getClassFormat in interface ClassCatalog
Parameters:
classID - The class ID for which to return the class format.
Returns:
The class format for the given class ID, which may or may not represent the current version of the class.
IOException
ClassNotFoundException

Berkeley DB
version 4.2.52

Copyright (c) 1996-2003 Sleepycat Software, Inc. - All rights reserved.