From: Sasa M. <sa...@us...> - 2004-05-20 14:49:54
|
Update of /cvsroot/jrobin/src/org/jrobin/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25847/org/jrobin/core Modified Files: RrdBackendFactory.java RrdFileBackendFactory.java RrdMemoryBackendFactory.java Log Message: Minor fine-tunnig of the new core package. Index: RrdFileBackendFactory.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/core/RrdFileBackendFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RrdFileBackendFactory.java 20 May 2004 10:34:00 -0000 1.1 --- RrdFileBackendFactory.java 20 May 2004 14:49:29 -0000 1.2 *************** *** 61,73 **** /** - * Removes the file from the disk. - * @param path File path - * @return True, if the file is deleted, false otherwise. - */ - protected boolean delete(String path) { - return new File(path).delete(); - } - - /** * Returns the name of this factory. * @return Factory name (equals to string "FILE") --- 61,64 ---- Index: RrdMemoryBackendFactory.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/core/RrdMemoryBackendFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RrdMemoryBackendFactory.java 20 May 2004 10:34:00 -0000 1.1 --- RrdMemoryBackendFactory.java 20 May 2004 14:49:29 -0000 1.2 *************** *** 30,34 **** /** ! * Factory class which creates actual {@link RrdMemoryBackend} objects. */ public class RrdMemoryBackendFactory extends RrdBackendFactory { --- 30,41 ---- /** ! * Factory class which creates actual {@link RrdMemoryBackend} objects. JRobin's support ! * for in-memory RRDs is still experimental. You should know that all active RrdMemoryBackend ! * objects are held in memory, each backend object stores RRD data in one big byte array. This ! * implementation is therefore quite basic and memory hungry but runs very fast.<p> ! * ! * Calling {@link RrdDb#close() close()} on RrdDb objects does not release any memory at all ! * (RRD data must be available for the next <code>new RrdDb(path)</code> call. To release allocated ! * memory, you'll have to call {@link #delete(java.lang.String) delete(path)} method of this class.<p> */ public class RrdMemoryBackendFactory extends RrdBackendFactory { *************** *** 73,77 **** * @return True, if the storage with the given ID is deleted, false otherwise. */ ! protected boolean delete(String id) { if(backends.containsKey(id)) { backends.remove(id); --- 80,84 ---- * @return True, if the storage with the given ID is deleted, false otherwise. */ ! public boolean delete(String id) { if(backends.containsKey(id)) { backends.remove(id); Index: RrdBackendFactory.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/core/RrdBackendFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RrdBackendFactory.java 20 May 2004 10:34:00 -0000 1.1 --- RrdBackendFactory.java 20 May 2004 14:49:29 -0000 1.2 *************** *** 142,146 **** * @throws IOException Thrown in case of I/O error. */ ! protected abstract RrdBackend open(String path, boolean readOnly, int lockMode) throws IOException; /** --- 142,147 ---- * @throws IOException Thrown in case of I/O error. */ ! protected abstract RrdBackend open(String path, boolean readOnly, int lockMode) ! throws IOException; /** *************** *** 149,162 **** * @return True, if such storage exists, false otherwise. */ ! protected abstract boolean exists(String path); ! ! /** ! * Releases all system resources associated with the storage with the given path. ! * If the storage represents a file on the disk, the file will be removed. ! * If the storage represents a section in memory, the memory will be released. ! * @param path Storage path ! * @return true, if all resources are released without a problem, false otherwise. ! */ ! protected abstract boolean delete(String path); /** --- 150,154 ---- * @return True, if such storage exists, false otherwise. */ ! protected abstract boolean exists(String path) throws IOException; /** |