本文整理汇总了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);
}
示例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);
}
示例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);
}