本文整理汇总了Java中com.espertech.esper.filter.FilterSpecParam类的典型用法代码示例。如果您正苦于以下问题:Java FilterSpecParam类的具体用法?Java FilterSpecParam怎么用?Java FilterSpecParam使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FilterSpecParam类属于com.espertech.esper.filter包,在下文中一共展示了FilterSpecParam类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: make
import com.espertech.esper.filter.FilterSpecParam; //导入依赖的package包/类
public static FilterStreamSpecification make(FilterStreamSpecCompiled fssc){
FilterStreamSpecification fss=new FilterStreamSpecification(fssc);
fss.setEventTypeName(fss.filterStreamSpec.getFilterSpec().getFilterForEventTypeName());
fss.setOptionalStreamName(fss.filterStreamSpec.getOptionalStreamName());
ViewSpecification[] vss=ViewSpecification.Factory.makeViewSpecs(fss.filterStreamSpec.getViewSpecs());
fss.setViewSpecs(vss);
FilterSpecCompiled fsc=fss.filterStreamSpec.getFilterSpec();
FilterSpecParam[] fsps=fsc.getParameters();
if(fsps!=null && fsps.length>0){
// if(fsps[0] instanceof FilterSpecParamExprNode){
// FilterSpecParamExprNode fspen=(FilterSpecParamExprNode)fsps[0];
// fss.filterExpr=(IBooleanExpression)(ExpressionFactory.toExpression(fspen.getExprNode()));
// }
fss.filterExpr=FilterFactory.toBooleanExpression(fsps, fss.getOptionalStreamName());
}
return fss;
}
示例2: getAuditProxy
import com.espertech.esper.filter.FilterSpecParam; //导入依赖的package包/类
public static EventStream getAuditProxy(String engineURI, String statementName, Annotation[] annotations, FilterSpecCompiled filterSpec, EventStream designated) {
Audit audit = AuditEnum.STREAM.getAudit(annotations);
if (audit == null) {
return designated;
}
StringWriter filterAndParams = new StringWriter();
filterAndParams.write(filterSpec.getFilterForEventType().getName());
if (filterSpec.getParameters() != null && !filterSpec.getParameters().isEmpty()) {
filterAndParams.write('(');
String delimiter = "";
for (FilterSpecParam param : filterSpec.getParameters()) {
filterAndParams.write(delimiter);
filterAndParams.write(param.getLookupable().getExpression());
filterAndParams.write(param.getFilterOperator().getTextualOp());
filterAndParams.write("...");
delimiter = ",";
}
filterAndParams.write(')');
}
return (EventStream) EventStreamProxy.newInstance(engineURI, statementName, filterAndParams.toString(), designated);
}
示例3: registerAdapter
import com.espertech.esper.filter.FilterSpecParam; //导入依赖的package包/类
/**
* Register an adapter.
* @param epService engine
*/
public void registerAdapter(EPServiceProvider epService)
{
EPServiceProviderSPI spi = (EPServiceProviderSPI) epService;
EventType eventType = spi.getEventAdapterService().getExistsTypeByName(eventTypeName);
FilterValueSet fvs = new FilterSpecCompiled(eventType, null, new LinkedList<FilterSpecParam>(), null).getValueSet(null, null, null);
String name = "subscription:" + subscriptionName;
StatementMetricHandle metricsHandle = spi.getMetricReportingService().getStatementHandle(name, name);
EPStatementHandle statementHandle = new EPStatementHandle(name, name, name, name, false, metricsHandle, 0, false);
EPStatementAgentInstanceHandle agentHandle = new EPStatementAgentInstanceHandle(statementHandle, new StatementAgentInstanceRWLockImpl(name, false), -1, new StatementAgentInstanceFilterVersion());
EPStatementHandleCallback registerHandle = new EPStatementHandleCallback(agentHandle, this);
spi.getFilterService().add(fvs, registerHandle);
}