Sends publish stop notifications
358406
private void sendPublishStopNotify() {
        Status stopStatus = new Status(StatusCodes.NS_UNPUBLISHED_SUCCESS);
        stopStatus.setClientid(getStreamId());
        stopStatus.setDetails(getPublishedName());

        StatusMessage stopMsg = new StatusMessage();
        stopMsg.setBody(stopStatus);
        pushMessage(stopMsg);
        setState(StreamState.STOPPED);
    }
1301709
def stop(self):
        
        self.publish.setsockopt(zmq.LINGER, 1)
        self.publish.close()
        return self
1101879
protected void doPublish(String tenantId, List<T> items, String subscriber,
            int retryCount, long delay) throws Exception {
        String data = mapper.writeValueAsString(items);

        TextMessage tm = session.createTextMessage(data);

        if (tenantId != null) {
            tm.setStringProperty("tenant", tenantId);
        }

        if (subscriber != null) {
            tm.setStringProperty("subscriber", subscriber);
        }

        tm.setIntProperty("retryCount", retryCount);

        if (delay > 0) {
            tm.setLongProperty("_AMQ_SCHED_DELIVERY", System.currentTimeMillis() + delay);
        }

        if (log.isLoggable(Level.FINEST)) {
            log.finest("Publish: " + tm);
        }

        producer.send(tm);
    }
997072
def send_notification(method, params)
      data = MessagePack.dump([2, method, params]).bytes
      ws.send(data)
    rescue => exc
      warn exc
      abort exc
    end
856148
protected void fireStart(CmsPublishJobEnqueued publishJob) {

        if (LOG.isDebugEnabled()) {
            LOG.debug(Messages.get().getBundle().key(Messages.LOG_PUBLISH_JOB_START_0));
        }
        for (Iterator<I_CmsPublishEventListener> it = iterator(); it.hasNext();) {
            I_CmsPublishEventListener listener = it.next();
            try {
                listener.onStart(publishJob);
            } catch (Throwable t) {
                // catch every thing including runtime exceptions
                if (LOG.isErrorEnabled()) {
                    LOG.error(
                        Messages.get().getBundle().key(
                            Messages.ERR_PUBLISH_JOB_START_ERROR_1,
                            listener.getClass().getName()),
                        t);
                }
                if (publishJob.m_publishJob.getPublishReport() != null) {
                    publishJob.m_publishJob.getPublishReport().println(t);
                }
            }
        }
        // popup the start message
        boolean busyStart = ((System.currentTimeMillis() - publishJob.getEnqueueTime()) > 2000);
        boolean bigJob = ((publishJob.getPublishList().size() > 25)
            || (OpenCms.getStaticExportManager().getHandler() instanceof CmsAfterPublishStaticExportHandler));
        if (busyStart || bigJob) {
            String msgText = Messages.get().getBundle(publishJob.getLocale()).key(
                Messages.GUI_PUBLISH_JOB_STARTED_1,
                new Long(publishJob.getEnqueueTime()));
            m_publishEngine.sendMessage(publishJob.getUserId(), msgText, false);
        }
    }
953409
private void sendOrPublishMessage(Message message) {
        if (endpointConfiguration.isPubSubDomain()) {
            if (log.isDebugEnabled()) {
                log.debug("Publish Vert.x event bus message to address: '" + endpointConfiguration.getAddress() + "'");
            }
            vertx.eventBus().publish(endpointConfiguration.getAddress(), message.getPayload());
        } else {
            if (log.isDebugEnabled()) {
                log.debug("Sending Vert.x event bus message to address: '" + endpointConfiguration.getAddress() + "'");
            }
            vertx.eventBus().send(endpointConfiguration.getAddress(), message.getPayload());
        }
    }
949189
def _publish(self, msg):
        
        connection = self._connection.clone()
        publish = connection.ensure(self.producer, self.producer.publish,
                                    errback=self.__error_callback,
                                    max_retries=MQ_PRODUCER_MAX_RETRIES)
        publish(json.dumps(msg), exchange=self._exchange,
                routing_key=self._routing_key, declare=[self._queue])
        logging.debug('Publisher: message sent: %s', msg)
132499
def send(self, message_data, delivery_mode=None):
        """"""
        self.publisher.send(message_data, delivery_mode=delivery_mode)
45900
def Publish(self, event_name, msg, delay=0):
    """"""
    events_lib.Events.PublishEvent(event_name, msg, delay=delay)
861259
private void publishEvent(WSJobExecution execution, WSJobInstance jobInstance, BatchStatus batchStatus) {

        if (batchStatus == BatchStatus.FAILED) {
            publishEvent(execution, BatchEventsPublisher.TOPIC_EXECUTION_FAILED);
            publishEvent(jobInstance, BatchEventsPublisher.TOPIC_INSTANCE_FAILED);
        } else if (batchStatus == BatchStatus.COMPLETED) {
            publishEvent(execution, BatchEventsPublisher.TOPIC_EXECUTION_COMPLETED);
            publishEvent(jobInstance, BatchEventsPublisher.TOPIC_INSTANCE_COMPLETED);
        } else if (batchStatus == BatchStatus.STOPPED) {
            publishEvent(execution, BatchEventsPublisher.TOPIC_EXECUTION_STOPPED);
            publishEvent(jobInstance, BatchEventsPublisher.TOPIC_INSTANCE_STOPPED);
            //smf call to go here, eventually
        } else if (batchStatus == BatchStatus.STOPPING) {
            publishEvent(jobInstance, BatchEventsPublisher.TOPIC_INSTANCE_STOPPING);
            publishEvent(execution, BatchEventsPublisher.TOPIC_EXECUTION_STOPPING);
        } else if (batchStatus == BatchStatus.STARTED) {
            publishEvent(jobInstance, BatchEventsPublisher.TOPIC_INSTANCE_DISPATCHED);
            publishEvent(execution, BatchEventsPublisher.TOPIC_EXECUTION_STARTED);
        }

    }
1158107
def stop_transmit(self, fd):
        
        self._wfds.pop(fd, None)
        self._update(fd)
490912
private void sendNotification(String errMessage, int errCode, String errType, boolean createNotification) {
        NotificationsDao notifications = storage.getNotificationsDao();
        Notification notification;

        if (errType == "warning") {
            logger.warning(errMessage); // send message to console
            if (createNotification) {
                notification = notification(WARNING_NOTIFICATION, errCode, errMessage);
                notifications.addNotification(notification);
            }
        } else if (errType == "error") {
            logger.error(errMessage); // send message to console
            if (createNotification) {
                notification = notification(ERROR_NOTIFICATION, errCode, errMessage);
                notifications.addNotification(notification);
            }
        } else if (errType == "info") {
            if (logger.isInfoEnabled()) {
                logger.info(errMessage); // send message to console
            }
        }
    }
1344568
def shutdown_publisher(publisher)
      begin
        @master.unregister_publisher(publisher.topic_name)
      ensure
        @publishers.delete(publisher) do |pub|
          raise "publisher not found"
        end
        publisher.close
      end
    end
382488
public void sendNotification(NotificationType type,
                                 String subject,
                                 String message,
                                 String... destinations) {
        for (Notifier notifier : notifiers) {
            if (notifier.getNotificationType().equals(type)) {
                notifier.notify(subject, message, destinations);
            }
        }
    }
123301
protected void fireFinish(CmsPublishJobRunning publishJob) {

        if (LOG.isDebugEnabled()) {
            LOG.debug(Messages.get().getBundle().key(Messages.LOG_PUBLISH_JOB_FINISH_0));
        }
        for (Iterator<I_CmsPublishEventListener> it = iterator(); it.hasNext();) {
            I_CmsPublishEventListener listener = it.next();
            try {
                listener.onFinish(publishJob);
            } catch (Throwable t) {
                // catch every thing including runtime exceptions
                if (LOG.isErrorEnabled()) {
                    LOG.error(
                        Messages.get().getBundle().key(
                            Messages.ERR_PUBLISH_JOB_FINISH_ERROR_1,
                            listener.getClass().getName()),
                        t);
                }
                if (publishJob.m_publishJob.getPublishReport() != null) {
                    publishJob.m_publishJob.getPublishReport().println(t);
                }
            }
        }
        // popup the finish message
        String msgText;
        boolean hasError = false;
        if (!publishJob.getReport().hasError() && !publishJob.getReport().hasWarning()) {
            msgText = Messages.get().getBundle(publishJob.getLocale()).key(
                Messages.GUI_PUBLISH_JOB_FINISHED_1,
                new Long(publishJob.getEnqueueTime()));
        } else {
            hasError = true;
            Object[] params = new Object[] {
                new Long(publishJob.getEnqueueTime()),
                new Integer(publishJob.getReport().getErrors().size()),
                new Integer(publishJob.getReport().getWarnings().size())};
            msgText = Messages.get().getBundle(publishJob.getLocale()).key(
                Messages.GUI_PUBLISH_JOB_FINISHED_WITH_WARNS_3,
                params);
        }
        m_publishEngine.sendMessage(publishJob.getUserId(), msgText, hasError);
    }
84100
function announce (server, service) {
  var delay = 1000
  var packet = service._records()

  server.register(packet)

  ;(function broadcast () {
    // abort if the service have or is being stopped in the meantime
    if (!service._activated || service._destroyed) return

    server.mdns.respond(packet, function () {
      // This function will optionally be called with an error object. We'll
      // just silently ignore it and retry as we normally would
      if (!service.published) {
        service._activated = true
        service.published = true
        service.emit('up')
      }
      delay = delay * REANNOUNCE_FACTOR
      if (delay < REANNOUNCE_MAX_MS && !service._destroyed) {
        setTimeout(broadcast, delay).unref()
      }
    })
  })()
}
714040
public synchronized void stop() {
        if (isRunning()) {
            try {
                setSendingStatus(false);
            } catch (Throwable t) {
                logger.error("Problem stopping sending status during shutdown", t);
            }
            DeviceFinder.getInstance().removeIgnoredAddress(socket.get().getLocalAddress());
            socket.get().close();
            socket.set(null);
            broadcastAddress.set(null);
            updates.clear();
            setTempoMaster(null);
            setDeviceNumber((byte)0);  // Set up for self-assignment if restarted.
            deliverLifecycleAnnouncement(logger, false);
        }
    }