Package com.jcabi.github.mock
Class MkStorage.InFile
java.lang.Object
com.jcabi.github.mock.MkStorage.InFile
- All Implemented Interfaces:
MkStorage
- Enclosing interface:
- MkStorage
@Immutable
@Loggable(1)
public static final class MkStorage.InFile
extends Object
implements MkStorage
In file.
- Since:
- 0.5
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.jcabi.github.mock.MkStorage
MkStorage.InFile, MkStorage.Synced -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
InFile
Public ctor.- Throws:
IOException- If there is any I/O problem
-
InFile
Public ctor.- Parameters:
file- File to use- Throws:
IOException- If there is any I/O problem
-
-
Method Details
-
toString
-
xml
Description copied from interface:MkStorageGet full XML.- Specified by:
xmlin interfaceMkStorage- Returns:
- XML
- Throws:
IOException- If there is any I/O problem, or if the current storage is locked by another thread.
-
apply
Description copied from interface:MkStorageUpdate XML with this directives.- Specified by:
applyin interfaceMkStorage- Parameters:
dirs- Directives- Throws:
IOException- If there is any I/O problem, or if the current storage is locked by another thread.
-
lock
public void lock()Description copied from interface:MkStorageLocks storage to the current thread.If the lock is available, grant it to the calling thread and block all operations from other threads. If not available, wait for the holder of the lock to release it with
MkStorage.unlock()before any other operations can be performed.Locking behavior is reentrant, which means a thread can invoke
MkStorage.lock()multiple times, where a hold count is maintained. -
unlock
public void unlock()Description copied from interface:MkStorageUnlock storage.Locking behavior is reentrant, thus if the thread invoked
MkStorage.lock()multiple times, the hold count is decremented. If the hold count reaches 0, the lock is released.If the current thread does not hold the lock, an
IllegalMonitorStateExceptionwill be thrown.
-