本文整理汇总了Java中com.espertech.esper.epl.variable.CreateVariableView类的典型用法代码示例。如果您正苦于以下问题:Java CreateVariableView类的具体用法?Java CreateVariableView怎么用?Java CreateVariableView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CreateVariableView类属于com.espertech.esper.epl.variable包,在下文中一共展示了CreateVariableView类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: newContextInternal
import com.espertech.esper.epl.variable.CreateVariableView; //导入依赖的package包/类
public StatementAgentInstanceFactoryCreateVariableResult newContextInternal(final AgentInstanceContext agentInstanceContext, boolean isRecoveringResilient) {
StopCallback stopCallback = new StopCallback() {
public void stop() {
services.getVariableService().deallocateVariableState(variableMetaData.getVariableName(), agentInstanceContext.getAgentInstanceId());
}
};
services.getVariableService().allocateVariableState(variableMetaData.getVariableName(), agentInstanceContext.getAgentInstanceId(), statementContext.getStatementExtensionServicesContext(), isRecoveringResilient);
final CreateVariableView createView = new CreateVariableView(statementContext.getStatementId(), services.getEventAdapterService(), services.getVariableService(), createDesc.getVariableName(), statementContext.getStatementResultService(), agentInstanceContext.getAgentInstanceId());
services.getVariableService().registerCallback(createDesc.getVariableName(), agentInstanceContext.getAgentInstanceId(), createView);
statementContext.getStatementStopService().addSubscriber(new StatementStopCallback() {
public void statementStopped() {
services.getVariableService().unregisterCallback(createDesc.getVariableName(), 0, createView);
}
});
// Create result set processor, use wildcard selection
statementSpec.getSelectClauseSpec().setSelectExprList(new SelectClauseElementWildcard());
statementSpec.setSelectStreamDirEnum(SelectClauseStreamSelectorEnum.RSTREAM_ISTREAM_BOTH);
StreamTypeService typeService = new StreamTypeServiceImpl(new EventType[]{createView.getEventType()}, new String[]{"create_variable"}, new boolean[]{true}, services.getEngineURI(), false, false);
OutputProcessViewBase outputViewBase;
try {
ResultSetProcessorFactoryDesc resultSetProcessorPrototype = ResultSetProcessorFactoryFactory.getProcessorPrototype(
statementSpec, statementContext, typeService, null, new boolean[0], true, ContextPropertyRegistryImpl.EMPTY_REGISTRY, null, services.getConfigSnapshot(), services.getResultSetProcessorHelperFactory(), false, false);
ResultSetProcessor resultSetProcessor = EPStatementStartMethodHelperAssignExpr.getAssignResultSetProcessor(agentInstanceContext, resultSetProcessorPrototype, false, null, false);
// Attach output view
OutputProcessViewFactory outputViewFactory = OutputProcessViewFactoryFactory.make(statementSpec, services.getInternalEventRouter(), agentInstanceContext.getStatementContext(), resultSetProcessorPrototype.getResultEventType(), null, services.getTableService(), resultSetProcessorPrototype.getResultSetProcessorType(), services.getResultSetProcessorHelperFactory(), services.getStatementVariableRefService());
outputViewBase = outputViewFactory.makeView(resultSetProcessor, agentInstanceContext);
createView.addView(outputViewBase);
} catch (ExprValidationException ex) {
throw new EPException("Unexpected exception in create-variable context allocation: " + ex.getMessage(), ex);
}
return new StatementAgentInstanceFactoryCreateVariableResult(outputViewBase, stopCallback, agentInstanceContext);
}