Implementation of a Valve that limits concurrency.
This Valve may be attached to any Container, depending on the granularity of the concurrency control you wish to perform. Note that internally, some async requests may require multiple serial requests to complete what - to the user - appears as a single request.
| Modifier and Type | Field and Description |
|---|---|
| protected boolean | block
Block until a permit is available. |
| protected int | concurrency
Concurrency level of the semaphore. |
| protected boolean | fairness
Fairness of the semaphore. |
| protected boolean | interruptible
Block interruptibly until a permit is available. |
| protected Semaphore | semaphore
Semaphore. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if the concurrency control should occur on this requestThe Servlet request request, Response The Servlet response response)Subclass friendly method to add conditions. |
| public boolean | |
| public int | |
| public boolean | |
| public boolean | |
| public void | invoke(Request
The servlet request to be processed request, Response The servlet response to be created response)Implements org. Do concurrency control on the request using the semaphore. |
| public void | permitDenied(Request
The Servlet request request, Response The Servlet response response)Subclass friendly method to add error handling when a permit isn't granted. |
| public void | |
| public void | |
| public void | |
| public void | |
| protected void | startInternal()
Overrides org. Start this component and implement the requirements of
|
| protected void | stopInternal()
Overrides org. Stop this component and implement the requirements of
|
| block | back to summary |
|---|---|
| protected boolean block Block until a permit is available. | |
| concurrency | back to summary |
|---|---|
| protected int concurrency Concurrency level of the semaphore. | |
| fairness | back to summary |
|---|---|
| protected boolean fairness Fairness of the semaphore. | |
| interruptible | back to summary |
|---|---|
| protected boolean interruptible Block interruptibly until a permit is available. | |
| semaphore | back to summary |
|---|---|
| protected Semaphore semaphore Semaphore. | |
| SemaphoreValve | back to summary |
|---|---|
| public SemaphoreValve() | |
| controlConcurrency | back to summary |
|---|---|
| public boolean controlConcurrency(Request request, Response response) Subclass friendly method to add conditions. | |
| getBlock | back to summary |
|---|---|
| public boolean getBlock() | |
| getConcurrency | back to summary |
|---|---|
| public int getConcurrency() | |
| getFairness | back to summary |
|---|---|
| public boolean getFairness() | |
| getInterruptible | back to summary |
|---|---|
| public boolean getInterruptible() | |
| invoke | back to summary |
|---|---|
| public void invoke(Request request, Response response) throws IOException, ServletException Implements org. Do concurrency control on the request using the semaphore.
| |
| permitDenied | back to summary |
|---|---|
| public void permitDenied(Request request, Response response) throws IOException, ServletException Subclass friendly method to add error handling when a permit isn't granted.
| |
| setBlock | back to summary |
|---|---|
| public void setBlock(boolean block) | |
| setConcurrency | back to summary |
|---|---|
| public void setConcurrency(int concurrency) | |
| setFairness | back to summary |
|---|---|
| public void setFairness(boolean fairness) | |
| setInterruptible | back to summary |
|---|---|
| public void setInterruptible(boolean interruptible) | |
| startInternal | back to summary |
|---|---|
| protected void startInternal() throws LifecycleException Overrides org. Start this component and implement the requirements of
| |
| stopInternal | back to summary |
|---|---|
| protected void stopInternal() throws LifecycleException Overrides org. Stop this component and implement the requirements of
| |