當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。