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


Java VariableServiceImpl类代码示例

本文整理汇总了Java中com.espertech.esper.epl.variable.VariableServiceImpl的典型用法代码示例。如果您正苦于以下问题:Java VariableServiceImpl类的具体用法?Java VariableServiceImpl怎么用?Java VariableServiceImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


VariableServiceImpl类属于com.espertech.esper.epl.variable包,在下文中一共展示了VariableServiceImpl类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: validate3Stream

import com.espertech.esper.epl.variable.VariableServiceImpl; //导入依赖的package包/类
public static void validate3Stream(ExprNode topNode) throws Exception {
    SupportStreamTypeSvc3Stream streamTypeService = new SupportStreamTypeSvc3Stream();

    ViewFactoryChain[] factoriesPerStream = new ViewFactoryChain[3];
    for (int i = 0; i < factoriesPerStream.length; i++) {
        List<ViewFactory> factories = new LinkedList<ViewFactory>();
        factories.add(new LengthWindowViewFactory());
        factoriesPerStream[i] = new ViewFactoryChain(streamTypeService.getEventTypes()[i], factories);
    }
    ViewResourceDelegateUnverified viewResources = new ViewResourceDelegateUnverified();

    VariableService variableService = new VariableServiceImpl(0, new SchedulingServiceImpl(new TimeSourceServiceImpl()), SupportEventAdapterService.getService(), null);
    variableService.createNewVariable(null, "intPrimitive", Integer.class.getName(), false, false, false, 10, SupportEngineImportServiceFactory.make());
    variableService.allocateVariableState("intPrimitive", EPStatementStartMethod.DEFAULT_AGENT_INSTANCE_ID, null, false);
    variableService.createNewVariable(null, "var1", String.class.getName(), false, false, false, "my_variable_value", SupportEngineImportServiceFactory.make());
    variableService.allocateVariableState("var1", EPStatementStartMethod.DEFAULT_AGENT_INSTANCE_ID, null, false);

    ExprNodeUtilityRich.getValidatedSubtree(ExprNodeOrigin.SELECT, topNode, new ExprValidationContext(streamTypeService, SupportEngineImportServiceFactory.make(), null, viewResources, null, variableService, null, new SupportExprEvaluatorContext(null), null, null, 1, null, null, false, false, false, false, null, false));
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:20,代码来源:SupportExprNodeFactory.java

示例2: validate3Stream

import com.espertech.esper.epl.variable.VariableServiceImpl; //导入依赖的package包/类
public static void validate3Stream(ExprNode topNode) throws Exception {
    SupportStreamTypeSvc3Stream streamTypeService = new SupportStreamTypeSvc3Stream();

    ViewFactoryChain[] factoriesPerStream = new ViewFactoryChain[3];
    for (int i = 0; i < factoriesPerStream.length; i++) {
        List<ViewFactory> factories = new LinkedList<ViewFactory>();
        factories.add(new LengthWindowViewFactory());
        factoriesPerStream[i] = new ViewFactoryChain(streamTypeService.getEventTypes()[i], factories);
    }
    ViewResourceDelegateUnverified viewResources = new ViewResourceDelegateUnverified();

    EngineImportService engineImportService = SupportEngineImportServiceFactory.make();
    VariableService variableService = new VariableServiceImpl(0, new SchedulingServiceImpl(new TimeSourceServiceImpl()), SupportEventAdapterService.getService(), null);
    variableService.createNewVariable(null, "intPrimitive", Integer.class.getName(), false, false, false, 10, engineImportService);
    variableService.allocateVariableState("intPrimitive", EPStatementStartMethod.DEFAULT_AGENT_INSTANCE_ID, null, false);
    variableService.createNewVariable(null, "var1", String.class.getName(), false, false, false, "my_variable_value", engineImportService);
    variableService.allocateVariableState("var1", EPStatementStartMethod.DEFAULT_AGENT_INSTANCE_ID, null, false);

    ExprNodeUtilityRich.getValidatedSubtree(ExprNodeOrigin.SELECT, topNode, new ExprValidationContext(streamTypeService, SupportEngineImportServiceFactory.make(), null, viewResources, null, variableService, null, new SupportExprEvaluatorContext(null), null, null, 1, null, null, false, false, false, false, null, false));
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:21,代码来源:SupportExprNodeFactory.java

示例3: validate3Stream

import com.espertech.esper.epl.variable.VariableServiceImpl; //导入依赖的package包/类
public static void validate3Stream(ExprNode topNode) throws Exception
{
    SupportStreamTypeSvc3Stream streamTypeService = new SupportStreamTypeSvc3Stream();

    ViewFactoryChain[] factoriesPerStream = new ViewFactoryChain[3];
    for (int i = 0; i < factoriesPerStream.length; i++)
    {
        List<ViewFactory> factories = new LinkedList<ViewFactory>();
        factories.add(new LengthWindowViewFactory());
        factoriesPerStream[i] = new ViewFactoryChain(streamTypeService.getEventTypes()[i], factories);
    }
    ViewResourceDelegateUnverified viewResources = new ViewResourceDelegateUnverified();

    VariableService variableService = new VariableServiceImpl(0, new SchedulingServiceImpl(new TimeSourceServiceImpl()), SupportEventAdapterService.getService(), null);
    variableService.createNewVariable("intPrimitive", Integer.class.getName(), 10, false, false, null, null);
    variableService.createNewVariable("var1", String.class.getName(), "my_variable_value", false, false, null, null);

    ExprNodeUtility.getValidatedSubtree(topNode, new ExprValidationContext(streamTypeService, getMethodResService(), viewResources, null, variableService, null, null, null, null, null, null));
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:20,代码来源:SupportExprNodeFactory.java

示例4: setUp

import com.espertech.esper.epl.variable.VariableServiceImpl; //导入依赖的package包/类
public void setUp() throws Exception {
    EngineImportService engineImportService = SupportEngineImportServiceFactory.make();
    variableService = new VariableServiceImpl(100, null, null, null);
    variableService.createNewVariable(null, "var1", "string", true, false, false, null, engineImportService);
    variableService.createNewVariable(null, "dummy", "string", true, false, false, null, engineImportService);
    variableService.createNewVariable(null, "intPrimitive", "int", true, false, false, null, engineImportService);
    varNode = new ExprVariableNodeImpl(variableService.getVariableMetaData("var1"), null);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:9,代码来源:TestExprVariableNode.java

示例5: testWalkOnSet

import com.espertech.esper.epl.variable.VariableServiceImpl; //导入依赖的package包/类
public void testWalkOnSet() throws Exception
{
    VariableService variableService = new VariableServiceImpl(0, new SchedulingServiceImpl(new TimeSourceServiceImpl()), SupportEventAdapterService.getService(), null);
    variableService.createNewVariable("var1", Long.class.getName(), 100L, false, false, null, null);

    String expression = "on com.MyClass as myevent set var1 = 'a', var2 = 2*3, var3 = var1";
    EPLTreeWalker walker = parseAndWalkEPL(expression, null, variableService);
    StatementSpecRaw raw = walker.getStatementSpec();

    FilterStreamSpecRaw streamSpec = (FilterStreamSpecRaw) raw.getStreamSpecs().get(0);
    assertEquals("com.MyClass", streamSpec.getRawFilterSpec().getEventTypeName());
    assertEquals(0, streamSpec.getRawFilterSpec().getFilterExpressions().size());
    assertEquals("myevent", streamSpec.getOptionalStreamName());

    OnTriggerSetDesc setDesc = (OnTriggerSetDesc) raw.getOnTriggerDesc();
    assertTrue(setDesc.getOnTriggerType() == OnTriggerType.ON_SET);
    assertEquals(3, setDesc.getAssignments().size());

    OnTriggerSetAssignment assign = setDesc.getAssignments().get(0);
    assertEquals("var1", assign.getVariableName());
    assertTrue(assign.getExpression() instanceof ExprConstantNode);

    assign = setDesc.getAssignments().get(1);
    assertEquals("var2", assign.getVariableName());
    assertTrue(assign.getExpression() instanceof ExprMathNode);

    assign = setDesc.getAssignments().get(2);
    assertEquals("var3", assign.getVariableName());
    ExprVariableNode varNode = (ExprVariableNode) assign.getExpression();
    assertEquals("var1", varNode.getVariableName());

    assertTrue(raw.isHasVariables());

    // try a subquery
    expression = "select (select var1 from MyEvent) from MyEvent2";
    walker = parseAndWalkEPL(expression, null, variableService);
    raw = walker.getStatementSpec();
    assertTrue(raw.isHasVariables());
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:40,代码来源:TestEPLTreeWalker.java

示例6: parseAndWalkEPL

import com.espertech.esper.epl.variable.VariableServiceImpl; //导入依赖的package包/类
public static EPLTreeWalkerListener parseAndWalkEPL(String expression) throws Exception {
    return parseAndWalkEPL(expression, SupportEngineImportServiceFactory.make(), new VariableServiceImpl(0, null, SupportEventAdapterService.getService(), null));
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:4,代码来源:SupportParserHelper.java

示例7: makeWalker

import com.espertech.esper.epl.variable.VariableServiceImpl; //导入依赖的package包/类
public static EPLTreeWalkerListener makeWalker(CommonTokenStream tokenStream) {
    return makeWalker(tokenStream, SupportEngineImportServiceFactory.make(), new VariableServiceImpl(0, null, SupportEventAdapterService.getService(), null));
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:4,代码来源:SupportEPLTreeWalkerFactory.java

示例8: testWalkOnSet

import com.espertech.esper.epl.variable.VariableServiceImpl; //导入依赖的package包/类
public void testWalkOnSet() throws Exception {
    VariableService variableService = new VariableServiceImpl(0, new SchedulingServiceImpl(new TimeSourceServiceImpl()), SupportEventAdapterService.getService(), null);
    variableService.createNewVariable(null, "var1", Long.class.getName(), false, false, false, 100L, SupportEngineImportServiceFactory.make());
    variableService.allocateVariableState("var1", 0, null, false);

    String expression = "on com.MyClass as myevent set var1 = 'a', var2 = 2*3, var3 = var1";
    EPLTreeWalkerListener walker = SupportParserHelper.parseAndWalkEPL(expression, null, variableService);
    StatementSpecRaw raw = walker.getStatementSpec();

    FilterStreamSpecRaw streamSpec = (FilterStreamSpecRaw) raw.getStreamSpecs().get(0);
    assertEquals("com.MyClass", streamSpec.getRawFilterSpec().getEventTypeName());
    assertEquals(0, streamSpec.getRawFilterSpec().getFilterExpressions().size());
    assertEquals("myevent", streamSpec.getOptionalStreamName());

    OnTriggerSetDesc setDesc = (OnTriggerSetDesc) raw.getOnTriggerDesc();
    assertTrue(setDesc.getOnTriggerType() == OnTriggerType.ON_SET);
    assertEquals(3, setDesc.getAssignments().size());

    OnTriggerSetAssignment assign = setDesc.getAssignments().get(0);
    assertEquals("var1", ((ExprVariableNode) (assign.getExpression().getChildNodes()[0])).getVariableName());
    assertTrue(assign.getExpression() instanceof ExprEqualsNode);
    assertTrue(assign.getExpression().getChildNodes()[1] instanceof ExprConstantNode);

    assign = setDesc.getAssignments().get(1);
    assertEquals("var2", ((ExprIdentNode) (assign.getExpression().getChildNodes()[0])).getFullUnresolvedName());
    assertTrue(assign.getExpression() instanceof ExprEqualsNode);
    assertTrue(assign.getExpression().getChildNodes()[1] instanceof ExprMathNode);

    assign = setDesc.getAssignments().get(2);
    assertEquals("var3", ((ExprIdentNode) (assign.getExpression().getChildNodes()[0])).getFullUnresolvedName());
    ExprVariableNode varNode = (ExprVariableNode) assign.getExpression().getChildNodes()[1];
    assertEquals("var1", varNode.getVariableName());

    assertTrue(raw.isHasVariables());

    // try a subquery
    expression = "select (select var1 from MyEvent) from MyEvent2";
    walker = SupportParserHelper.parseAndWalkEPL(expression, null, variableService);
    raw = walker.getStatementSpec();
    assertTrue(raw.isHasVariables());
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:42,代码来源:TestEPLTreeWalker.java

示例9: makeContext

import com.espertech.esper.epl.variable.VariableServiceImpl; //导入依赖的package包/类
public static StatementContext makeContext(SchedulingService stub)
{
    VariableServiceImpl variableService = new VariableServiceImpl(1000, null, SupportEventAdapterService.getService(), null);
    Configuration config = new Configuration();
    config.getEngineDefaults().getViewResources().setAllowMultipleExpiryPolicies(true);

    StatementContextEngineServices stmtEngineServices = new StatementContextEngineServices("engURI",
            SupportEventAdapterService.getService(),
            new NamedWindowServiceImpl(null, variableService, false, new ManagedReadWriteLock("dummyeplock", true), new ExceptionHandlingService("engURI", Collections.<ExceptionHandler>emptyList(), Collections.<ConditionHandler>emptyList()), false, null),
            null,
            new EngineSettingsService(new Configuration().getEngineDefaults(), new URI[0]),
            new ValueAddEventServiceImpl(),
            config,
            null,
            null,
            null,
            null);

    return new StatementContext(stmtEngineServices,
            "stmtId",
            null,
            "stmtName",
            "exprHere",
            stub,
            new ScheduleBucket(1),
            null,
            new ViewResolutionServiceImpl(new PluggableObjectRegistryImpl(new PluggableObjectCollection[] {ViewEnumHelper.getBuiltinViews()}), null, null),
            new PatternObjectResolutionServiceImpl(null),
            null,
            null,
            new MethodResolutionServiceImpl(new EngineImportServiceImpl(true, true, true), null),
            null,
            null,
            new StatementResultServiceImpl("name", null, null, new ThreadingServiceImpl(new ConfigurationEngineDefaults.Threading())), // statement result svc
            null,
            null,
            null,
            null,
            null,
            null,
            false,
            null,
            null,
            AggregationServiceFactoryServiceImpl.DEFAULT_FACTORY);
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:46,代码来源:SupportStatementContextFactory.java

示例10: makeWalker

import com.espertech.esper.epl.variable.VariableServiceImpl; //导入依赖的package包/类
public static EPLTreeWalker makeWalker(Tree tree, CommonTokenStream tokenStream)
{
    return makeWalker(tree, tokenStream, new EngineImportServiceImpl(true, true, true), new VariableServiceImpl(0, null, SupportEventAdapterService.getService(), null));
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:5,代码来源:SupportEPLTreeWalkerFactory.java

示例11: parseAndWalkEPL

import com.espertech.esper.epl.variable.VariableServiceImpl; //导入依赖的package包/类
public static EPLTreeWalker parseAndWalkEPL(String expression) throws Exception
{
    return parseAndWalkEPL(expression, new EngineImportServiceImpl(true, true, true), new VariableServiceImpl(0, null, SupportEventAdapterService.getService(), null));
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:5,代码来源:TestEPLTreeWalker.java


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