hkontrol.module.debug
Class Module

java.lang.Object
  extended by hkontrol.core.AbstractModule
      extended by hkontrol.module.debug.Module
All Implemented Interfaces:
java.lang.Runnable

public class Module
extends AbstractModule


Constructor Summary
Module()
           
 
Method Summary
protected  HKConnection getConnection()
          returns a HKConnection object if a connection is associated with the calling module instance.
protected  int work()
          is called repeatedly by run in a seperate thread.
 
Methods inherited from class hkontrol.core.AbstractModule
construct, getConfig, getState, init, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Module

public Module()
Method Detail

work

protected int work()
            throws ModuleException
Description copied from class: AbstractModule
is called repeatedly by run in a seperate thread. Since doing some work and then sleeping some time is a common use case, work must return the number of milliseconds that will have to pass before work should be called again. As a matter of fact, the implementing modules can be designed easily not to use this mechanism but implement their own.

Specified by:
work in class AbstractModule
Returns:
number of milliseconds to wait before the call of work. If the returned value is negative the module will cease execution.
Throws:
ModuleException - which will be caught and logged

getConnection

protected HKConnection getConnection()
                              throws ModuleException
returns a HKConnection object if a connection is associated with the calling module instance.

Returns:
the associated connection or null if no connection is configured
Throws:
ModuleException - if connection could not be established