本文整理汇总了Java中com.espertech.esper.filter.FilterHandle类的典型用法代码示例。如果您正苦于以下问题:Java FilterHandle类的具体用法?Java FilterHandle怎么用?Java FilterHandle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FilterHandle类属于com.espertech.esper.filter包,在下文中一共展示了FilterHandle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: evaluateFilterForStatement
import com.espertech.esper.filter.FilterHandle; //导入依赖的package包/类
public static boolean evaluateFilterForStatement(EPServicesContext servicesContext, EventBean theEvent, AgentInstanceContext agentInstanceContext, FilterHandle filterHandle) {
// context was created - reevaluate for the given event
ArrayDeque<FilterHandle> callbacks = new ArrayDeque<FilterHandle>();
servicesContext.getFilterService().evaluate(theEvent, callbacks, agentInstanceContext.getStatementContext().getStatementId());
try {
servicesContext.getVariableService().setLocalVersion();
// sub-selects always go first
for (FilterHandle handle : callbacks) {
if (handle.equals(filterHandle)) {
return true;
}
}
agentInstanceContext.getEpStatementAgentInstanceHandle().internalDispatch();
} catch (RuntimeException ex) {
servicesContext.getExceptionHandlingService().handleException(ex, agentInstanceContext.getEpStatementAgentInstanceHandle(), ExceptionHandlerExceptionType.PROCESS, theEvent);
}
return false;
}
示例2: evaluateFilterForStatement
import com.espertech.esper.filter.FilterHandle; //导入依赖的package包/类
public static boolean evaluateFilterForStatement(EPServicesContext servicesContext, EventBean theEvent, AgentInstanceContext agentInstanceContext, FilterHandle filterHandle) {
// context was created - reevaluate for the given event
ArrayDeque<FilterHandle> callbacks = new ArrayDeque<FilterHandle>();
servicesContext.getFilterService().evaluate(theEvent, callbacks, agentInstanceContext.getStatementContext().getStatementId());
try
{
servicesContext.getVariableService().setLocalVersion();
// sub-selects always go first
for (FilterHandle handle : callbacks)
{
if (handle == filterHandle) {
return true;
}
}
agentInstanceContext.getEpStatementAgentInstanceHandle().internalDispatch(agentInstanceContext);
}
catch (RuntimeException ex) {
servicesContext.getExceptionHandlingService().handleException(ex, agentInstanceContext.getEpStatementAgentInstanceHandle());
}
return false;
}
示例3: process
import com.espertech.esper.filter.FilterHandle; //导入依赖的package包/类
private static void process(AgentInstance agentInstance,
EPServicesContext servicesContext,
Collection<FilterHandle> callbacks,
EventBean theEvent) {
AgentInstanceContext agentInstanceContext = agentInstance.getAgentInstanceContext();
agentInstance.getAgentInstanceContext().getAgentInstanceLock().acquireWriteLock();
try {
servicesContext.getVariableService().setLocalVersion();
// sub-selects always go first
for (FilterHandle handle : callbacks) {
EPStatementHandleCallback callback = (EPStatementHandleCallback) handle;
if (callback.getAgentInstanceHandle() != agentInstanceContext.getEpStatementAgentInstanceHandle()) {
continue;
}
callback.getFilterCallback().matchFound(theEvent, null);
}
agentInstanceContext.getEpStatementAgentInstanceHandle().internalDispatch();
} catch (RuntimeException ex) {
servicesContext.getExceptionHandlingService().handleException(ex, agentInstanceContext.getEpStatementAgentInstanceHandle(), ExceptionHandlerExceptionType.PROCESS, theEvent);
} finally {
if (agentInstanceContext.getStatementContext().getEpStatementHandle().isHasTableAccess()) {
agentInstanceContext.getTableExprEvaluatorContext().releaseAcquiredLocks();
}
agentInstanceContext.getAgentInstanceLock().releaseWriteLock();
}
}
示例4: initThreadLocals
import com.espertech.esper.filter.FilterHandle; //导入依赖的package包/类
private void initThreadLocals() {
matchesPerStmtThreadLocal =
new ThreadLocal<Map<EPStatementAgentInstanceHandle, ArrayDeque<FilterHandleCallback>>>() {
protected synchronized Map<EPStatementAgentInstanceHandle, ArrayDeque<FilterHandleCallback>> initialValue() {
if (isPrioritized) {
return new TreeMap<EPStatementAgentInstanceHandle, ArrayDeque<FilterHandleCallback>>(EPStatementAgentInstanceHandleComparator.INSTANCE);
} else {
return new HashMap<EPStatementAgentInstanceHandle, ArrayDeque<FilterHandleCallback>>();
}
}
};
schedulePerStmtThreadLocal = new ThreadLocal<Map<EPStatementAgentInstanceHandle, Object>>() {
protected synchronized Map<EPStatementAgentInstanceHandle, Object> initialValue() {
if (isPrioritized) {
return new TreeMap<EPStatementAgentInstanceHandle, Object>(EPStatementAgentInstanceHandleComparator.INSTANCE);
} else {
return new HashMap<EPStatementAgentInstanceHandle, Object>();
}
}
};
matchesArrayThreadLocal = new ThreadLocal<ArrayBackedCollection<FilterHandle>>() {
protected synchronized ArrayBackedCollection<FilterHandle> initialValue() {
return new ArrayBackedCollection<FilterHandle>(100);
}
};
scheduleArrayThreadLocal = new ThreadLocal<ArrayBackedCollection<ScheduleHandle>>() {
protected synchronized ArrayBackedCollection<ScheduleHandle> initialValue() {
return new ArrayBackedCollection<ScheduleHandle>(100);
}
};
}
示例5: initThreadLocals
import com.espertech.esper.filter.FilterHandle; //导入依赖的package包/类
private void initThreadLocals() {
removeFromThreadLocals();
matchesArrayThreadLocal = new ThreadLocal<ArrayBackedCollection<FilterHandle>>() {
protected synchronized ArrayBackedCollection<FilterHandle> initialValue() {
return new ArrayBackedCollection<FilterHandle>(100);
}
};
scheduleArrayThreadLocal = new ThreadLocal<ArrayBackedCollection<ScheduleHandle>>() {
protected synchronized ArrayBackedCollection<ScheduleHandle> initialValue() {
return new ArrayBackedCollection<ScheduleHandle>(100);
}
};
matchesPerStmtThreadLocal =
new ThreadLocal<Map<EPStatementAgentInstanceHandle, Object>>() {
protected synchronized Map<EPStatementAgentInstanceHandle, Object> initialValue() {
if (isPrioritized) {
return new TreeMap<EPStatementAgentInstanceHandle, Object>(EPStatementAgentInstanceHandleComparator.INSTANCE);
} else {
return new HashMap<EPStatementAgentInstanceHandle, Object>();
}
}
};
schedulePerStmtThreadLocal = new ThreadLocal<Map<EPStatementAgentInstanceHandle, Object>>() {
protected synchronized Map<EPStatementAgentInstanceHandle, Object> initialValue() {
if (isPrioritized) {
return new TreeMap<EPStatementAgentInstanceHandle, Object>(EPStatementAgentInstanceHandleComparator.INSTANCE);
} else {
return new HashMap<EPStatementAgentInstanceHandle, Object>();
}
}
};
}
示例6: evaluateEventForStatementInternal
import com.espertech.esper.filter.FilterHandle; //导入依赖的package包/类
private static void evaluateEventForStatementInternal(EPServicesContext servicesContext, EventBean theEvent, AgentInstanceContext agentInstanceContext) {
// context was created - reevaluate for the given event
ArrayDeque<FilterHandle> callbacks = new ArrayDeque<FilterHandle>();
servicesContext.getFilterService().evaluate(theEvent, callbacks, agentInstanceContext.getStatementContext().getStatementId());
try
{
servicesContext.getVariableService().setLocalVersion();
// sub-selects always go first
for (FilterHandle handle : callbacks)
{
EPStatementHandleCallback callback = (EPStatementHandleCallback) handle;
if (callback.getAgentInstanceHandle() != agentInstanceContext.getEpStatementAgentInstanceHandle()) {
continue;
}
callback.getFilterCallback().matchFound(theEvent, null);
}
agentInstanceContext.getEpStatementAgentInstanceHandle().internalDispatch(agentInstanceContext);
// No thread work queue processing: leave that for later, but dispatch (i.e. no processThreadWorkQueue);
servicesContext.getInternalEventEngineRouteDest().dispatch();
}
catch (RuntimeException ex) {
servicesContext.getExceptionHandlingService().handleException(ex, agentInstanceContext.getEpStatementAgentInstanceHandle());
}
}
示例7: processStatementFilterSingle
import com.espertech.esper.filter.FilterHandle; //导入依赖的package包/类
/**
* Process a single match.
* @param handle statement
* @param handleCallback callback
* @param theEvent event to indicate
* @param version filter version
*/
public void processStatementFilterSingle(EPStatementAgentInstanceHandle handle, EPStatementHandleCallback handleCallback, EventBean theEvent, long version)
{
handle.getStatementAgentInstanceLock().acquireWriteLock(services.getStatementLockFactory());
try
{
if (handle.isHasVariables())
{
services.getVariableService().setLocalVersion();
}
if (!handle.isCurrentFilter(version)) {
if (handle.getFilterFaultHandler() != null) {
handle.getFilterFaultHandler().handleFilterFault(theEvent, version);
}
ArrayDeque<FilterHandle> callbackList = getCallbackList(theEvent, handle.getStatementId());
for (FilterHandle callback : callbackList)
{
EPStatementHandleCallback handleCallbackFilter = (EPStatementHandleCallback) callback;
handleCallbackFilter.getFilterCallback().matchFound(theEvent, null);
}
}
else {
handleCallback.getFilterCallback().matchFound(theEvent, null);
}
// internal join processing, if applicable
handle.internalDispatch(engineFilterAndDispatchTimeContext);
}
catch (RuntimeException ex) {
services.getExceptionHandlingService().handleException(ex, handle);
}
finally
{
handleCallback.getAgentInstanceHandle().getStatementAgentInstanceLock().releaseWriteLock(services.getStatementLockFactory());
}
}
示例8: matchEvent
import com.espertech.esper.filter.FilterHandle; //导入依赖的package包/类
public void matchEvent(EventBean theEvent, Collection<FilterHandle> matches) {
countInvoked++;
lastEvent = theEvent;
lastMatches = matches;
}
示例9: getLastMatches
import com.espertech.esper.filter.FilterHandle; //导入依赖的package包/类
public Collection<FilterHandle> getLastMatches() {
return lastMatches;
}
示例10: setLastMatches
import com.espertech.esper.filter.FilterHandle; //导入依赖的package包/类
public void setLastMatches(List<FilterHandle> lastMatches) {
this.lastMatches = lastMatches;
}
示例11: evaluate
import com.espertech.esper.filter.FilterHandle; //导入依赖的package包/类
public long evaluate(EventBean theEvent, Collection<FilterHandle> matches) {
throw new UnsupportedOperationException();
}
示例12: add
import com.espertech.esper.filter.FilterHandle; //导入依赖的package包/类
public FilterServiceEntry add(FilterValueSet filterValueSet, FilterHandle callback) {
added.add(new Pair<FilterValueSet, FilterHandle>(filterValueSet, callback));
return null;
}
示例13: remove
import com.espertech.esper.filter.FilterHandle; //导入依赖的package包/类
public void remove(FilterHandle callback, FilterServiceEntry filterServiceEntry) {
removed.add(callback);
}
示例14: getAdded
import com.espertech.esper.filter.FilterHandle; //导入依赖的package包/类
public List<Pair<FilterValueSet, FilterHandle>> getAdded() {
return added;
}
示例15: getRemoved
import com.espertech.esper.filter.FilterHandle; //导入依赖的package包/类
public List<FilterHandle> getRemoved() {
return removed;
}