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"));
}
Aggregations