Main Page | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Related Pages

NullClassCatalog.java

00001 /*-
00002  * See the file LICENSE for redistribution information.
00003  *
00004  * Copyright (c) 2002-2005
00005  *      Sleepycat Software.  All rights reserved.
00006  *
00007  * $Id: NullClassCatalog.java,v 12.1 2005/01/31 19:27:35 mark Exp $
00008  */
00009 
00010 package com.sleepycat.bind.serial.test;
00011 
00012 import java.io.ObjectStreamClass;
00013 import java.math.BigInteger;
00014 
00015 import com.sleepycat.db.DatabaseException;
00016 import com.sleepycat.bind.serial.ClassCatalog;
00017 
00025 class NullClassCatalog implements ClassCatalog {
00026 
00027     private long id = Long.MAX_VALUE;
00028 
00029     public void close()
00030         throws DatabaseException {
00031     }
00032 
00033     public byte[] getClassID(ObjectStreamClass classFormat)
00034         throws DatabaseException {
00035 
00036         return BigInteger.valueOf(id--).toByteArray();
00037     }
00038 
00039     public ObjectStreamClass getClassFormat(byte[] classID)
00040         throws DatabaseException, ClassNotFoundException {
00041 
00042         return null; // ObjectInput not supported
00043     }
00044 }

Generated on Sun Dec 25 12:14:53 2005 for Berkeley DB 4.4.16 by  doxygen 1.4.2