本文整理匯總了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;
}