|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.jira.web.monitor.watcher.RequestWatcher
public class RequestWatcher
This class will periodically monitor a map of active requests, and will tell you when one of those requests is overdue.
This class is thread-safe.
OverdueRequestListener| Constructor Summary | |
|---|---|
RequestWatcher(long overdueThreshold,
ActiveRequestsCallback callback)
Creates a new RequestWatcher. |
|
| Method Summary | |
|---|---|
void |
addOverdueRequestListener(OverdueRequestListener overdueRequestListener)
Adds an OverdueRequestListener to this instance's list of listeners. |
void |
close()
Frees any resources associated with this RequestWatcher. |
protected ScheduledExecutorService |
newSingleThreadExecutor()
Creates a new single-thread executor service. |
protected void |
notifyOverdueListeners(List<Request> overdue,
long overdueThreshold)
Notifies each registered listener that the given requests are overdue. |
void |
removeOverdueRequestListener(OverdueRequestListener overdueRequestListener)
Removes an OverdueRequestListener from this instance's list of listeners. |
void |
startWatching()
Starts watching the activeRequests for overdue requests. |
void |
stopWatching()
Stops watching the activeRequests map for overdue requests. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RequestWatcher(long overdueThreshold,
ActiveRequestsCallback callback)
overdueThreshold - the threshold beyond which a request is deemed overdue, in mscallback - a RequestCallback| Method Detail |
|---|
public void addOverdueRequestListener(OverdueRequestListener overdueRequestListener)
overdueRequestListener - a OverdueRequestListenerpublic void removeOverdueRequestListener(OverdueRequestListener overdueRequestListener)
overdueRequestListener - a OverdueRequestListenerpublic void startWatching()
public void stopWatching()
public void close()
protected ScheduledExecutorService newSingleThreadExecutor()
protected void notifyOverdueListeners(List<Request> overdue,
long overdueThreshold)
overdue - a List of RequestoverdueThreshold - the number of ms after which a request is deemed to be overdue
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||