本文整理汇总了Java中com.espertech.esper.core.service.EPStatementHandleCallback类的典型用法代码示例。如果您正苦于以下问题:Java EPStatementHandleCallback类的具体用法?Java EPStatementHandleCallback怎么用?Java EPStatementHandleCallback使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EPStatementHandleCallback类属于com.espertech.esper.core.service包,在下文中一共展示了EPStatementHandleCallback类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: scheduleCallback
import com.espertech.esper.core.service.EPStatementHandleCallback; //导入依赖的package包/类
protected void scheduleCallback() {
long current = agentInstanceContext.getStatementContext().getSchedulingService().getTime();
ExprTimePeriodEvalDeltaResult deltaWReference = timeDeltaComputation.deltaAddWReference(current, currentReferencePoint);
long afterTime = deltaWReference.getDelta();
currentReferencePoint = deltaWReference.getLastReference();
ScheduleHandleCallback callback = new ScheduleHandleCallback() {
public void scheduledTrigger(EngineLevelExtensionServicesContext extensionServicesContext) {
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().qViewScheduledEval(TimeBatchView.this, timeBatchViewFactory.getViewName());
}
TimeBatchView.this.sendBatch();
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().aViewScheduledEval();
}
}
};
handle = new EPStatementHandleCallback(agentInstanceContext.getEpStatementAgentInstanceHandle(), callback);
agentInstanceContext.getStatementContext().getSchedulingService().add(afterTime, handle, scheduleSlot);
}
示例2: TimeAccumViewRStream
import com.espertech.esper.core.service.EPStatementHandleCallback; //导入依赖的package包/类
/**
* Constructor.
*
* @param timeBatchViewFactory for copying this view in a group-by
* @param agentInstanceContext context
* @param timeDeltaComputation time delta eval
*/
public TimeAccumViewRStream(TimeAccumViewFactory timeBatchViewFactory,
AgentInstanceViewFactoryChainContext agentInstanceContext,
ExprTimePeriodEvalDeltaConst timeDeltaComputation) {
this.agentInstanceContext = agentInstanceContext;
this.factory = timeBatchViewFactory;
this.timeDeltaComputation = timeDeltaComputation;
this.scheduleSlot = agentInstanceContext.getStatementContext().getScheduleBucket().allocateSlot();
ScheduleHandleCallback callback = new ScheduleHandleCallback() {
public void scheduledTrigger(EngineLevelExtensionServicesContext extensionServicesContext) {
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().qViewScheduledEval(TimeAccumViewRStream.this, TimeAccumViewRStream.this.factory.getViewName());
}
TimeAccumViewRStream.this.sendRemoveStream();
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().aViewScheduledEval();
}
}
};
handle = new EPStatementHandleCallback(agentInstanceContext.getEpStatementAgentInstanceHandle(), callback);
agentInstanceContext.addTerminationCallback(this);
}
示例3: scheduleCallback
import com.espertech.esper.core.service.EPStatementHandleCallback; //导入依赖的package包/类
protected void scheduleCallback() {
long current = agentInstanceContext.getStatementContext().getSchedulingService().getTime();
ExprTimePeriodEvalDeltaResult deltaWReference = timeDeltaComputation.deltaAddWReference(current, currentReferencePoint);
long afterTime = deltaWReference.getDelta();
currentReferencePoint = deltaWReference.getLastReference();
ScheduleHandleCallback callback = new ScheduleHandleCallback() {
public void scheduledTrigger(EngineLevelExtensionServicesContext extensionServicesContext) {
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().qViewScheduledEval(TimeBatchViewRStream.this, timeBatchViewFactory.getViewName());
}
TimeBatchViewRStream.this.sendBatch();
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().aViewScheduledEval();
}
}
};
handle = new EPStatementHandleCallback(agentInstanceContext.getEpStatementAgentInstanceHandle(), callback);
agentInstanceContext.getStatementContext().getSchedulingService().add(afterTime, handle, scheduleSlot);
}
示例4: TimeAccumView
import com.espertech.esper.core.service.EPStatementHandleCallback; //导入依赖的package包/类
/**
* Constructor.
*
* @param viewUpdatedCollection is a collection that the view must update when receiving events
* @param timeBatchViewFactory fr copying this view in a group-by
* @param agentInstanceContext is required view services
* @param timeDeltaComputation delta computation
*/
public TimeAccumView(TimeAccumViewFactory timeBatchViewFactory,
AgentInstanceViewFactoryChainContext agentInstanceContext,
ExprTimePeriodEvalDeltaConst timeDeltaComputation,
ViewUpdatedCollection viewUpdatedCollection) {
this.agentInstanceContext = agentInstanceContext;
this.factory = timeBatchViewFactory;
this.timeDeltaComputation = timeDeltaComputation;
this.viewUpdatedCollection = viewUpdatedCollection;
this.scheduleSlot = agentInstanceContext.getStatementContext().getScheduleBucket().allocateSlot();
ScheduleHandleCallback callback = new ScheduleHandleCallback() {
public void scheduledTrigger(EngineLevelExtensionServicesContext extensionServicesContext) {
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().qViewScheduledEval(TimeAccumView.this, TimeAccumView.this.factory.getViewName());
}
TimeAccumView.this.sendRemoveStream();
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().aViewScheduledEval();
}
}
};
handle = new EPStatementHandleCallback(agentInstanceContext.getEpStatementAgentInstanceHandle(), callback);
agentInstanceContext.addTerminationCallback(this);
}
示例5: scheduleCallback
import com.espertech.esper.core.service.EPStatementHandleCallback; //导入依赖的package包/类
private void scheduleCallback() {
long afterTime = timeDeltaComputation.deltaAdd(agentInstanceContext.getStatementContext().getSchedulingService().getTime());
ScheduleHandleCallback callback = new ScheduleHandleCallback() {
public void scheduledTrigger(EngineLevelExtensionServicesContext extensionServicesContext) {
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().qViewScheduledEval(FirstTimeView.this, timeFirstViewFactory.getViewName());
}
FirstTimeView.this.isClosed = true;
internalHandleClosed();
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().aViewScheduledEval();
}
}
};
handle = new EPStatementHandleCallback(agentInstanceContext.getEpStatementAgentInstanceHandle(), callback);
agentInstanceContext.getStatementContext().getSchedulingService().add(afterTime, handle, scheduleSlot);
}
示例6: scheduleCallback
import com.espertech.esper.core.service.EPStatementHandleCallback; //导入依赖的package包/类
protected void scheduleCallback(long delta) {
ScheduleHandleCallback callback = new ScheduleHandleCallback() {
public void scheduledTrigger(EngineLevelExtensionServicesContext extensionServicesContext) {
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().qViewScheduledEval(TimeLengthBatchView.this, timeLengthBatchViewFactory.getViewName());
}
TimeLengthBatchView.this.sendBatch(true);
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().aViewScheduledEval();
}
}
};
handle = new EPStatementHandleCallback(agentInstanceContext.getEpStatementAgentInstanceHandle(), callback);
long currentTime = agentInstanceContext.getStatementContext().getSchedulingService().getTime();
long scheduled = timeDeltaComputation.deltaAdd(currentTime) - delta;
agentInstanceContext.getStatementContext().getSchedulingService().add(scheduled, handle, scheduleSlot);
callbackScheduledTime = agentInstanceContext.getStatementContext().getSchedulingService().getTime() + scheduled;
}
示例7: setScheduleCallback
import com.espertech.esper.core.service.EPStatementHandleCallback; //导入依赖的package包/类
public void setScheduleCallback(AgentInstanceContext agentInstanceContext, final EventRowRegexNFAViewScheduleCallback scheduleCallback) {
this.agentInstanceContext = agentInstanceContext;
this.scheduleSlot = agentInstanceContext.getStatementContext().getScheduleBucket().allocateSlot();
final ScheduleHandleCallback callback = new ScheduleHandleCallback() {
public void scheduledTrigger(EngineLevelExtensionServicesContext extensionServicesContext) {
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().qRegExScheduledEval();
}
scheduleCallback.triggered();
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().aRegExScheduledEval();
}
}
};
this.handle = new EPStatementHandleCallback(agentInstanceContext.getEpStatementAgentInstanceHandle(), callback);
}
示例8: open
import com.espertech.esper.core.service.EPStatementHandleCallback; //导入依赖的package包/类
public void open(DataFlowOpOpenContext openContext) {
FilterValueSet valueSet;
try {
List<ExprNode> filters = Collections.emptyList();
if (filter != null) {
filters = Collections.singletonList(filter);
}
FilterSpecCompiled spec = FilterSpecCompiler.makeFilterSpec(eventType, eventType.getName(), filters, null,
null, null, new StreamTypeServiceImpl(eventType, eventType.getName(), true, agentInstanceContext.getEngineURI()), null, agentInstanceContext.getStatementContext(), new ArrayList<Integer>());
valueSet = spec.getValueSet(null, null, agentInstanceContext, agentInstanceContext.getEngineImportService(), agentInstanceContext.getAnnotations());
} catch (ExprValidationException ex) {
throw new EPException("Failed to open filter: " + ex.getMessage(), ex);
}
EPStatementAgentInstanceHandle handle = new EPStatementAgentInstanceHandle(agentInstanceContext.getStatementContext().getEpStatementHandle(), agentInstanceContext.getAgentInstanceLock(), 0, new StatementAgentInstanceFilterVersion(), agentInstanceContext.getStatementContext().getFilterFaultHandlerFactory());
callbackHandle = new EPStatementHandleCallback(handle, this);
filterServiceEntry = agentInstanceContext.getStatementContext().getFilterService().add(valueSet, callbackHandle);
}
示例9: startObserve
import com.espertech.esper.core.service.EPStatementHandleCallback; //导入依赖的package包/类
public void startObserve()
{
if (isTimerActive)
{
throw new IllegalStateException("Timer already active");
}
if (msec <= 0)
{
observerEventEvaluator.observerEvaluateTrue(beginState);
}
else
{
scheduleHandle = new EPStatementHandleCallback(observerEventEvaluator.getContext().getAgentInstanceContext().getEpStatementAgentInstanceHandle(), this);
observerEventEvaluator.getContext().getPatternContext().getSchedulingService().add(msec, scheduleHandle, scheduleSlot);
isTimerActive = true;
}
}
示例10: dropStream
import com.espertech.esper.core.service.EPStatementHandleCallback; //导入依赖的package包/类
/**
* See the method of the same name in {@link com.espertech.esper.view.stream.StreamFactoryService}.
* @param filterSpec is the filter definition
*/
public void dropStream(FilterSpecCompiled filterSpec, FilterService filterService, boolean isJoin, boolean isSubSelect, boolean isNamedWindowTrigger, boolean filterWithSameTypeSubselect, boolean stateless)
{
Pair<EventStream, EPStatementHandleCallback> pair;
boolean forceNewStream = isJoin || (!isReuseViews) || isSubSelect || isNamedWindowTrigger || filterWithSameTypeSubselect || stateless;
if (forceNewStream)
{
pair = eventStreamsIdentity.get(filterSpec);
if (pair == null)
{
throw new IllegalStateException("Filter spec object not in collection");
}
eventStreamsIdentity.remove(filterSpec);
filterService.remove(pair.getSecond());
}
else
{
pair = eventStreamsRefCounted.get(filterSpec);
boolean isLast = eventStreamsRefCounted.dereference(filterSpec);
if (isLast)
{
filterService.remove(pair.getSecond());
}
}
}
示例11: TimeAccumViewRStream
import com.espertech.esper.core.service.EPStatementHandleCallback; //导入依赖的package包/类
/**
* Constructor.
* @param msecIntervalSize is the number of milliseconds to batch events for
* @param timeBatchViewFactory fr copying this view in a group-by
*/
public TimeAccumViewRStream(TimeAccumViewFactory timeBatchViewFactory,
AgentInstanceViewFactoryChainContext agentInstanceContext,
long msecIntervalSize)
{
this.agentInstanceContext = agentInstanceContext;
this.factory = timeBatchViewFactory;
this.msecIntervalSize = msecIntervalSize;
this.scheduleSlot = agentInstanceContext.getStatementContext().getScheduleBucket().allocateSlot();
ScheduleHandleCallback callback = new ScheduleHandleCallback() {
public void scheduledTrigger(ExtensionServicesContext extensionServicesContext)
{
TimeAccumViewRStream.this.sendRemoveStream();
}
};
handle = new EPStatementHandleCallback(agentInstanceContext.getEpStatementAgentInstanceHandle(), callback);
agentInstanceContext.getTerminationCallbacks().add(this);
}
示例12: TimeAccumView
import com.espertech.esper.core.service.EPStatementHandleCallback; //导入依赖的package包/类
/**
* Constructor.
* @param msecIntervalSize is the number of milliseconds to batch events for
* @param viewUpdatedCollection is a collection that the view must update when receiving events
* @param timeBatchViewFactory fr copying this view in a group-by
* @param agentInstanceContext is required view services
*/
public TimeAccumView(TimeAccumViewFactory timeBatchViewFactory,
AgentInstanceViewFactoryChainContext agentInstanceContext,
long msecIntervalSize,
ViewUpdatedCollection viewUpdatedCollection)
{
this.agentInstanceContext = agentInstanceContext;
this.factory = timeBatchViewFactory;
this.msecIntervalSize = msecIntervalSize;
this.viewUpdatedCollection = viewUpdatedCollection;
this.scheduleSlot = agentInstanceContext.getStatementContext().getScheduleBucket().allocateSlot();
ScheduleHandleCallback callback = new ScheduleHandleCallback() {
public void scheduledTrigger(ExtensionServicesContext extensionServicesContext)
{
TimeAccumView.this.sendRemoveStream();
}
};
handle = new EPStatementHandleCallback(agentInstanceContext.getEpStatementAgentInstanceHandle(), callback);
agentInstanceContext.getTerminationCallbacks().add(this);
}
示例13: TimeWindowView
import com.espertech.esper.core.service.EPStatementHandleCallback; //导入依赖的package包/类
/**
* Constructor.
* @param millisecondsBeforeExpiry is the number of milliseconds before events gets pushed
* out of the timeWindow as oldData in the update method.
* @param viewUpdatedCollection is a collection the view must update when receiving events
* @param timeWindowViewFactory for copying the view in a group-by
*/
public TimeWindowView(AgentInstanceViewFactoryChainContext agentInstanceContext, TimeWindowViewFactory timeWindowViewFactory, long millisecondsBeforeExpiry, ViewUpdatedCollection viewUpdatedCollection)
{
this.agentInstanceContext = agentInstanceContext;
this.timeWindowViewFactory = timeWindowViewFactory;
this.millisecondsBeforeExpiry = millisecondsBeforeExpiry;
this.viewUpdatedCollection = viewUpdatedCollection;
this.scheduleSlot = agentInstanceContext.getStatementContext().getScheduleBucket().allocateSlot();
this.timeWindow = new TimeWindow(agentInstanceContext.isRemoveStream());
ScheduleHandleCallback callback = new ScheduleHandleCallback() {
public void scheduledTrigger(ExtensionServicesContext extensionServicesContext)
{
TimeWindowView.this.expire();
}
};
this.handle = new EPStatementHandleCallback(agentInstanceContext.getEpStatementAgentInstanceHandle(), callback);
agentInstanceContext.getStatementContext().getScheduleAdjustmentService().addCallback(this);
agentInstanceContext.getTerminationCallbacks().add(this);
}
示例14: scheduleCallback
import com.espertech.esper.core.service.EPStatementHandleCallback; //导入依赖的package包/类
private void scheduleCallback()
{
isCallbackScheduled = true;
long current = context.getStatementContext().getSchedulingService().getTime();
if ((ExecutionPathDebugLog.isDebugEnabled) && (log.isDebugEnabled()))
{
log.debug(".scheduleCallback Scheduled new callback for " +
" now=" + current +
" currentReferencePoint=" + currentReferencePoint +
" spec=" + factory.getScheduleSpec());
}
ScheduleHandleCallback callback = new ScheduleHandleCallback() {
public void scheduledTrigger(ExtensionServicesContext extensionServicesContext)
{
OutputConditionCrontab.this.isCallbackScheduled = false;
OutputConditionCrontab.this.outputCallback.continueOutputProcessing(DO_OUTPUT, FORCE_UPDATE);
scheduleCallback();
}
};
EPStatementHandleCallback handle = new EPStatementHandleCallback(context.getEpStatementAgentInstanceHandle(), callback);
SchedulingService schedulingService = context.getStatementContext().getSchedulingService();
long nextScheduledTime = ScheduleComputeHelper.computeDeltaNextOccurance(factory.getScheduleSpec(), schedulingService.getTime());
schedulingService.add(nextScheduledTime, handle, scheduleSlot);
}
示例15: open
import com.espertech.esper.core.service.EPStatementHandleCallback; //导入依赖的package包/类
public void open(DataFlowOpOpenContext openContext) {
FilterValueSet valueSet;
try {
List<ExprNode> filters = Collections.emptyList();
if (filter != null) {
filters = Collections.singletonList(filter);
}
FilterSpecCompiled spec = FilterSpecCompiler.makeFilterSpec(eventType, eventType.getName(), filters, null,
null, null, new StreamTypeServiceImpl(eventType, eventType.getName(), true, agentInstanceContext.getEngineURI()), null, agentInstanceContext.getStatementContext(), new ArrayList<Integer>());
valueSet = spec.getValueSet(null, agentInstanceContext, null);
}
catch (ExprValidationException ex) {
throw new EPException("Failed to open filter: " + ex.getMessage(), ex);
}
EPStatementAgentInstanceHandle handle = new EPStatementAgentInstanceHandle(agentInstanceContext.getStatementContext().getEpStatementHandle(), agentInstanceContext.getAgentInstanceLock(), 0, new StatementAgentInstanceFilterVersion());
callbackHandle = new EPStatementHandleCallback(handle, this);
agentInstanceContext.getStatementContext().getFilterService().add(valueSet, callbackHandle);
}