public override void stop(StopContext context) { ManagedReference reference = null; try { // get the process application component ProcessApplicationInterface processApplication = null; ComponentView componentView = paComponentViewInjector.OptionalValue; if (componentView != null) { reference = componentView.createInstance(); processApplication = (ProcessApplicationInterface)reference.Instance; } else { processApplication = noViewProcessApplication.Value; } invokePreUndeploy(processApplication); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Exception while stopping process application", e); } finally { if (reference != null) { reference.release(); } } }
protected override async Task StopAgent(StopContext context) { LogContext.Debug?.Log("Stopping consumer: {InputAddress}", _context.InputAddress); SetCompleted(ActiveAndActualAgentsCompleted(context)); await Completed.ConfigureAwait(false); }
async Task IAgent.Stop(StopContext context) { LogContext.Current = DefaultLogContext; await _receiveEndpoints.Stop(context).ConfigureAwait(false); await base.Stop(context).ConfigureAwait(false); }
protected override async Task StopAgent(StopContext context) { await _limit.WaitAsync(context.CancellationToken).ConfigureAwait(false); await base.StopAgent(context).ConfigureAwait(false); _limit.Release(1); }
async Task IAgent.Stop(StopContext context) { LogContext.Current = _hostConfiguration.LogContext; await ReceiveEndpoints.Stop(context).ConfigureAwait(false); await base.Stop(context).ConfigureAwait(false); }
protected override async Task StopAgent(StopContext context) { await _endpoints.Stop(context.CancellationToken).ConfigureAwait(false); await _supervisor.Stop(context).ConfigureAwait(false); await base.StopAgent(context).ConfigureAwait(false); }
protected override async Task StopAgent(StopContext context) { await base.StopAgent(context).ConfigureAwait(false); if (_messageFabric.IsValueCreated) { await _messageFabric.Value.DisposeAsync().ConfigureAwait(false); } }
/// <inheritdoc /> protected override async Task StopAgent(StopContext context) { if (_contextHandle.Context.Status == TaskStatus.RanToCompletion) { await _contextHandle.DisposeAsync(context.CancellationToken).ConfigureAwait(false); } SetCompleted(TaskUtil.Completed); }
Task IAgent.Stop(StopContext context) { if (_host == null) { throw new InvalidOperationException("The host is not ready."); } return(_host.Stop(context)); }
protected override async Task StopAgent(StopContext context) { ReceiveEndpoint[] endpoints; lock (_mutateLock) endpoints = _endpoints.Values.Where(x => _machine.IsStarted(x)).ToArray(); await Task.WhenAll(endpoints.Select(x => x.Stop(context.CancellationToken))).ConfigureAwait(false); await base.StopAgent(context).ConfigureAwait(false); }
/// <inheritdoc /> protected override Task StopAgent(StopContext context) { IAgent[] agents; lock (_agents) { agents = _agents.Values.Where(x => !x.Completed.IsCompleted).ToArray(); } return(StopSupervisor(new Context(context, agents))); }
protected override async Task StopAgent(StopContext context) { _messageConsumer.Stop(); _messageConsumer.Listener -= HandleMessage; _messageConsumer.Start(); SetCompleted(ActiveAndActualAgentsCompleted(context)); await Completed.ConfigureAwait(false); }
protected override async Task StopAgent(StopContext context) { _channel.Writer.Complete(); await _channel.Reader.Completion.ConfigureAwait(false); await _dispatcher.ConfigureAwait(false); await base.StopAgent(context).ConfigureAwait(false); }
protected override async Task StopAgent(StopContext context) { HostReceiveEndpointHandle[] handles; lock (_mutateLock) handles = _handles.Values.ToArray(); await Task.WhenAll(handles.Select(x => x.StopAsync(context.CancellationToken))).ConfigureAwait(false); await base.StopAgent(context).ConfigureAwait(false); }
protected override Task StopAgent(StopContext context) { foreach (Task <CachedMessageProducer> producer in _cache.GetAll()) { producer.Dispose(); } _cache.Clear(); return(TaskUtil.Completed); }
protected override async Task StopAgent(StopContext context) { if (_log.IsDebugEnabled) { _log.DebugFormat("Stopping consumer: {0}", _context.InputAddress); } SetCompleted(ActiveAndActualAgentsCompleted(context)); await Completed.ConfigureAwait(false); }
protected override async Task StopAgent(StopContext context) { await _consumerContext.Close().ConfigureAwait(false); _consumerContext.ErrorHandler -= HandleKafkaError; LogContext.Debug?.Log("Stopping consumer: {InputAddress}", _context.InputAddress); SetCompleted(ActiveAndActualAgentsCompleted(context)); await Completed.ConfigureAwait(false); }
protected override async Task StopAgent(StopContext context) { LogContext.SetCurrentIfNull(_context.LogContext); TransportLogMessages.StoppingReceiveTransport(_context.InputAddress); if (_supervisor != null) { await _supervisor.Stop(context).ConfigureAwait(false); } await base.StopAgent(context).ConfigureAwait(false); }
async Task ActiveAndActualAgentsCompleted(StopContext context) { if (_dispatcher.ActiveDispatchCount > 0) { try { await _deliveryComplete.Task.OrCanceled(context.CancellationToken).ConfigureAwait(false); } catch (OperationCanceledException) { LogContext.Warning?.Log("Stop canceled waiting for message consumers to complete: {InputAddress}", _context.InputAddress); } } }
protected override async Task StopAgent(StopContext context) { await _processorContext.StopProcessingAsync().ConfigureAwait(false); _processorContext.ProcessEvent -= HandleMessage; _processorContext.ProcessError -= HandleError; await _executor.DisposeAsync().ConfigureAwait(false); LogContext.Debug?.Log("Stopping consumer: {InputAddress}", _context.InputAddress); SetCompleted(ActiveAndActualAgentsCompleted(context)); await Completed.ConfigureAwait(false); }
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET: //ORIGINAL LINE: public void stop(final org.jboss.msc.service.StopContext context) public virtual void stop(StopContext context) { context.asynchronous(); executorInjector.Value.submit(() => { try { performUndeployment(); } finally { context.complete(); } }); }
/// <inheritdoc /> public async Task Stop(StopContext context) { _isStopping = true; if (_stopping.IsValueCreated) { _stopping.Value.Cancel(); } await StopAgent(context).ConfigureAwait(false); _isStopped = true; if (_stopped.IsValueCreated) { _stopped.Value.Cancel(); } }
protected override async Task StopAgent(StopContext context) { LogContext.SetCurrentIfNull(_context.LogContext); var metrics = _dispatcher.GetMetrics(); var completed = new ReceiveTransportCompletedEvent(_context.InputAddress, metrics); await _context.TransportObservers.Completed(completed).ConfigureAwait(false); LogContext.Debug?.Log("Consumer completed {InputAddress}: {DeliveryCount} received, {ConcurrentDeliveryCount} concurrent", _context.InputAddress, metrics.DeliveryCount, metrics.ConcurrentDeliveryCount); _consumerHandle.Disconnect(); await base.StopAgent(context).ConfigureAwait(false); }
async Task ActiveAndActualAgentsCompleted(StopContext context) { if (_tracker.ActiveDeliveryCount > 0) { try { await _deliveryComplete.Task.UntilCompletedOrCanceled(context.CancellationToken).ConfigureAwait(false); } catch (OperationCanceledException) { if (_log.IsWarnEnabled) { _log.WarnFormat("Stop canceled waiting for message consumers to complete: {0}", _context.InputAddress); } } } }
protected internal virtual void stopInternal(StopContext context) { try { base.stop(context); } finally { try { processEngine.close(); } catch (Exception e) { LOGGER.log(Level.SEVERE, "exception while closing process engine", e); } } }
protected override async Task StopAgent(StopContext context) { var slot = 0; try { for (; slot < _concurrencyLimit; slot++) { await _limit.WaitAsync(context.CancellationToken).ConfigureAwait(false); } await base.StopAgent(context).ConfigureAwait(false); } finally { _limit.Release(slot); } }
public override void stop(StopContext arg0) { ManagedReference reference = null; try { // get the process application component ProcessApplicationInterface processApplication = null; ComponentView componentView = paComponentViewInjector.OptionalValue; if (componentView != null) { reference = componentView.createInstance(); processApplication = (ProcessApplicationInterface)reference.Instance; } else { processApplication = noViewProcessApplication.Value; } BpmPlatformPlugins bpmPlatformPlugins = platformPluginsInjector.Value; IList <BpmPlatformPlugin> plugins = bpmPlatformPlugins.Plugins; foreach (BpmPlatformPlugin bpmPlatformPlugin in plugins) { bpmPlatformPlugin.postProcessApplicationUndeploy(processApplication); } } catch (Exception e) { LOGGER.log(Level.WARNING, "Exception while invoking BpmPlatformPlugin.postProcessApplicationUndeploy", e); } finally { if (reference != null) { reference.release(); } } }
protected override async Task StopAgent(StopContext context) { SetCompleted(ActiveAndActualAgentsCompleted(context)); await Completed.ConfigureAwait(false); }
public virtual void stop(StopContext context) { // nothing to do }
public Context(StopContext context, IAgent[] agents) { _context = context; Agents = agents; }