use of org.ovirt.engine.core.common.businessentities.storage.ImageFileType in project ovirt-engine by oVirt.
the class IsoDomainListSynchronizer method getSyncObject.
/**
* Maintain a <code>ConcurrentMap</code> which contains <code>Lock</code> object.<BR/>
* The key Object is a <code>Pair</code> object, which will represent the domain and the file type.<BR/>
* If no synchronized object found, the <code>Lock</code> will be add to the <code>ConcurrentMap</code>.
*
* @param domainId
* - The domain Id that supposed to be refreshed.
* @param imageType
* - The file type supposed to be refreshed.
* @return - The Lock object, which represent the domain and the file type, to lock.
*/
private Lock getSyncObject(Guid domainId, ImageFileType imageType) {
Pair<Guid, ImageFileType> domainPerFileType = new Pair<>(domainId, imageType);
syncDomainForFileTypeMap.putIfAbsent(domainPerFileType, new ReentrantLock());
return syncDomainForFileTypeMap.get(domainPerFileType);
}
Aggregations