Servertec
Persistent Object Store
1.4.1 09/04/2005

stec.pos
Class VirtualFileHandleManager

java.lang.Object
  extended by stec.pos.VirtualFileHandleManager

public final class VirtualFileHandleManager
extends java.lang.Object

Manages a pool of virtual file handles mapped to a pool of real file handles.

Virtual file handles allow Servertec Persistent Object Store to open a larger number of files than the native operating system allow sby mapping a pool of virtual file handles ot a limited number of real file handles.

Since:
1.2.0 12/03/2002
See Also:
VirtualFileHandle

Constructor Summary
VirtualFileHandleManager()
           
 
Method Summary
static int getMaximumRealFileHandles()
          Returns the maximum number of real file handles.
static int getMaximumVirtualFileHandles()
          Returns the maximum number of virtual file handles.
static int getRealFileHandleCount()
          Returns the number of real file handles.
static int getVirtualFileHandleCount()
          Returns the number of virtual file handles.
static void setMaximumRealFileHandles(int _maximum_real_file_handles)
          Sets the maximum number of real file handles.
static void setMaximumVirtualFileHandles(int _maximum_virtual_file_handles)
          Sets the maximum number of virtual file handles.
static boolean useBlocking()
          Returns whether blocking is enabled.
static void useBlocking(boolean _use_blocking)
          Sets whether blocking is to be used.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VirtualFileHandleManager

public VirtualFileHandleManager()
Method Detail

useBlocking

public static final boolean useBlocking()
Returns whether blocking is enabled.

Returns:
whether blocking is enabled.

useBlocking

public static final void useBlocking(boolean _use_blocking)
                              throws java.lang.IllegalStateException
Sets whether blocking is to be used.

Blocking can be used when waiting for a file handle to become available.

If not enabled TooManyOpenFilesException is thrown.

Parameters:
use_blocking - whether blocking is to be used.
Throws:
java.lang.IllegalStateException - if in use.
See Also:
TooManyOpenFilesException

getMaximumRealFileHandles

public static final int getMaximumRealFileHandles()
Returns the maximum number of real file handles.

Returns:
the maximum number of real file handles. -1 for unlimited.

setMaximumRealFileHandles

public static final void setMaximumRealFileHandles(int _maximum_real_file_handles)
                                            throws java.lang.IllegalStateException,
                                                   java.lang.IllegalArgumentException
Sets the maximum number of real file handles.

Parameters:
maximum_real_file_handles - the maximum number of real file handles. -1 for unlimited. Defaults to -1.
Throws:
java.lang.IllegalStateException - if in use.
java.lang.IllegalArgumentException - if maximum_real_file_handles is less than one (1).

getMaximumVirtualFileHandles

public static final int getMaximumVirtualFileHandles()
Returns the maximum number of virtual file handles.

Returns:
the maximum number of real virtual handles. -1 for unlimited.

setMaximumVirtualFileHandles

public static final void setMaximumVirtualFileHandles(int _maximum_virtual_file_handles)
                                               throws java.lang.IllegalStateException,
                                                      java.lang.IllegalArgumentException
Sets the maximum number of virtual file handles.

Parameters:
maximum_virtual - _file_handles the maximum number of virtual file handles. -1 for unlimited. Defaults to -1.
Throws:
java.lang.IllegalStateException - if in use.
java.lang.IllegalArgumentException - if maximum_virtual _file_handles is less than one (1).

getRealFileHandleCount

public static final int getRealFileHandleCount()
Returns the number of real file handles.

Returns:
the number of real file handles.

getVirtualFileHandleCount

public static final int getVirtualFileHandleCount()
Returns the number of virtual file handles.

Returns:
the number of virtual file handles.

Servertec
Persistent Object Store
1.4.1 09/04/2005

Copyright © 2001-2005 Servertec. All rights reserved.