lunes, 25 de octubre de 2010

Watchdog Abstract

I have designed a WatchDog abstract class with a common behaviour in order to adapt it to manage any program, instance, thread, web service, window service or whatever.



This WatchDog entity reads their configuration from a setting file where retrieves the following values:
- Timeout: Time to restart the check of the entity to watch.
- Number of attempts in order to reset the entity when this number is over.


In the project that I have had to design, I had to watch a window service, therefore a WatchDogWinService specialized the WatchDog abstract:


This WatchDogWinService opens a channel with the watched window service that the window service must use to notify that is working properly (Sometimes the manager of windows service of SO doesn't work very well...).

The advantage to create an abstract class with the common behaviour is that can be easily testable, of course, creating a mock that implements this abstract class.

As always, if you are interested for this project, you can ask me.

No hay comentarios:

Publicar un comentario