當前位置: 首頁>>代碼示例>>Java>>正文


Java OutputProcessViewTerminable類代碼示例

本文整理匯總了Java中com.espertech.esper.epl.view.OutputProcessViewTerminable的典型用法代碼示例。如果您正苦於以下問題:Java OutputProcessViewTerminable類的具體用法?Java OutputProcessViewTerminable怎麽用?Java OutputProcessViewTerminable使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


OutputProcessViewTerminable類屬於com.espertech.esper.epl.view包,在下文中一共展示了OutputProcessViewTerminable類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: stop

import com.espertech.esper.epl.view.OutputProcessViewTerminable; //導入依賴的package包/類
public static void stop(StopCallback stopCallback, AgentInstanceContext agentInstanceContext, Viewable finalView, EPServicesContext servicesContext, boolean isStatementStop) {

        // obtain statement lock
        StatementAgentInstanceLock lock = agentInstanceContext.getEpStatementAgentInstanceHandle().getStatementAgentInstanceLock();
        lock.acquireWriteLock(null);
        try {
            if (finalView instanceof OutputProcessViewTerminable && !isStatementStop) {
                OutputProcessViewTerminable terminable = (OutputProcessViewTerminable) finalView;
                terminable.terminated();
            }

            stopSafe(stopCallback, agentInstanceContext.getStatementContext());

            if (servicesContext.getSchedulableAgentInstanceDirectory() != null) {
                servicesContext.getSchedulableAgentInstanceDirectory().remove(agentInstanceContext.getStatementContext().getStatementId(), agentInstanceContext.getAgentInstanceId());
            }

            // indicate method resolution
            agentInstanceContext.getStatementContext().getMethodResolutionService().destroyedAgentInstance(agentInstanceContext.getAgentInstanceId());

            // release resource
            agentInstanceContext.getStatementContext().getStatementAgentInstanceRegistry().deassign(agentInstanceContext.getAgentInstanceId());

            // cause any remaining schedules, that may concide with the caller's schedule, to be ignored
            agentInstanceContext.getEpStatementAgentInstanceHandle().setDestroyed(true);

            // cause any filters, that may concide with the caller's filters, to be ignored
            agentInstanceContext.getEpStatementAgentInstanceHandle().getStatementFilterVersion().setStmtFilterVersion(Long.MAX_VALUE);

            if (agentInstanceContext.getStatementContext().getExtensionServicesContext() != null) {
                agentInstanceContext.getStatementContext().getExtensionServicesContext().endContextPartition(agentInstanceContext.getAgentInstanceId());
            }
        }
        finally {
            lock.releaseWriteLock(null);
        }
    }
 
開發者ID:mobile-event-processing,項目名稱:Asper,代碼行數:38,代碼來源:StatementAgentInstanceUtil.java

示例2: stop

import com.espertech.esper.epl.view.OutputProcessViewTerminable; //導入依賴的package包/類
public static void stop(StopCallback stopCallback, AgentInstanceContext agentInstanceContext, Viewable finalView, EPServicesContext servicesContext, boolean isStatementStop, boolean leaveLocksAcquired, boolean removedStatementResources) {

        if (InstrumentationHelper.ENABLED) {
            InstrumentationHelper.get().qContextPartitionDestroy(agentInstanceContext);
        }
        // obtain statement lock
        StatementAgentInstanceLock lock = agentInstanceContext.getEpStatementAgentInstanceHandle().getStatementAgentInstanceLock();
        lock.acquireWriteLock();
        try {
            if (finalView instanceof OutputProcessViewTerminable && !isStatementStop) {
                OutputProcessViewTerminable terminable = (OutputProcessViewTerminable) finalView;
                terminable.terminated();
            }

            stopSafe(stopCallback, agentInstanceContext.getStatementContext());

            // release resource
            agentInstanceContext.getStatementContext().getStatementAgentInstanceRegistry().deassign(agentInstanceContext.getAgentInstanceId());

            // cause any remaining schedules, that may concide with the caller's schedule, to be ignored
            agentInstanceContext.getEpStatementAgentInstanceHandle().setDestroyed(true);

            // cause any filters, that may concide with the caller's filters, to be ignored
            agentInstanceContext.getEpStatementAgentInstanceHandle().getStatementFilterVersion().setStmtFilterVersion(Long.MAX_VALUE);

            if (removedStatementResources &&
                    agentInstanceContext.getStatementContext().getStatementExtensionServicesContext() != null &&
                    agentInstanceContext.getStatementContext().getStatementExtensionServicesContext().getStmtResources() != null) {
                agentInstanceContext.getStatementContext().getStatementExtensionServicesContext().getStmtResources().deallocatePartitioned(agentInstanceContext.getAgentInstanceId());
            }
        } finally {
            if (!leaveLocksAcquired) {
                if (agentInstanceContext.getStatementContext().getEpStatementHandle().isHasTableAccess()) {
                    agentInstanceContext.getTableExprEvaluatorContext().releaseAcquiredLocks();
                }
                lock.releaseWriteLock();
            }
            if (InstrumentationHelper.ENABLED) {
                InstrumentationHelper.get().aContextPartitionDestroy();
            }
        }
    }
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:43,代碼來源:StatementAgentInstanceUtil.java


注:本文中的com.espertech.esper.epl.view.OutputProcessViewTerminable類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。