Exemplo n.º 1
0
        public static void StopSafe(
            AgentInstanceMgmtCallback stopMethod,
            AgentInstanceContext agentInstanceContext)
        {
            var stopServices = new AgentInstanceStopServices(agentInstanceContext);

            var additionalTerminations = agentInstanceContext.TerminationCallbackRO;
            foreach (var stop in additionalTerminations) {
                try {
                    stop.Stop(stopServices);
                }
                catch (EPException) {
                    throw;
                }
                catch (Exception e) {
                    HandleStopException(e, agentInstanceContext);
                }
            }

            try {
                stopMethod.Stop(stopServices);
            }
            catch (EPException) {
                throw;
            }
            catch (Exception e) {
                HandleStopException(e, agentInstanceContext);
            }
        }
Exemplo n.º 2
0
            public void Stop(AgentInstanceStopServices services)
            {
                var instance = _namedWindow.GetNamedWindowInstance(services.AgentInstanceContext);
                if (instance == null) {
                    Log.Warn("Named window processor by name '" + _namedWindow.Name + "' has not been found");
                }
                else {
                    instance.Destroy();
                }

                _optionalEnvStopCallback?.Stop(services);
            }