当前位置: 首页>>代码示例>>Java>>正文


Java PatternAgentInstanceContext类代码示例

本文整理汇总了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();
    }
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:18,代码来源:TimerIntervalObserverFactory.java

示例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);
    }
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:13,代码来源:TimerIntervalObserverFactory.java

示例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);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:10,代码来源:TestTimerWithinGuard.java

示例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);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:10,代码来源:TestTimerWithinOrMaxCountGuard.java

示例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);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:11,代码来源:SupportPatternContextFactory.java

示例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);
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:11,代码来源:TestTimerWithinGuard.java

示例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);
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:11,代码来源:TestTimerWithinOrMaxCountGuard.java

示例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);
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:15,代码来源:TestTimerCronObserver.java

示例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);
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:12,代码来源:SupportPatternContextFactory.java

示例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);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:4,代码来源:ExpressionGuardFactory.java

示例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);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:4,代码来源:TimerIntervalObserverFactory.java

示例12: SupportObserverEventEvaluator

import com.espertech.esper.pattern.PatternAgentInstanceContext; //导入依赖的package包/类
private SupportObserverEventEvaluator(PatternAgentInstanceContext patternContext) {
    this.patternContext = patternContext;
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:4,代码来源:TestTimerObserverFactory.java

示例13: getContext

import com.espertech.esper.pattern.PatternAgentInstanceContext; //导入依赖的package包/类
public PatternAgentInstanceContext getContext() {
    return patternContext;
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:4,代码来源:TestTimerObserverFactory.java

示例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;
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:4,代码来源:SupportObserverFactory.java

示例15: makeGuard

import com.espertech.esper.pattern.PatternAgentInstanceContext; //导入依赖的package包/类
public Guard makeGuard(PatternAgentInstanceContext context, MatchedEventMap beginState, Quitable quitable, EvalStateNodeNumber stateNodeId, Object guardState) {
    return null;
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:4,代码来源:SupportGuardFactory.java


注:本文中的com.espertech.esper.pattern.PatternAgentInstanceContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。