Examples of StopCallback


Examples of com.espertech.esper.util.StopCallback

    }

    public StatementAgentInstanceFactoryOnTriggerResult newContext(final AgentInstanceContext agentInstanceContext)
    {
        final List<StopCallback> stopCallbacks = new ArrayList<StopCallback>();
        StopCallback stopCallback = new StopCallback() {
            public void stop() {
                StatementAgentInstanceUtil.stopSafe(agentInstanceContext.getTerminationCallbacks(), stopCallbacks, statementContext);
            }
        };
View Full Code Here

Examples of com.espertech.esper.util.StopCallback

    }

    public StatementAgentInstanceFactoryUpdateResult newContext(final AgentInstanceContext agentInstanceContext)
    {
        final List<StopCallback> stopCallbacks = new ArrayList<StopCallback>();
        StopCallback stopCallback = new StopCallback() {
            public void stop() {
                StatementAgentInstanceUtil.stopSafe(agentInstanceContext.getTerminationCallbacks(), stopCallbacks, statementContext);
            }
        };

        Map<ExprSubselectNode, SubSelectStrategyHolder> subselectStrategies;

        try {
            stopCallbacks.add(new StopCallback()
            {
                public void stop()
                {
                    services.getInternalEventRouter().removePreprocessing(streamEventType, desc);
                }
View Full Code Here

Examples of com.espertech.esper.util.StopCallback

        boolean isBatchingDataWindow = determineBatchingDataWindow(unmaterializedViewChain.getViewFactoryChain());
        final VirtualDWViewFactory virtualDataWindowFactory = determineVirtualDataWindow(unmaterializedViewChain.getViewFactoryChain());
        NamedWindowProcessor processor = services.getNamedWindowService().addProcessor(windowName, contextName, singleInstanceContext, filterStreamSpec.getFilterSpec().getResultEventType(), statementContext.getStatementResultService(), optionalRevisionProcessor, statementContext.getExpression(), statementContext.getStatementName(), isPrioritized, isEnableSubqueryIndexShare, isBatchingDataWindow, virtualDataWindowFactory != null, statementContext.getEpStatementHandle().getMetricsHandle());

        // add stop callback
        stopCallbacks.add(new StopCallback() {
            public void stop() {
                services.getNamedWindowService().removeProcessor(windowName);
                if (virtualDataWindowFactory != null) {
                    virtualDataWindowFactory.destroyNamedWindow();
                }
View Full Code Here

Examples of com.espertech.esper.util.StopCallback

                    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);
                    }
                };
            }
        };
View Full Code Here

Examples of com.espertech.esper.util.StopCallback

        if (services.getSchedulableAgentInstanceDirectory() != null) {
            services.getSchedulableAgentInstanceDirectory().add(agentInstanceContext.getEpStatementAgentInstanceHandle());
        }

        final List<StopCallback> stopCallbacks = new ArrayList<StopCallback>();
        StopCallback stopCallback = new StopCallback() {
            public void stop() {
                StatementAgentInstanceUtil.stopSafe(agentInstanceContext.getTerminationCallbacks(), stopCallbacks, statementContext);
            }
        };
View Full Code Here

Examples of com.espertech.esper.util.StopCallback

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

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

Examples of com.espertech.esper.util.StopCallback

    }

    public StatementAgentInstanceFactoryOnTriggerResult newContext(final AgentInstanceContext agentInstanceContext, boolean isRecoveringResilient)
    {
        final List<StopCallback> stopCallbacks = new ArrayList<StopCallback>();
        StopCallback stopCallback = new StopCallback() {
            public void stop() {
                StatementAgentInstanceUtil.stopSafe(agentInstanceContext.getTerminationCallbacks(), stopCallbacks, statementContext);
            }
        };
View Full Code Here

Examples of com.espertech.esper.util.StopCallback

        EPStatementStopMethod stopStatementMethod;
        EPStatementDestroyMethod destroyStatementMethod;

        try {
            // add stop callback
            stopCallbacks.add(new StopCallback() {
                public void stop() {
                    services.getNamedWindowService().removeProcessor(windowName);
                    if (virtualDataWindowFactory != null) {
                        virtualDataWindowFactory.destroyNamedWindow();
                    }
View Full Code Here

Examples of com.espertech.esper.util.StopCallback

            validateNoAggregations(validated, "Aggregation functions may not be used within an update-clause");
        }

        InternalRoutePreprocessView onExprView = new InternalRoutePreprocessView(streamEventType, statementContext.getStatementResultService());
        services.getInternalEventRouter().addPreprocessing(streamEventType, desc, statementSpec.getAnnotations(), onExprView);
        stopCallbacks.add(new StopCallback()
        {
            public void stop()
            {
                services.getInternalEventRouter().removePreprocessing(streamEventType, desc);
            }
View Full Code Here

Examples of com.espertech.esper.util.StopCallback

        // Materialize views
        Viewable finalView = services.getViewService().createViews(rootView, unmaterializedViewChain.getViewFactoryChain(), statementContext);

        // If this is a virtual data window implementation, bind it to the context for easy lookup
        StopCallback envStopCallback = null;
        if (finalView instanceof VirtualDWView) {
            final String objectName = "/virtualdw/" + windowName;
            final VirtualDWView virtualDWView = (VirtualDWView) finalView;
            try {
                services.getEngineEnvContext().bind(objectName, virtualDWView.getVirtualDataWindow());
            }
            catch (NamingException e) {
                throw new ViewProcessingException("Invalid name for adding to context:" + e.getMessage(), e);
            }
            envStopCallback = new StopCallback() {
                public void stop() {
                    try {
                        virtualDWView.destroy();
                        services.getEngineEnvContext().unbind(objectName);
                    } catch (NamingException e) {}
                }
            };
        }
        final StopCallback environmentStopCallback = envStopCallback;

        // create stop method using statement stream specs
        EPStatementStopMethod stopMethod = new EPStatementStopMethod()
        {
            public void stop()
            {
                statementContext.getStatementStopService().fireStatementStopped();
                boolean filterSubselectSameStream = determineSubquerySameStream(filterStreamSpec);
                services.getStreamService().dropStream(filterStreamSpec.getFilterSpec(), statementContext.getFilterService(), false,false, true, filterSubselectSameStream);
                String windowName = statementSpec.getCreateWindowDesc().getWindowName();
                try {
                    NamedWindowProcessor processor = services.getNamedWindowService().getProcessor(windowName);
                    if (processor.isVirtualDataWindow()) {
                        processor.getVirtualDataWindow().handleStopWindow();
                    }
                } catch (ExprValidationException e) {
                    log.warn("Named window processor by name '" + windowName + "' has not been found");
                }
                services.getNamedWindowService().removeProcessor(windowName);
                if (environmentStopCallback != null) {
                    environmentStopCallback.stop();
                }
            }
        };

        // Attach tail view
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.