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


Java ViewableDefaultImpl类代码示例

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


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

示例1: startInternal

import com.espertech.esper.view.ViewableDefaultImpl; //导入依赖的package包/类
public EPStatementStartResult startInternal(final EPServicesContext services, final StatementContext statementContext, boolean isNewStatement, boolean isRecoveringStatement, boolean isRecoveringResilient) throws ExprValidationException, ViewProcessingException {
    final CreateSchemaDesc spec = statementSpec.getCreateSchemaDesc();

    EPLValidationUtil.validateTableExists(services.getTableService(), spec.getSchemaName());
    EventType eventType = handleCreateSchema(services, statementContext, spec);

    // enter a reference
    services.getStatementEventTypeRefService().addReferences(statementContext.getStatementName(), new String[]{spec.getSchemaName()});

    final EventType allocatedEventType = eventType;
    EPStatementStopMethod stopMethod = new EPStatementStopMethod() {
        public void stop() {
            services.getStatementEventTypeRefService().removeReferencesStatement(statementContext.getStatementName());
            if (services.getStatementEventTypeRefService().getStatementNamesForType(spec.getSchemaName()).isEmpty()) {
                services.getEventAdapterService().removeType(allocatedEventType.getName());
                services.getFilterService().removeType(allocatedEventType);
            }
        }
    };
    Viewable viewable = new ViewableDefaultImpl(eventType);

    // assign agent instance factory (an empty op)
    statementContext.setStatementAgentInstanceFactory(new StatementAgentInstanceFactoryNoAgentInstance(viewable));

    return new EPStatementStartResult(viewable, stopMethod, null);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:27,代码来源:EPStatementStartMethodCreateSchema.java

示例2: startInternal

import com.espertech.esper.view.ViewableDefaultImpl; //导入依赖的package包/类
public EPStatementStartResult startInternal(final EPServicesContext services, final StatementContext statementContext, boolean isNewStatement, boolean isRecoveringStatement, boolean isRecoveringResilient) throws ExprValidationException, ViewProcessingException {
    final CreateSchemaDesc spec = statementSpec.getCreateSchemaDesc();

    EventType eventType = handleCreateSchema(services, statementContext, spec);

    // enter a reference
    services.getStatementEventTypeRefService().addReferences(statementContext.getStatementName(), Collections.singleton(spec.getSchemaName()));

    final EventType allocatedEventType = eventType;
    EPStatementStopMethod stopMethod = new EPStatementStopMethod() {
        public void stop()
        {
            services.getStatementEventTypeRefService().removeReferencesStatement(statementContext.getStatementName());
            if (services.getStatementEventTypeRefService().getStatementNamesForType(spec.getSchemaName()).isEmpty()) {
                services.getEventAdapterService().removeType(allocatedEventType.getName());
                services.getFilterService().removeType(allocatedEventType);
            }
        }
    };
    Viewable viewable = new ViewableDefaultImpl(eventType);
    return new EPStatementStartResult(viewable, stopMethod, null);
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:23,代码来源:EPStatementStartMethodCreateSchema.java

示例3: startInternal

import com.espertech.esper.view.ViewableDefaultImpl; //导入依赖的package包/类
public EPStatementStartResult startInternal(EPServicesContext services, StatementContext statementContext, boolean isNewStatement, boolean isRecoveringStatement, boolean isRecoveringResilient) throws ExprValidationException, ViewProcessingException {
    final CreateIndexDesc spec = statementSpec.getCreateIndexDesc();
    final NamedWindowProcessor processor = services.getNamedWindowService().getProcessor(spec.getWindowName());
    if (processor == null) {
        throw new ExprValidationException("A named window by name '" + spec.getWindowName() + "' does not exist");
    }
    final NamedWindowProcessorInstance processorInstance = processor.getProcessorInstance(getDefaultAgentInstanceContext(statementContext));

    EPStatementStopMethod stopMethod;
    if (processor.isVirtualDataWindow()) {
        final VirtualDWView virtualDWView = processorInstance.getRootViewInstance().getVirtualDataWindow();
        virtualDWView.handleStartIndex(spec);
        stopMethod = new EPStatementStopMethod() {
            public void stop() {
                virtualDWView.handleStopIndex(spec);
            }
        };
    }
    else {
        processorInstance.getRootViewInstance().addExplicitIndex(spec.isUnique(), spec.getWindowName(), spec.getIndexName(), spec.getColumns());
        stopMethod = new EPStatementStopMethod() {
            public void stop()
            {
                processorInstance.getRootViewInstance().removeExplicitIndex(spec.getIndexName());
            }
        };
    }

    Viewable viewable = new ViewableDefaultImpl(processor.getNamedWindowType());
    return new EPStatementStartResult(viewable, stopMethod, null);
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:32,代码来源:EPStatementStartMethodCreateIndex.java


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