All,
seems like the basic issues here are
1. "How does a container detect that a component is broken?"
Whether that broken-ness results from a worker thread
crashing, or from an unhandled exception in a synchronous
call is irrelevant.
2. "How does a container recover from a broken component?"
Dynamic reloading may not always work - consider components
that maintain state between method calls (SAXTransformer).
Sometimes, a component should just be marked "broken" and
any calls to it blocked to keep it from hurting itself.
Perhaps a general
public interface Monitorable {
public void setMonitor (ComponentMonitor monitor);
}
public interface ComponentMonitor {
public void statusChange (Status status);
}
public class Status {
public static final Status OK = new Status ("ok");
public static final Status BROKEN = new Status ("broken");
}
can solve this?
The ComponentMonitor can work in two ways:
/** Simple. */
public void statusChange (Status status) {
statusOfComponent = status;
}
/** Once broken, always broken. */
public void statusChange (Status status) {
if (statusOfComponent == Status.OK) { statusOfComponent = status
};
}
/LS
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]