|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.catalina.valves.ValveBase
org.apache.catalina.valves.SemaphoreValve
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.
Field Summary | |
protected int |
concurrency
Concurrency level of the semaphore. |
protected boolean |
fairness
Fairness of the semaphore. |
protected LifecycleSupport |
lifecycle
The lifecycle event support for this component. |
protected Semaphore |
semaphore
Semaphore. |
Fields inherited from class org.apache.catalina.valves.ValveBase |
container, containerLog, controller, domain, mserver, next, oname |
Fields inherited from interface org.apache.catalina.Lifecycle |
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, DESTROY_EVENT, INIT_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT |
Constructor Summary | |
SemaphoreValve()
|
Method Summary | |
void |
addLifecycleListener(LifecycleListener listener)
Add a lifecycle event listener to this component. |
LifecycleListener[] |
findLifecycleListeners()
Get the lifecycle listeners associated with this lifecycle. |
int |
getConcurrency()
|
boolean |
getFairness()
|
java.lang.String |
getInfo()
Return descriptive information about this Valve implementation. |
void |
invoke(Request request,
Response response)
Do concurrency control on the request using the semaphore. |
void |
removeLifecycleListener(LifecycleListener listener)
Remove a lifecycle event listener from this component. |
void |
setConcurrency(int concurrency)
|
void |
setFairness(boolean fairness)
|
void |
start()
Prepare for the beginning of active use of the public methods of this component. |
void |
stop()
Gracefully terminate the active use of the public methods of this component. |
Methods inherited from class org.apache.catalina.valves.ValveBase |
backgroundProcess, createObjectName, getContainer, getContainerName, getController, getDomain, getNext, getObjectName, getParentName, postDeregister, postRegister, preDeregister, preRegister, setContainer, setController, setNext, setObjectName, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Semaphore semaphore
protected LifecycleSupport lifecycle
protected int concurrency
protected boolean fairness
Constructor Detail |
public SemaphoreValve()
Method Detail |
public int getConcurrency()
public void setConcurrency(int concurrency)
public boolean getFairness()
public void setFairness(boolean fairness)
public void addLifecycleListener(LifecycleListener listener)
addLifecycleListener
in interface Lifecycle
listener
- The listener to addpublic LifecycleListener[] findLifecycleListeners()
findLifecycleListeners
in interface Lifecycle
public void removeLifecycleListener(LifecycleListener listener)
removeLifecycleListener
in interface Lifecycle
listener
- The listener to addpublic void start() throws LifecycleException
configure()
,
and before any of the public methods of the component are utilized.
start
in interface Lifecycle
LifecycleException
- if this component detects a fatal error
that prevents this component from being usedpublic void stop() throws LifecycleException
stop
in interface Lifecycle
LifecycleException
- if this component detects a fatal error
that needs to be reportedpublic java.lang.String getInfo()
getInfo
in interface Valve
getInfo
in class ValveBase
public void invoke(Request request, Response response) throws java.io.IOException, javax.servlet.ServletException
invoke
in interface Valve
invoke
in class ValveBase
request
- The servlet request to be processedresponse
- The servlet response to be created
java.io.IOException
- if an input/output error occurs
javax.servlet.ServletException
- if a servlet error occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |