當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。