> are watchdog and watchdog target complete set of abstractions ?

Watchdog publishes start, stop and reset.  Triggering is defered to Watchdog
subtypes.  WatchdogTarget is the trigger type defined to work with a subset
of Watchdog subtypes.

> To me this means there is another association API. Can you post that API
> please. How will you lookup and associate a watchdog with target?

Here is the Watchdog and Adapter for the SMTPHandler:

  TimeoutWatchdog theWatchdog =
      new TimeoutWatchdog(timeout,
                          new WatchdogTarget() {
                              public void execute() {
                                  SMTPHandler.this.getLogger().error("...");
                                  try {
                                      SMTPHandler.this.socket.close();
                                  } catch (Exception e) {
                                      // ignored
                                  }
                              }
                          });

There is no lookup.  The target is part of the instance data for the
Watchdog object.  There is no exposed "manager" class; the client code deals
directly with the Watchdog object, which can delegate behavior to other
objects, or implement it directly.  But that is not exposed by the
interface.

I have not seen the addition, but I understand that Peter has made a
Watchdog Factory providing the same capability, except that it allows the
implementation of the Watchdog to be defered, so that either the dual-thread
or shared-thread implementation can be used.

        --- Noel


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to