Package com.jcabi.github.mock
Interface MkStorage
- All Known Implementing Classes:
MkStorage.InFile,MkStorage.Synced
@Immutable
public interface MkStorage
Storage of GitHub data.
- Since:
- 0.5
- Suppressed Checkstyle violations:
- MultipleStringLiteralsCheck (200 lines)
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classIn file.static final classSynchronized. -
Method Summary
-
Method Details
-
xml
Get full XML.- Returns:
- XML
- Throws:
IOException- If there is any I/O problem, or if the current storage is locked by another thread.
-
apply
Update XML with this directives.- Parameters:
dirs- Directives- Throws:
IOException- If there is any I/O problem, or if the current storage is locked by another thread.
-
lock
void lock()Locks 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
unlock()before any other operations can be performed.Locking behavior is reentrant, which means a thread can invoke
lock()multiple times, where a hold count is maintained. -
unlock
void unlock()Unlock storage.Locking behavior is reentrant, thus if the thread invoked
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.
-