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


Java FilterHandle类代码示例

本文整理汇总了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;
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:24,代码来源:StatementAgentInstanceUtil.java

示例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;
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:26,代码来源:StatementAgentInstanceUtil.java

示例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();
    }
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:29,代码来源:StatementAgentInstanceUtil.java

示例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);
        }
    };
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:35,代码来源:EPRuntimeIsolatedImpl.java

示例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>();
            }
        }
    };
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:37,代码来源:EPRuntimeImpl.java

示例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());
    }
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:28,代码来源:StatementAgentInstanceUtil.java

示例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());
    }
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:44,代码来源:EPRuntimeImpl.java

示例8: matchEvent

import com.espertech.esper.filter.FilterHandle; //导入依赖的package包/类
public void matchEvent(EventBean theEvent, Collection<FilterHandle> matches) {
    countInvoked++;
    lastEvent = theEvent;
    lastMatches = matches;
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:6,代码来源:SupportEventEvaluator.java

示例9: getLastMatches

import com.espertech.esper.filter.FilterHandle; //导入依赖的package包/类
public Collection<FilterHandle> getLastMatches() {
    return lastMatches;
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:4,代码来源:SupportEventEvaluator.java

示例10: setLastMatches

import com.espertech.esper.filter.FilterHandle; //导入依赖的package包/类
public void setLastMatches(List<FilterHandle> lastMatches) {
    this.lastMatches = lastMatches;
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:4,代码来源:SupportEventEvaluator.java

示例11: evaluate

import com.espertech.esper.filter.FilterHandle; //导入依赖的package包/类
public long evaluate(EventBean theEvent, Collection<FilterHandle> matches) {
    throw new UnsupportedOperationException();
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:4,代码来源:SupportFilterServiceImpl.java

示例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;
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:5,代码来源:SupportFilterServiceImpl.java

示例13: remove

import com.espertech.esper.filter.FilterHandle; //导入依赖的package包/类
public void remove(FilterHandle callback, FilterServiceEntry filterServiceEntry) {
    removed.add(callback);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:4,代码来源:SupportFilterServiceImpl.java

示例14: getAdded

import com.espertech.esper.filter.FilterHandle; //导入依赖的package包/类
public List<Pair<FilterValueSet, FilterHandle>> getAdded() {
    return added;
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:4,代码来源:SupportFilterServiceImpl.java

示例15: getRemoved

import com.espertech.esper.filter.FilterHandle; //导入依赖的package包/类
public List<FilterHandle> getRemoved() {
    return removed;
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:4,代码来源:SupportFilterServiceImpl.java


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