|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.manifoldcf.crawler.system.ResetManager
public abstract class ResetManager
The reset manager basically keeps track of threads that work together. If the threads get hosed as a result of problems, then certain resets need to be done. Each instance of this manager therefore tracks all the threads which depend or affect a condition that needs explicit resetting. When a thread recognizes that the database (or whatever resource) is potentially in a state where a reset for the particular condition is required, then the corresponding reset manager object will cause all dependent threads to block, until they are all accounted for. Then, the corrective reset is done, and the threads are released (with a signal corresponding to the fact that a reset occurred returned). This class is meant to be extended in order to implement the exact reset functionality required.
| Field Summary | |
|---|---|
static java.lang.String |
_rcsid
|
protected int |
involvedThreadCount
This is the count of the threads that care about this resource. |
protected boolean |
resetRequired
Boolean which describes whether an event requiring reset has occurred. |
protected int |
waitingThreads
This is the number of threads that are waiting for the reset. |
| Constructor Summary | |
|---|---|
ResetManager()
Constructor. |
|
| Method Summary | |
|---|---|
void |
noteEvent()
Note a resettable event. |
protected abstract void |
performResetLogic(IThreadContext tc)
Do the reset logic. |
void |
registerMe()
Register a thread with this reset manager. |
boolean |
waitForReset(IThreadContext tc)
Enter "wait" state for current thread. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String _rcsid
protected boolean resetRequired
protected int involvedThreadCount
protected int waitingThreads
| Constructor Detail |
|---|
public ResetManager()
| Method Detail |
|---|
public void registerMe()
public void noteEvent()
public boolean waitForReset(IThreadContext tc)
throws ManifoldCFException,
java.lang.InterruptedException
ManifoldCFException
java.lang.InterruptedException
protected abstract void performResetLogic(IThreadContext tc)
throws ManifoldCFException
ManifoldCFException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||