Search in sources :

Example 1 with DelayedAction

use of won.bot.framework.eventbot.action.impl.DelayedAction in project webofneeds by researchstudio-sat.

the class MatcherBehaviour method onActivate.

protected void onActivate(Optional<Object> message) {
    // register as matcher on node
    RegisterMatcherAction registerMatcher = new RegisterMatcherAction(context);
    subscribeWithAutoCleanup(ActEvent.class, new ActionOnEventListener(context, registerMatcher, 1));
    // retry in case of failed registering
    DelayedAction delayedRegistration = new DelayedAction(context, retryInterval, registerMatcher);
    subscribeWithAutoCleanup(MatcherExtensionRegisterFailedEvent.class, delayedRegistration);
    // optional action on successful registering
    subscribeWithAutoCleanup(MatcherExtensionRegisterSucceededEvent.class, new LogAction(context, "Successfully registered as Matcher"));
}
Also used : LogAction(won.bot.framework.eventbot.action.impl.LogAction) ActionOnEventListener(won.bot.framework.eventbot.listener.impl.ActionOnEventListener) DelayedAction(won.bot.framework.eventbot.action.impl.DelayedAction)

Aggregations

DelayedAction (won.bot.framework.eventbot.action.impl.DelayedAction)1 LogAction (won.bot.framework.eventbot.action.impl.LogAction)1 ActionOnEventListener (won.bot.framework.eventbot.listener.impl.ActionOnEventListener)1