Package com.jcabi.github.mock
Class MkStorage.Synced
- java.lang.Object
-
- com.jcabi.github.mock.MkStorage.Synced
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.jcabi.github.mock.MkStorage
MkStorage.InFile, MkStorage.Synced
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapply(Iterable<org.xembly.Directive> dirs)Update XML with this directives.voidlock()Locks storage to the current thread.StringtoString()voidunlock()Unlock storage.com.jcabi.xml.XMLxml()Get full XML.
-
-
-
Constructor Detail
-
Synced
public Synced(MkStorage storage)
Public ctor.- Parameters:
storage- Original
-
-
Method Detail
-
xml
public com.jcabi.xml.XML xml() throws IOExceptionDescription 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
public void apply(Iterable<org.xembly.Directive> dirs) throws IOException
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.
-
-