001package org.intellimate.izou.activator; 002 003import org.intellimate.izou.identification.Identifiable; 004 005import java.util.concurrent.Callable; 006 007/** 008 * The Task of an Activator is to listen for whatever you choose to implement and fires events to notify a change. 009 * <p> 010 * The Activator always runs in the Background, just overwrite activatorStarts(). To use Activator simply extend from it 011 * and hand an instance over to the ActivatorManager. 012 */ 013public interface ActivatorModel extends Identifiable, Callable<Boolean> { 014 015 /** 016 * it this method returns false (and only if it returns false) it will not get restarted once stopped 017 * <p> 018 * Internally there is a limit of 100 times the activator is allowed to finish exceptionally (everything but 019 * returning false) 020 * </p> 021 * @return true if the activator should get restarted, false if not 022 * @throws Exception if unable to compute a result 023 */ 024 @Override 025 Boolean call() throws Exception; 026}