@Contract
public interface ConfigurationAccess
Modifier and Type | Method and Description |
---|---|
Lock |
accessRead()
Wait and return an read access
Lock to the configuration
elements. |
Lock |
accessWrite()
Wait and return an exclusive write access
Lock to the configuration
elements. |
Lock accessRead() throws IOException, TimeoutException
Lock
to the configuration
elements. Once the lock is returned, other threads can access
the configuration is read mode, but no thread can access it in
write mode.
The lock instance must be released in the same thread that
obtained it.IOException
- if the configuration cannot be accessed
due to a file access error.TimeoutException
- if the lock cannot be obtained
before the system defined time out runs out.Lock accessWrite() throws IOException, TimeoutException
Lock
to the configuration
elements. Once the lock is returned, no other thread can
access the configuration is read or write mode.
The lock instance must be released in the same thread that
obtained it.IOException
- if the configuration cannot be accessed
due to a file access error.TimeoutException
- if the lock cannot be obtained
before the system defined time out runs out.Copyright © 2020. All rights reserved.