From: David H. <dhu...@us...> - 2010-12-02 17:17:34
|
Update of /cvsroot/jrobin/src/org/jrobin/core In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv30067/src/org/jrobin/core Modified Files: RrdBackend.java RrdBackendFactory.java RrdMemoryBackend.java RrdMemoryBackendFactory.java Log Message: ByteBuffer Backend Factory. Index: RrdBackend.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/core/RrdBackend.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** RrdBackend.java 21 Dec 2006 18:02:41 -0000 1.11 --- RrdBackend.java 2 Dec 2010 17:17:25 -0000 1.12 *************** *** 132,137 **** /** * Closes the underlying backend. ! * ! * @throws IOException Thrown in case of I/O error */ public void close() throws IOException { --- 132,136 ---- /** * Closes the underlying backend. ! * @throws IOException */ public void close() throws IOException { *************** *** 189,192 **** --- 188,192 ---- } write(offset, image); + image = null; } *************** *** 206,209 **** --- 206,210 ---- } write(offset, image); + image = null; } *************** *** 250,253 **** --- 251,255 ---- values[i] = getDouble(b); } + image = null; return values; } Index: RrdMemoryBackend.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/core/RrdMemoryBackend.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** RrdMemoryBackend.java 21 Dec 2006 18:02:41 -0000 1.6 --- RrdMemoryBackend.java 2 Dec 2010 17:17:25 -0000 1.7 *************** *** 38,42 **** } ! protected synchronized void write(long offset, byte[] b) throws IOException { int pos = (int) offset; for (byte singleByte : b) { --- 38,42 ---- } ! protected synchronized void write(long offset, byte[] b) { int pos = (int) offset; for (byte singleByte : b) { Index: RrdMemoryBackendFactory.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/core/RrdMemoryBackendFactory.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** RrdMemoryBackendFactory.java 21 Dec 2006 18:02:41 -0000 1.4 --- RrdMemoryBackendFactory.java 2 Dec 2010 17:17:25 -0000 1.5 *************** *** 26,30 **** package org.jrobin.core; - import java.io.IOException; import java.util.HashMap; --- 26,29 ---- *************** *** 53,60 **** * @param readOnly This parameter is ignored * @return RrdMemoryBackend object which handles all I/O operations - * @throws IOException Thrown in case of I/O error. */ ! protected synchronized RrdBackend open(String id, boolean readOnly) ! throws IOException { RrdMemoryBackend backend; if (backends.containsKey(id)) { --- 52,57 ---- * @param readOnly This parameter is ignored * @return RrdMemoryBackend object which handles all I/O operations */ ! protected synchronized RrdBackend open(String id, boolean readOnly) { RrdMemoryBackend backend; if (backends.containsKey(id)) { *************** *** 89,95 **** return true; } ! else { ! return false; ! } } --- 86,90 ---- return true; } ! return false; } Index: RrdBackendFactory.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/core/RrdBackendFactory.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** RrdBackendFactory.java 21 Dec 2006 18:02:41 -0000 1.10 --- RrdBackendFactory.java 2 Dec 2010 17:17:25 -0000 1.11 *************** *** 82,85 **** --- 82,87 ---- RrdSafeFileBackendFactory safeFactory = new RrdSafeFileBackendFactory(); registerFactory(safeFactory); + RrdNioByteBufferBackendFactory nioByteBufferFactory = new RrdNioByteBufferBackendFactory(); + registerFactory(nioByteBufferFactory); selectDefaultFactory(); } *************** *** 90,101 **** private static void selectDefaultFactory() throws RrdException { ! String version = System.getProperty("java.version"); ! if (version == null || version.startsWith("1.3.") || ! version.startsWith("1.4.0") || version.startsWith("1.4.1")) { ! setDefaultFactory("FILE"); ! } ! else { ! setDefaultFactory("NIO"); ! } } --- 92,96 ---- private static void selectDefaultFactory() throws RrdException { ! setDefaultFactory("FILE"); } *************** *** 125,131 **** return factory; } ! else { ! throw new RrdException("No backend factory found with the name specified [" + name + "]"); ! } } --- 120,124 ---- return factory; } ! throw new RrdException("No backend factory found with the name specified [" + name + "]"); } |