Package com.espertech.esper.util

Examples of com.espertech.esper.util.StopCallback


            throws ExprValidationException
    {
        // Handle joins
        final JoinSetComposerDesc composerDesc = statementContext.getJoinSetComposerFactory().makeComposer(statementSpec.getOuterJoinDescList(), statementSpec.getFilterRootNode(), streamTypes, streamNames, streamViews, selectStreamSelectorEnum, joinAnalysisResult, statementContext, queryPlanLogging, statementContext.getAnnotations());

        stopCallbacks.add(new StopCallback(){
            public void stop()
            {
                composerDesc.getJoinSetComposer().destroy();
            }
        });
View Full Code Here


            // if using variables, register a callback on the change of the variable
            for (String variableName : parent.getVariableNames())
            {
                final String theVariableName = variableName;
                agentInstanceContext.getStatementContext().getVariableService().registerCallback(variableName, agentInstanceContext.getAgentInstanceId(), this);
                agentInstanceContext.addTerminationCallback(new StopCallback() {
                    public void stop() {
                        agentInstanceContext.getStatementContext().getVariableService().unregisterCallback(theVariableName, agentInstanceContext.getAgentInstanceId(), OutputConditionExpression.this);
                    }
                });
            }
View Full Code Here

            for (String variable : variableNames) {
                final String variableName = variable;
                final int agentInstanceId = agentInstanceContext.getAgentInstanceId();
                final VariableService variableService = agentInstanceContext.getStatementContext().getVariableService();
                agentInstanceContext.getStatementContext().getVariableService().registerCallback(variable, agentInstanceId, this);
                agentInstanceContext.addTerminationCallback(new StopCallback() {
                    public void stop() {
                        variableService.unregisterCallback(variableName, agentInstanceId, ExpressionViewBase.this);
                    }
                });
            }
View Full Code Here

        // Without context - start here
        else {
            StatementAgentInstanceFactorySelectResult resultOfStart = selectDesc.getStatementAgentInstanceFactorySelect().newContext(defaultAgentInstanceContext, isRecoveringResilient);
            finalViewable = resultOfStart.getFinalView();
            final EPStatementStopMethod selectStop = selectDesc.getStopMethod();
            final StopCallback startResultStop = resultOfStart.getStopCallback();
            stopStatementMethod = new EPStatementStopMethod() {
                public void stop() {
                    StatementAgentInstanceUtil.stopSafe(startResultStop, statementContext);
                    selectStop.stop();
                }
View Full Code Here

                    throw new IllegalStateException("Failed to find viewable for filter");
                }
                final EPLSelectViewable viewable = found;
                return new ViewableActivator() {
                    public ViewableActivationResult activate(AgentInstanceContext agentInstanceContext, boolean isSubselect, boolean isRecoveringResilient) {
                        return new ViewableActivationResult(viewable, new StopCallback() {public void stop() {}}, null, null, false, false);
                    }
                };
            }
        };
View Full Code Here

        this.eventType = eventType;
    }

    public StatementAgentInstanceFactoryCreateVariableResult newContext(final AgentInstanceContext agentInstanceContext, boolean isRecoveringResilient)
    {
        StopCallback stopCallback = new StopCallback() {
            public void stop() {
                services.getVariableService().deallocateVariableState(variableMetaData.getVariableName(), agentInstanceContext.getAgentInstanceId());
            }
        };
        services.getVariableService().allocateVariableState(variableMetaData.getVariableName(), agentInstanceContext.getAgentInstanceId(), statementContext.getExtensionServicesContext());
View Full Code Here

            else if (joinSetComposer != null) {
                postLoadJoin = new StatementAgentInstancePostLoadIndexVisiting(joinSetComposer.getJoinSetComposer());
            }
        }
        catch (RuntimeException ex) {
            StopCallback stopCallback = StatementAgentInstanceUtil.getStopCallback(stopCallbacks, agentInstanceContext);
            StatementAgentInstanceUtil.stopSafe(stopCallback, statementContext);
            if (InstrumentationHelper.ENABLED) { InstrumentationHelper.get().aContextPartitionAllocate();}
            throw ex;
        }

        StopCallback stopCallback = StatementAgentInstanceUtil.getStopCallback(stopCallbacks, agentInstanceContext);
        return new StatementAgentInstanceFactorySelectResult(finalView, stopCallback, agentInstanceContext, aggregationService, subselectStrategies, priorNodeStrategies, previousNodeStrategies, regexExprPreviousEvalStrategy, preloadList, patternRoots, postLoadJoin, topViews, eventStreamParentViewable);
    }
View Full Code Here

                                                         List<StopCallback> stopCallbacks,
                                                         StreamJoinAnalysisResult joinAnalysisResult)
    {
        final JoinSetComposerDesc joinSetComposerDesc = joinSetComposerPrototype.create(streamViews, false, agentInstanceContext);

        stopCallbacks.add(new StopCallback(){
            public void stop()
            {
                joinSetComposerDesc.getJoinSetComposer().destroy();
            }
        });
View Full Code Here

                onExprView.addView(outputView);
                onExprView = outputView;
            }
        }
        catch (RuntimeException ex) {
            StopCallback stopCallback = StatementAgentInstanceUtil.getStopCallback(stopCallbacks, agentInstanceContext);
            StatementAgentInstanceUtil.stopSafe(stopCallback, statementContext);
            throw ex;
        }

        log.debug(".start Statement start completed");
        StopCallback stopCallback = StatementAgentInstanceUtil.getStopCallback(stopCallbacks, agentInstanceContext);
        return new StatementAgentInstanceFactoryOnTriggerResult(onExprView, stopCallback, agentInstanceContext, aggregationService, subselectStrategies, optPatternRoot);
    }
View Full Code Here

        return false;
    }

    public static StopCallback getStopCallback(List<StopCallback> stopCallbacks, final AgentInstanceContext agentInstanceContext) {
        final StopCallback[] stopCallbackArr = stopCallbacks.toArray(new StopCallback[stopCallbacks.size()]);
        return new StopCallback() {
            public void stop() {
                StatementAgentInstanceUtil.stopSafe(agentInstanceContext.getTerminationCallbackRO(), stopCallbackArr, agentInstanceContext.getStatementContext());
            }
        };
    }
View Full Code Here

TOP

Related Classes of com.espertech.esper.util.StopCallback

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.