org.jrobin.core

Class RrdNioBackendFactory

public class RrdNioBackendFactory extends RrdFileBackendFactory

Factory class which creates actual RrdNioBackend objects. This is the default factory since 1.4.0 version
Field Summary
static intDEFAULT_SYNC_PERIOD
Period in seconds between consecutive synchronizations when sync-mode is set to SYNC_BACKGROUND.
static StringNAME
factory name, "NIO"
Method Summary
StringgetFactoryName()
Returns the name of this factory.
static intgetSyncPeriod()
Returns time between two consecutive background synchronizations.
protected RrdBackendopen(String path, boolean readOnly)
Creates RrdNioBackend object for the given file path.
static voidsetSyncPeriod(int syncPeriod)
Sets time between consecutive background synchronizations.

Field Detail

DEFAULT_SYNC_PERIOD

public static final int DEFAULT_SYNC_PERIOD
Period in seconds between consecutive synchronizations when sync-mode is set to SYNC_BACKGROUND. By default in-memory cache will be transferred to the disc every 300 seconds (5 minutes). Default value can be changed via RrdNioBackendFactory method.

NAME

public static final String NAME
factory name, "NIO"

Method Detail

getFactoryName

public String getFactoryName()
Returns the name of this factory.

Returns: Factory name (equals to string "NIO")

getSyncPeriod

public static int getSyncPeriod()
Returns time between two consecutive background synchronizations. If not changed via RrdNioBackendFactory method call, defaults to DEFAULT_SYNC_PERIOD. See RrdNioBackendFactory for more information.

Returns: Time in seconds between consecutive background synchronizations.

open

protected RrdBackend open(String path, boolean readOnly)
Creates RrdNioBackend object for the given file path.

Parameters: path File path readOnly True, if the file should be accessed in read/only mode. False otherwise.

Returns: RrdNioBackend object which handles all I/O operations for the given file path

Throws: IOException Thrown in case of I/O error.

setSyncPeriod

public static void setSyncPeriod(int syncPeriod)
Sets time between consecutive background synchronizations.

Parameters: syncPeriod Time in seconds between consecutive background synchronizations.