Class SemaphoreHolder
- java.lang.Object
-
- com.atlassian.confluence.impl.search.contentnames.SemaphoreHolder
-
public class SemaphoreHolder extends Object
Holds the semaphore used to enforce a limit on the number of simultaneous quick nav searches. The purpose of this holder is to front the actual semaphore that does all the work. We need a front so as to have the ability to swap in another semaphore when the user decides to change the default limit. This is because we cannot increase the number of permits on the JDKSemaphore
class.
-
-
Constructor Summary
Constructors Constructor Description SemaphoreHolder(SettingsManager settingsManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Semaphore
getSemaphore()
Returns the semaphore held.void
refreshSemaphore()
Update the underlying semaphore to the size ofSettings.maxSimultaneousQuickNavRequests
.
-
-
-
Constructor Detail
-
SemaphoreHolder
public SemaphoreHolder(SettingsManager settingsManager)
-
-
Method Detail
-
getSemaphore
public Semaphore getSemaphore()
Returns the semaphore held. Clients should call this for each attempt at acquiring a permit (so as to get the latest one configured for this instance of Confluence).- Returns:
- the underlying semaphore.
-
refreshSemaphore
public void refreshSemaphore()
Update the underlying semaphore to the size ofSettings.maxSimultaneousQuickNavRequests
.
-
-