use of io.siddhi.core.trigger.StartTrigger in project siddhi by wso2.
the class DefinitionParserHelper method addEventTrigger.
public static void addEventTrigger(TriggerDefinition triggerDefinition, ConcurrentMap<String, Trigger> eventTriggerMap, ConcurrentMap<String, StreamJunction> streamJunctionMap, SiddhiAppContext siddhiAppContext) {
if (!eventTriggerMap.containsKey(triggerDefinition.getId())) {
AbstractTrigger trigger;
if (triggerDefinition.getAtEvery() != null) {
trigger = new PeriodicTrigger();
} else if (triggerDefinition.getAt().trim().equalsIgnoreCase(SiddhiConstants.TRIGGER_START)) {
trigger = new StartTrigger();
} else {
trigger = new CronTrigger();
}
StreamJunction streamJunction = streamJunctionMap.get(triggerDefinition.getId());
trigger.init(triggerDefinition, siddhiAppContext, streamJunction);
siddhiAppContext.addTrigger(trigger);
eventTriggerMap.putIfAbsent(trigger.getId(), trigger);
}
}
use of io.siddhi.core.trigger.StartTrigger in project siddhi by siddhi-io.
the class DefinitionParserHelper method addEventTrigger.
public static void addEventTrigger(TriggerDefinition triggerDefinition, ConcurrentMap<String, Trigger> eventTriggerMap, ConcurrentMap<String, StreamJunction> streamJunctionMap, SiddhiAppContext siddhiAppContext) {
if (!eventTriggerMap.containsKey(triggerDefinition.getId())) {
AbstractTrigger trigger;
if (triggerDefinition.getAtEvery() != null) {
trigger = new PeriodicTrigger();
} else if (triggerDefinition.getAt().trim().equalsIgnoreCase(SiddhiConstants.TRIGGER_START)) {
trigger = new StartTrigger();
} else {
trigger = new CronTrigger();
}
StreamJunction streamJunction = streamJunctionMap.get(triggerDefinition.getId());
trigger.init(triggerDefinition, siddhiAppContext, streamJunction);
siddhiAppContext.addTrigger(trigger);
eventTriggerMap.putIfAbsent(trigger.getId(), trigger);
}
}
Aggregations