You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2012/09/05 19:51:50 UTC
svn commit: r1381268 -
/jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/file/ChannelManager.java
Author: andy
Date: Wed Sep 5 17:51:49 2012
New Revision: 1381268
URL: http://svn.apache.org/viewvc?rev=1381268&view=rev
Log:
More ways to expel cached info.
Modified:
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/file/ChannelManager.java
Modified: jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/file/ChannelManager.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/file/ChannelManager.java?rev=1381268&r1=1381267&r2=1381268&view=diff
==============================================================================
--- jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/file/ChannelManager.java (original)
+++ jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/file/ChannelManager.java Wed Sep 5 17:51:49 2012
@@ -82,6 +82,13 @@ public class ChannelManager
} catch (IOException ex) { throw new FileException("Failed to open: "+filename+" (mode="+mode+")", ex) ; }
}
+ public static void release(String filename)
+ {
+ FileChannel channel = name2channel.get(filename) ;
+ if ( channel != null )
+ release(channel) ;
+ }
+
public static void release(FileChannel chan)
{
// Always close even if not managed.
@@ -93,11 +100,11 @@ public class ChannelManager
public static void reset()
{
- shutdown(null) ;
+ releaseAll(null) ;
}
/** Shutdown all the files matching the prefix (typically a directory) */
- public static void shutdown(String prefix)
+ public static void releaseAll(String prefix)
{
// Use an iterator explicitly so we can remove from the map.
List<FileChannel> x = new ArrayList<FileChannel>() ;