Package org.jrobin.core
Class RrdNioBackendFactory
- java.lang.Object
-
- org.jrobin.core.RrdBackendFactory
-
- org.jrobin.core.RrdFileBackendFactory
-
- org.jrobin.core.RrdNioBackendFactory
-
public class RrdNioBackendFactory extends RrdFileBackendFactory
Factory class which creates actualRrdNioBackend
objects. This is the default factory since 1.4.0 version
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_SYNC_PERIOD
Period in seconds between consecutive synchronizations when sync-mode is set to SYNC_BACKGROUND.static String
NAME
factory name, "NIO"
-
Constructor Summary
Constructors Constructor Description RrdNioBackendFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
finalize()
String
getFactoryName()
Returns the name of this factory.(package private) SyncManager
getSyncManager()
static int
getSyncPeriod()
Returns time between two consecutive background synchronizations.protected RrdBackend
open(String path, boolean readOnly)
Creates RrdNioBackend object for the given file path.static void
setSyncPeriod(int syncPeriod)
Sets time between consecutive background synchronizations.void
shutdown()
-
Methods inherited from class org.jrobin.core.RrdFileBackendFactory
exists
-
Methods inherited from class org.jrobin.core.RrdBackendFactory
getDefaultFactory, getFactory, isInstanceCreated, registerAndSetAsDefaultFactory, registerFactory, setDefaultFactory, toString
-
-
-
-
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 viasetSyncPeriod(int)
method.- See Also:
- Constant Field Values
-
NAME
public static final String NAME
factory name, "NIO"- See Also:
- Constant Field Values
-
-
Method Detail
-
getSyncPeriod
public static int getSyncPeriod()
Returns time between two consecutive background synchronizations. If not changed viasetSyncPeriod(int)
method call, defaults toDEFAULT_SYNC_PERIOD
. SeesetSyncPeriod(int)
for more information.- Returns:
- Time in seconds between consecutive background synchronizations.
-
setSyncPeriod
public static void setSyncPeriod(int syncPeriod)
Sets time between consecutive background synchronizations.- Parameters:
syncPeriod
- Time in seconds between consecutive background synchronizations.
-
open
protected RrdBackend open(String path, boolean readOnly) throws IOException
Creates RrdNioBackend object for the given file path.- Overrides:
open
in classRrdFileBackendFactory
- Parameters:
path
- File pathreadOnly
- 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.
-
shutdown
public void shutdown()
-
getFactoryName
public String getFactoryName()
Returns the name of this factory.- Overrides:
getFactoryName
in classRrdFileBackendFactory
- Returns:
- Factory name (equals to string "NIO")
-
finalize
protected void finalize() throws Throwable
-
getSyncManager
SyncManager getSyncManager()
-
-