本文整理汇总了Java中com.espertech.esper.pattern.PatternAgentInstanceContext类的典型用法代码示例。如果您正苦于以下问题:Java PatternAgentInstanceContext类的具体用法?Java PatternAgentInstanceContext怎么用?Java PatternAgentInstanceContext使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PatternAgentInstanceContext类属于com.espertech.esper.pattern包,在下文中一共展示了PatternAgentInstanceContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: computeMilliseconds
import com.espertech.esper.pattern.PatternAgentInstanceContext; //导入依赖的package包/类
protected long computeMilliseconds(MatchedEventMap beginState, PatternAgentInstanceContext context) {
Object result = parameter.getExprEvaluator().evaluate(convertor.convert(beginState), true, context.getAgentInstanceContext());
if (result == null)
{
throw new EPException("Null value returned for guard expression");
}
Number param = (Number) result;
if (JavaClassHelper.isFloatingPointNumber(param))
{
return Math.round(1000d * param.doubleValue());
}
else
{
return 1000 * param.longValue();
}
}
示例2: computeDelta
import com.espertech.esper.pattern.PatternAgentInstanceContext; //导入依赖的package包/类
public long computeDelta(MatchedEventMap beginState, PatternAgentInstanceContext context) {
if (parameter instanceof ExprTimePeriod) {
ExprTimePeriod timePeriod = (ExprTimePeriod) parameter;
return timePeriod.nonconstEvaluator().deltaUseEngineTime(convertor.convert(beginState), context.getAgentInstanceContext(), context.getAgentInstanceContext().getTimeProvider());
} else {
Object result = parameter.getForge().getExprEvaluator().evaluate(convertor.convert(beginState), true, context.getAgentInstanceContext());
if (result == null) {
throw new EPException("Null value returned for guard expression");
}
return context.getStatementContext().getTimeAbacus().deltaForSecondsNumber((Number) result);
}
}
示例3: setUp
import com.espertech.esper.pattern.PatternAgentInstanceContext; //导入依赖的package包/类
public void setUp() {
StatementContext stmtContext = SupportStatementContextFactory.makeContext(new SchedulingServiceImpl(new TimeSourceServiceImpl()));
scheduleService = stmtContext.getSchedulingService();
PatternAgentInstanceContext agentInstanceContext = SupportPatternContextFactory.makePatternAgentInstanceContext(scheduleService);
quitable = new SupportQuitable(agentInstanceContext);
guard = new TimerWithinGuard(1000, quitable);
}
示例4: setUp
import com.espertech.esper.pattern.PatternAgentInstanceContext; //导入依赖的package包/类
public void setUp() {
StatementContext stmtContext = SupportStatementContextFactory.makeContext(new SchedulingServiceImpl(new TimeSourceServiceImpl()));
scheduleService = stmtContext.getSchedulingService();
PatternAgentInstanceContext agentInstanceContext = SupportPatternContextFactory.makePatternAgentInstanceContext(scheduleService);
quitable = new SupportQuitable(agentInstanceContext);
guard = new TimerWithinOrMaxCountGuard(1000, 2, quitable);
}
示例5: makePatternAgentInstanceContext
import com.espertech.esper.pattern.PatternAgentInstanceContext; //导入依赖的package包/类
public static PatternAgentInstanceContext makePatternAgentInstanceContext(SchedulingService scheduleService) {
StatementContext stmtContext;
if (scheduleService == null) {
stmtContext = SupportStatementContextFactory.makeContext();
} else {
stmtContext = SupportStatementContextFactory.makeContext(scheduleService);
}
PatternContext context = new PatternContext(stmtContext, 1, new MatchedEventMapMeta(new String[0], false), false);
return new PatternAgentInstanceContext(context, SupportStatementContextFactory.makeAgentInstanceContext(), false, null);
}
示例6: setUp
import com.espertech.esper.pattern.PatternAgentInstanceContext; //导入依赖的package包/类
public void setUp()
{
StatementContext stmtContext = SupportStatementContextFactory.makeContext(new SchedulingServiceImpl(new TimeSourceServiceImpl()));
scheduleService = stmtContext.getSchedulingService();
PatternAgentInstanceContext agentInstanceContext = SupportPatternContextFactory.makePatternAgentInstanceContext(scheduleService);
quitable = new SupportQuitable(agentInstanceContext);
guard = new TimerWithinGuard(1000, quitable);
}
示例7: setUp
import com.espertech.esper.pattern.PatternAgentInstanceContext; //导入依赖的package包/类
public void setUp()
{
StatementContext stmtContext = SupportStatementContextFactory.makeContext(new SchedulingServiceImpl(new TimeSourceServiceImpl()));
scheduleService = stmtContext.getSchedulingService();
PatternAgentInstanceContext agentInstanceContext = SupportPatternContextFactory.makePatternAgentInstanceContext(scheduleService);
quitable = new SupportQuitable(agentInstanceContext);
guard = new TimerWithinOrMaxCountGuard(1000, 2, quitable);
}
示例8: setUp
import com.espertech.esper.pattern.PatternAgentInstanceContext; //导入依赖的package包/类
public void setUp()
{
beginState = new MatchedEventMapImpl(new MatchedEventMapMeta(new String[0], false));
scheduleService = new SchedulingServiceImpl(new TimeSourceServiceImpl());
PatternAgentInstanceContext agentContext = SupportPatternContextFactory.makePatternAgentInstanceContext(scheduleService);
ScheduleSpec scheduleSpec = new ScheduleSpec();
scheduleSpec.addValue(ScheduleUnit.SECONDS, 1);
evaluator = new SupportObserverEvaluator(agentContext);
observer = new TimerAtObserver(scheduleSpec, beginState, evaluator);
}
示例9: makePatternAgentInstanceContext
import com.espertech.esper.pattern.PatternAgentInstanceContext; //导入依赖的package包/类
public static PatternAgentInstanceContext makePatternAgentInstanceContext(SchedulingService scheduleService) {
StatementContext stmtContext;
if (scheduleService == null) {
stmtContext = SupportStatementContextFactory.makeContext();
}
else {
stmtContext = SupportStatementContextFactory.makeContext(scheduleService);
}
PatternContext context = new PatternContext(stmtContext, 1, new MatchedEventMapMeta(new String[0], false), false);
return new PatternAgentInstanceContext(context, SupportStatementContextFactory.makeAgentInstanceContext(), false);
}
示例10: makeGuard
import com.espertech.esper.pattern.PatternAgentInstanceContext; //导入依赖的package包/类
public Guard makeGuard(PatternAgentInstanceContext context, MatchedEventMap beginState, Quitable quitable, EvalStateNodeNumber stateNodeId, Object guardState) {
return new ExpressionGuard(convertor, expression.getForge().getExprEvaluator(), quitable);
}
示例11: makeObserver
import com.espertech.esper.pattern.PatternAgentInstanceContext; //导入依赖的package包/类
public EventObserver makeObserver(PatternAgentInstanceContext context, MatchedEventMap beginState, ObserverEventEvaluator observerEventEvaluator, EvalStateNodeNumber stateNodeId, Object observerState, boolean isFilterChildNonQuitting) {
return new TimerIntervalObserver(computeDelta(beginState, context), beginState, observerEventEvaluator);
}
示例12: SupportObserverEventEvaluator
import com.espertech.esper.pattern.PatternAgentInstanceContext; //导入依赖的package包/类
private SupportObserverEventEvaluator(PatternAgentInstanceContext patternContext) {
this.patternContext = patternContext;
}
示例13: getContext
import com.espertech.esper.pattern.PatternAgentInstanceContext; //导入依赖的package包/类
public PatternAgentInstanceContext getContext() {
return patternContext;
}
示例14: makeObserver
import com.espertech.esper.pattern.PatternAgentInstanceContext; //导入依赖的package包/类
public EventObserver makeObserver(PatternAgentInstanceContext context, MatchedEventMap beginState, ObserverEventEvaluator observerEventEvaluator, EvalStateNodeNumber stateNodeId, Object observerState, boolean isFilterChildNonQuitting) {
return null;
}
示例15: makeGuard
import com.espertech.esper.pattern.PatternAgentInstanceContext; //导入依赖的package包/类
public Guard makeGuard(PatternAgentInstanceContext context, MatchedEventMap beginState, Quitable quitable, EvalStateNodeNumber stateNodeId, Object guardState) {
return null;
}