本文整理汇总了Java中com.espertech.esper.core.context.util.ContextDescriptor类的典型用法代码示例。如果您正苦于以下问题:Java ContextDescriptor类的具体用法?Java ContextDescriptor怎么用?Java ContextDescriptor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ContextDescriptor类属于com.espertech.esper.core.context.util包,在下文中一共展示了ContextDescriptor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addConsumer
import com.espertech.esper.core.context.util.ContextDescriptor; //导入依赖的package包/类
public NamedWindowConsumerView addConsumer(NamedWindowConsumerDesc consumerDesc, boolean isSubselect) {
StatementResourceService statementResourceService = statementContextCreateWindow.getStatementExtensionServicesContext().getStmtResources();
// handle same-context consumer
if (this.contextName != null) {
ContextDescriptor contextDescriptor = consumerDesc.getAgentInstanceContext().getStatementContext().getContextDescriptor();
if (contextDescriptor != null && contextName.equals(contextDescriptor.getContextName())) {
StatementResourceHolder holder = statementResourceService.getPartitioned(consumerDesc.getAgentInstanceContext().getAgentInstanceId());
return holder.getNamedWindowProcessorInstance().getTailViewInstance().addConsumer(consumerDesc, isSubselect);
} else {
// consumer is out-of-context
return tailView.addConsumer(consumerDesc); // non-context consumers
}
}
// handle no context associated
return statementResourceService.getResourcesUnpartitioned().getNamedWindowProcessorInstance().getTailViewInstance().addConsumer(consumerDesc, isSubselect);
}
示例2: getExistsDeclaredExpr
import com.espertech.esper.core.context.util.ContextDescriptor; //导入依赖的package包/类
public static ExprDeclaredNodeImpl getExistsDeclaredExpr(String name, List<ExprNode> parameters, Collection<ExpressionDeclItem> expressionDeclarations, ExprDeclaredService exprDeclaredService, ContextDescriptor contextDescriptor) {
// Find among local expressions
if (!expressionDeclarations.isEmpty()) {
for (ExpressionDeclItem declNode : expressionDeclarations) {
if (declNode.getName().equals(name)) {
return new ExprDeclaredNodeImpl(declNode, parameters, contextDescriptor);
}
}
}
// find among global expressions
ExpressionDeclItem found = exprDeclaredService.getExpression(name);
if (found != null) {
return new ExprDeclaredNodeImpl(found, parameters, contextDescriptor);
}
return null;
}
示例3: FilterSpecCompilerArgs
import com.espertech.esper.core.context.util.ContextDescriptor; //导入依赖的package包/类
public FilterSpecCompilerArgs(LinkedHashMap<String, Pair<EventType, String>> taggedEventTypes, LinkedHashMap<String, Pair<EventType, String>> arrayEventTypes, ExprEvaluatorContext exprEvaluatorContext, String statementName, int statementId, StreamTypeService streamTypeService, EngineImportService engineImportService, TimeProvider timeProvider, VariableService variableService, TableService tableService, EventAdapterService eventAdapterService, FilterBooleanExpressionFactory filterBooleanExpressionFactory, Annotation[] annotations, ContextDescriptor contextDescriptor, ConfigurationInformation configurationInformation, StatementExtensionSvcContext statementExtensionSvcContext) {
this.taggedEventTypes = taggedEventTypes;
this.arrayEventTypes = arrayEventTypes;
this.exprEvaluatorContext = exprEvaluatorContext;
this.statementName = statementName;
this.statementId = statementId;
this.streamTypeService = streamTypeService;
this.engineImportService = engineImportService;
this.timeProvider = timeProvider;
this.variableService = variableService;
this.tableService = tableService;
this.eventAdapterService = eventAdapterService;
this.filterBooleanExpressionFactory = filterBooleanExpressionFactory;
this.annotations = annotations;
this.contextDescriptor = contextDescriptor;
this.configurationInformation = configurationInformation;
this.statementExtensionSvcContext = statementExtensionSvcContext;
}
示例4: ContextManagerNested
import com.espertech.esper.core.context.util.ContextDescriptor; //导入依赖的package包/类
public ContextManagerNested(ContextControllerFactoryServiceContext factoryServiceContext)
throws ExprValidationException {
super(factoryServiceContext.getContextName(), factoryServiceContext.getServicesContext());
this.contextPartitionIdManager = factoryServiceContext.getAgentInstanceContextCreate().getStatementContext().getContextControllerFactoryService().allocatePartitionIdMgr(contextName, factoryServiceContext.getAgentInstanceContextCreate().getStatementContext().getStatementId());
nestedContextFactories = factoryServiceContext.getAgentInstanceContextCreate().getStatementContext().getContextControllerFactoryService().getFactory(factoryServiceContext);
StatementAIResourceRegistryFactory resourceRegistryFactory = new StatementAIResourceRegistryFactory() {
public StatementAIResourceRegistry make() {
return new StatementAIResourceRegistry(new AIRegistryAggregationMap(), new AIRegistryExprMap());
}
};
Map<String, Object> contextProps = ContextPropertyEventType.getNestedTypeBase();
for (ContextControllerFactory factory : nestedContextFactories) {
contextProps.put(factory.getFactoryContext().getContextName(), factory.getContextBuiltinProps());
}
EventType contextPropsType = servicesContext.getEventAdapterService().createAnonymousMapType(contextName, contextProps, true);
ContextPropertyRegistryImpl registry = new ContextPropertyRegistryImpl(Collections.<ContextDetailPartitionItem>emptyList(), contextPropsType);
contextDescriptor = new ContextDescriptor(contextName, false, registry, resourceRegistryFactory, this, factoryServiceContext.getDetail());
}
示例5: addConsumer
import com.espertech.esper.core.context.util.ContextDescriptor; //导入依赖的package包/类
public NamedWindowConsumerView addConsumer(NamedWindowConsumerDesc consumerDesc, boolean isSubselect) {
// handle same-context consumer
if (this.contextName != null) {
ContextDescriptor contextDescriptor = consumerDesc.getAgentInstanceContext().getStatementContext().getContextDescriptor();
if (contextDescriptor != null && contextName.equals(contextDescriptor.getContextName())) {
NamedWindowProcessorInstance instance = instances.get(consumerDesc.getAgentInstanceContext().getAgentInstanceId());
return instance.getTailViewInstance().addConsumer(consumerDesc, isSubselect);
}
else {
// consumer is out-of-context
return tailView.addConsumer(consumerDesc); // non-context consumers
}
}
// handle no context associated
return instanceNoContext.getTailViewInstance().addConsumer(consumerDesc, isSubselect);
}
示例6: ExprValidationContext
import com.espertech.esper.core.context.util.ContextDescriptor; //导入依赖的package包/类
public ExprValidationContext(StreamTypeService streamTypeService,
MethodResolutionService methodResolutionService,
ViewResourceDelegateUnverified viewResourceDelegate,
TimeProvider timeProvider,
VariableService variableService,
ExprEvaluatorContext exprEvaluatorContext,
EventAdapterService eventAdapterService,
String statementName,
String statementId,
Annotation[] annotations,
ContextDescriptor contextDescriptor) {
this.streamTypeService = streamTypeService;
this.methodResolutionService = methodResolutionService;
this.viewResourceDelegate = viewResourceDelegate;
this.timeProvider = timeProvider;
this.variableService = variableService;
this.exprEvaluatorContext = exprEvaluatorContext;
this.eventAdapterService = eventAdapterService;
this.statementName = statementName;
this.statementId = statementId;
this.annotations = annotations;
this.contextDescriptor = contextDescriptor;
isExpressionAudit = AuditEnum.EXPRESSION.getAudit(annotations) != null;
isExpressionNestedAudit = AuditEnum.EXPRESSION_NESTED.getAudit(annotations) != null;
}
示例7: ContextManagerNested
import com.espertech.esper.core.context.util.ContextDescriptor; //导入依赖的package包/类
public ContextManagerNested(ContextControllerFactoryServiceContext factoryServiceContext)
throws ExprValidationException
{
this.contextName = factoryServiceContext.getContextName();
this.servicesContext = factoryServiceContext.getServicesContext();
this.contextPartitionIdManager = factoryServiceContext.getAgentInstanceContextCreate().getStatementContext().getContextControllerFactoryService().allocatePartitionIdMgr(contextName, factoryServiceContext.getAgentInstanceContextCreate().getStatementContext().getStatementId());
nestedContextFactories = factoryServiceContext.getAgentInstanceContextCreate().getStatementContext().getContextControllerFactoryService().getFactory(factoryServiceContext);
StatementAIResourceRegistryFactory resourceRegistryFactory = new StatementAIResourceRegistryFactory() {
public StatementAIResourceRegistry make() {
return new StatementAIResourceRegistry(new AIRegistryAggregationMap(), new AIRegistryExprMap());
}
};
Map<String, Object> contextProps = ContextPropertyEventType.getNestedTypeBase();
for (ContextControllerFactory factory : nestedContextFactories) {
contextProps.put(factory.getFactoryContext().getContextName(), factory.getContextBuiltinProps());
}
EventType contextPropsType = servicesContext.getEventAdapterService().createAnonymousMapType(contextName, contextProps);
ContextPropertyRegistryImpl registry = new ContextPropertyRegistryImpl(Collections.<ContextDetailPartitionItem>emptyList(), contextPropsType);
contextDescriptor = new ContextDescriptor(contextName, false, registry, resourceRegistryFactory, this, factoryServiceContext.getDetail());
}
示例8: ExprDeclaredNodeImpl
import com.espertech.esper.core.context.util.ContextDescriptor; //导入依赖的package包/类
public ExprDeclaredNodeImpl(ExpressionDeclItem prototype, List<ExprNode> chainParameters, ContextDescriptor contextDescriptor) {
this.prototype = prototype;
this.chainParameters = chainParameters;
// copy expression - we do it at this time and not later
try {
expressionBodyCopy = (ExprNode) SerializableObjectCopier.copy(prototype.getInner());
} catch (Exception e) {
throw new RuntimeException("Internal error providing expression tree: " + e.getMessage(), e);
}
// replace context-properties where they are currently identifiers
if (contextDescriptor == null) {
return;
}
ExprNodeIdentVisitorWParent visitorWParent = new ExprNodeIdentVisitorWParent();
expressionBodyCopy.accept(visitorWParent);
for (Pair<ExprNode, ExprIdentNode> pair : visitorWParent.getIdentNodes()) {
String streamOrProp = pair.getSecond().getStreamOrPropertyName();
if (streamOrProp != null && contextDescriptor.getContextPropertyRegistry().isContextPropertyPrefix(streamOrProp)) {
ExprContextPropertyNodeImpl context = new ExprContextPropertyNodeImpl(pair.getSecond().getUnresolvedPropertyName());
if (pair.getFirst() == null) {
expressionBodyCopy = context;
} else {
ExprNodeUtilityCore.replaceChildNode(pair.getFirst(), pair.getSecond(), context);
}
}
}
}
示例9: StatementSpecMapContext
import com.espertech.esper.core.context.util.ContextDescriptor; //导入依赖的package包/类
public StatementSpecMapContext(EngineImportService engineImportService, VariableService variableService, ConfigurationInformation configuration, String engineURI, PatternNodeFactory patternNodeFactory, NamedWindowMgmtService namedWindowMgmtService, ContextManagementService contextManagementService, ExprDeclaredService exprDeclaredService, ContextDescriptor contextDescriptor, TableService tableService) {
this.engineImportService = engineImportService;
this.variableService = variableService;
this.configuration = configuration;
this.variableNames = new HashSet<String>();
this.engineURI = engineURI;
this.patternNodeFactory = patternNodeFactory;
this.namedWindowMgmtService = namedWindowMgmtService;
this.contextManagementService = contextManagementService;
this.exprDeclaredService = exprDeclaredService;
this.contextDescriptor = contextDescriptor;
this.tableService = tableService;
}
示例10: buildNoStmtCtx
import com.espertech.esper.core.context.util.ContextDescriptor; //导入依赖的package包/类
public static FilterSpecCompiled buildNoStmtCtx(List<ExprNode> validatedFilterNodes,
EventType eventType,
String eventTypeName,
PropertyEvalSpec optionalPropertyEvalSpec,
LinkedHashMap<String, Pair<EventType, String>> taggedEventTypes,
LinkedHashMap<String, Pair<EventType, String>> arrayEventTypes,
StreamTypeService streamTypeService,
String optionalStreamName,
Collection<Integer> assignedTypeNumberStack,
ExprEvaluatorContext exprEvaluatorContext,
int statementId,
String statementName,
Annotation[] annotations,
ContextDescriptor contextDescriptor,
EngineImportService engineImportService,
EventAdapterService eventAdapterService,
FilterBooleanExpressionFactory filterBooleanExpressionFactory,
TimeProvider timeProvider,
VariableService variableService,
TableService tableService,
ConfigurationInformation configurationInformation,
NamedWindowMgmtService namedWindowMgmtService,
StatementExtensionSvcContext statementExtensionSvcContext) throws ExprValidationException {
FilterSpecCompilerArgs args = new FilterSpecCompilerArgs(taggedEventTypes, arrayEventTypes, exprEvaluatorContext, statementName, statementId, streamTypeService, engineImportService, timeProvider, variableService, tableService, eventAdapterService, filterBooleanExpressionFactory, annotations, contextDescriptor, configurationInformation, statementExtensionSvcContext);
List<FilterSpecParam>[] parameters = FilterSpecCompilerPlanner.planFilterParameters(validatedFilterNodes, args);
PropertyEvaluator optionalPropertyEvaluator = null;
if (optionalPropertyEvalSpec != null) {
optionalPropertyEvaluator = PropertyEvaluatorFactory.makeEvaluator(optionalPropertyEvalSpec, eventType, optionalStreamName, eventAdapterService, engineImportService, timeProvider, variableService, tableService, streamTypeService.getEngineURIQualifier(), statementId, statementName, annotations, assignedTypeNumberStack, configurationInformation, namedWindowMgmtService, statementExtensionSvcContext);
}
FilterSpecCompiled spec = new FilterSpecCompiled(eventType, eventTypeName, parameters, optionalPropertyEvaluator);
if (log.isDebugEnabled()) {
log.debug(".makeFilterSpec spec=" + spec);
}
return spec;
}
示例11: ContextManagerImpl
import com.espertech.esper.core.context.util.ContextDescriptor; //导入依赖的package包/类
public ContextManagerImpl(ContextControllerFactoryServiceContext factoryServiceContext)
throws ExprValidationException {
super(factoryServiceContext.getContextName(), factoryServiceContext.getServicesContext());
this.factory = factoryServiceContext.getAgentInstanceContextCreate().getStatementContext().getContextControllerFactoryService().getFactory(factoryServiceContext)[0];
this.rootContext = factory.createNoCallback(0, this); // single instance: created here and activated/deactivated later
this.contextPartitionIdManager = factoryServiceContext.getAgentInstanceContextCreate().getStatementContext().getContextControllerFactoryService().allocatePartitionIdMgr(contextName, factoryServiceContext.getAgentInstanceContextCreate().getStatementContext().getStatementId());
StatementAIResourceRegistryFactory resourceRegistryFactory = factory.getStatementAIResourceRegistryFactory();
Map<String, Object> contextProps = factory.getContextBuiltinProps();
EventType contextPropsType = servicesContext.getEventAdapterService().createAnonymousMapType(contextName, contextProps, true);
ContextPropertyRegistryImpl registry = new ContextPropertyRegistryImpl(factory.getContextDetailPartitionItems(), contextPropsType);
contextDescriptor = new ContextDescriptor(contextName, factory.isSingleInstanceContext(), registry, resourceRegistryFactory, this, factory.getContextDetail());
}
示例12: getContextDescriptor
import com.espertech.esper.core.context.util.ContextDescriptor; //导入依赖的package包/类
public ContextDescriptor getContextDescriptor(String contextName) {
ContextManagerEntry entry = contexts.get(contextName);
if (entry == null) {
return null;
}
return entry.getContextManager().getContextDescriptor();
}
示例13: ContextManagerImpl
import com.espertech.esper.core.context.util.ContextDescriptor; //导入依赖的package包/类
public ContextManagerImpl(ContextControllerFactoryServiceContext factoryServiceContext)
throws ExprValidationException {
this.contextName = factoryServiceContext.getContextName();
this.servicesContext = factoryServiceContext.getServicesContext();
this.factory = factoryServiceContext.getAgentInstanceContextCreate().getStatementContext().getContextControllerFactoryService().getFactory(factoryServiceContext)[0];
this.rootContext = factory.createNoCallback(0, this); // single instance: created here and activated/deactivated later
this.contextPartitionIdManager = factoryServiceContext.getAgentInstanceContextCreate().getStatementContext().getContextControllerFactoryService().allocatePartitionIdMgr(contextName, factoryServiceContext.getAgentInstanceContextCreate().getStatementContext().getStatementId());
StatementAIResourceRegistryFactory resourceRegistryFactory = factory.getStatementAIResourceRegistryFactory();
Map<String, Object> contextProps = factory.getContextBuiltinProps();
EventType contextPropsType = servicesContext.getEventAdapterService().createAnonymousMapType(contextName, contextProps);
ContextPropertyRegistryImpl registry = new ContextPropertyRegistryImpl(factory.getContextDetailPartitionItems(), contextPropsType);
contextDescriptor = new ContextDescriptor(contextName, factory.isSingleInstanceContext(), registry, resourceRegistryFactory, this, factory.getContextDetail());
}
示例14: checkVariableContextName
import com.espertech.esper.core.context.util.ContextDescriptor; //导入依赖的package包/类
public static String checkVariableContextName(ContextDescriptor contextDescriptor, VariableMetaData variableMetaData) {
if (contextDescriptor == null) {
return checkVariableContextName((String) null, variableMetaData);
}
return checkVariableContextName(contextDescriptor.getContextName(), variableMetaData);
}
示例15: getContextDescriptor
import com.espertech.esper.core.context.util.ContextDescriptor; //导入依赖的package包/类
public ContextDescriptor getContextDescriptor() {
return contextDescriptor;
}