Creates topics and queues and starts listeners
432650
private void createDestinations() throws MessagingException {
        try {
            // Create Destinations based on properties
            Enumeration<?> propertyNames = m_connectionProperties.keys();
            while (propertyNames.hasMoreElements()) {
                String propertyName = (String) propertyNames.nextElement();
                if (propertyName.startsWith("topic.")) {
                    String destinationName =
                            m_connectionProperties.getProperty(propertyName);
                    m_jmsManager.createDestination(destinationName,
                                                   DestinationType.Topic);
                } else if (propertyName.startsWith("queue.")) {
                    String destinationName =
                            m_connectionProperties.getProperty(propertyName);
                    m_jmsManager.createDestination(destinationName,
                                                   DestinationType.Queue);
                }
            }

            // Get destination list
            List<Destination> destinations = m_jmsManager.getDestinations();

            // If there are no Destinations, throw an exception
            if (destinations.size() == 0) {
                throw new MessagingException("No destinations available for "
                        + "subscription, make sure that there is at least one topic "
                        + "or queue specified in the connection properties.");
            }

            // Subscribe
            for (Destination destination : destinations) {
                if (m_durable && (destination instanceof Topic)) {
                    m_jmsManager.listenDurable((Topic) destination,
                                               m_messageSelector,
                                               this,
                                               null);
                } else {
                    m_jmsManager.listen(destination, m_messageSelector, this);
                }
            }
        } catch (MessagingException me) {
            logger.error("MessagingException encountered attempting to start "
                    + "Messaging Client: " + m_clientId
                    + ". Exception message: " + me.getMessage(), me);
            throw me;
        }
    }
229819
function _addListeners() {
        if (_automaticSort && _currentSort && _currentSort.getEvents()) {
            MainViewManager
                .on(_currentSort.getEvents(), function () {
                    _currentSort.sort();
                })
                .on("_workingSetDisableAutoSort.sort", function () {
                    setAutomatic(false);
                });
        }
    }
537320
function() {
                if (hasCache) {
                    queueDb = new Dexie('podQueues');

                    queueDb.version(1)
                        .stores({
                            waitQ: '[owner+threadId+uniqueId], owner, threadId, uniqueId, message'
                        });

                    if (enableCache) {
                        db = new Dexie('podChat');

                        db.version(1)
                            .stores({
                                users: '&id, name, cellphoneNumber, keyId',
                                contacts: '[owner+id], id, owner, uniqueId, userId, cellphoneNumber, email, firstName, lastName, expireTime',
                                threads: '[owner+id] ,id, owner, title, time, [owner+time]',
                                participants: '[owner+id], id, owner, threadId, notSeenDuration, name, contactName, email, expireTime',
                                messages: '[owner+id], id, owner, threadId, time, [threadId+id], [threadId+owner+time]',
                                messageGaps: '[owner+id], [owner+waitsFor], id, waitsFor, owner, threadId, time, [threadId+owner+time]'
                            });

                        db.open()
                            .catch(function(e) {
                                console.log('Open failed: ' + e.stack);
                            });

                        db.on('ready', function() {
                            isCacheReady = true;
                        }, true);

                        db.on('versionchange', function(event) {
                            window.location.reload();
                        });
                    }
                }
                else {
                    console.log(CHAT_ERRORS[6600]);
                }
            }
765442
void performPostCreationTasks()
    {
        StatusAction statusAction = new StatusAction();
        try
        {
            ResponseEvents events = CoherentManagerConnection.sendEventGeneratingAction(statusAction, 1000);
            for (ResponseEvent event : events.getEvents())
            {
                if (event instanceof StatusEvent)
                {
                    // do nothing. Creating the events will register the
                    // channels, which is after all what we are trying to do.
                }
            }

        }
        catch (IllegalArgumentException | IllegalStateException | IOException | TimeoutException e)
        {
            logger.error(e, e);
        }

    }
928183
function broadcastQueuedMessages() {
            var message;
            while (messageQueue.length) {
                message = messageQueue.shift();
                broadcast(message.name, message.data);
            }
            messageQueue = null;
        }
376119
def listen(&block)
      return if @listeners.any?
      @listeners = @queues.map do |queue|
        QueueListener.new(queue)
      end

      @listeners.each do |listener|
        listener.listen(&block)
      end
    end
1258571
def subscribe_topics(self):
        """"""
        base = self.topic
        subscribe = self.mqtt.subscribe

        # device topics
        subscribe(b"/".join((base, b"$stats/interval/set")))
        subscribe(b"/".join((self.settings.MQTT_BASE_TOPIC, b"$broadcast/#")))

        # node topics
        nodes = self.nodes
        for node in nodes:
            for topic in node.subscribe:
                topic = b"/".join((base, topic))
                # print('MQTT SUBSCRIBE: {}'.format(topic))
                subscribe(topic)
                self.topic_callbacks[topic] = node.callback
885664
public void setupListeners() {

		// Getting the list of views
		QueryInterfaceViewsList queryInterfaceViews = (QueryInterfaceViewsList) this.getOWLEditorKit().get(QueryInterfaceViewsList.class.getName());
		if ((queryInterfaceViews == null)) {
			queryInterfaceViews = new QueryInterfaceViewsList();
			getOWLEditorKit().put(QueryInterfaceViewsList.class.getName(), queryInterfaceViews);
		}

		// Adding the new instance (this)
		queryInterfaceViews.add(this);

		// Registering the current query view with all existing query manager views
		QueryManagerViewsList queryManagerViews = (QueryManagerViewsList) this.getOWLEditorKit().get(QueryManagerViewsList.class.getName());
		if ((queryManagerViews != null) && (!queryManagerViews.isEmpty())) {
			for (QueryManagerView queryInterfaceView : queryManagerViews) {
				queryInterfaceView.addListener(this);
			}
		}
	}
191942
def start(self):
        ""
        log.info("starting")

        self._listener_coro = backend.greenlet(self._listener)
        self._udp_listener_coro = backend.greenlet(self._udp_listener)
        backend.schedule(self._listener_coro)
        backend.schedule(self._udp_listener_coro)

        for addr in self._peers:
            self.add_peer(addr)
555077
void init(Set<String> queues, 
            CapacitySchedulerConf capacityConf) {
    for (String queue : queues) {
      int userlimit = capacityConf.getMinimumUserLimitPercent(queue);
      int maxUsersToInitialize = ((100 / userlimit) + MAX_ADDITIONAL_USERS_TO_INIT);
      int maxJobsPerUserToInitialize = capacityConf
          .getMaxJobsPerUserToInitialize(queue);
      QueueInfo qi = new QueueInfo(queue, maxUsersToInitialize,
          maxJobsPerUserToInitialize);
      jobQueues.put(queue, qi);
    }
    sleepInterval = capacityConf.getSleepInterval();
    poolSize = capacityConf.getMaxWorkerThreads();
    if (poolSize > queues.size()) {
      poolSize = queues.size();
    }
    assignThreadsToQueues();
    Collection<JobInitializationThread> threads = threadsToQueueMap.values();
    for (JobInitializationThread t : threads) {
      if (!t.isAlive()) {
        t.setDaemon(true);
        t.start();
      }
    }
  }
1083297
private void setupStartEndListeners() {
        TransitionSetListener listener = new TransitionSetListener(this);
        for (Transition childTransition : mTransitions) {
            childTransition.addListener(listener);
        }
        mCurrentListeners = mTransitions.size();
    }
1326087
def _create_threads(self):
        

        creator = JobCreator(
            self.config,
            self.observers.jobs,
            self.logger
        )
        self.jobs = creator.job_factory()
750373
@Override
    public void start() {
        ConnectionPoolMBeanManager.getInstance().registerMonitor(config.getName(), this);

        String seeds = config.getSeeds();
        if (seeds != null && !seeds.isEmpty()) {
            setHosts(config.getSeedHosts());
        }

        config.getLatencyScoreStrategy().start(new Listener() {
            @Override
            public void onUpdate() {
                rebuildPartitions();
            }

            @Override
            public void onReset() {
                rebuildPartitions();
            }
        });
    }
914765
void onJoinStart()
  {
    //long now = CurrentTime.getCurrentTime();
    ArrayList<UpdatePod> updatePods = new ArrayList<>();
    
    updateClusterRoot();

    /*
    for (UpdatePod updatePod : _podUpdateMap.values()) {
      if (updatePod.getSequence() == 0) {
        updatePods.add(new UpdatePod(updatePod, now));
      }
    }
    */
    
    /*
    for (UpdatePod updatePod : updatePods) {
      updatePod(updatePod);
    }
    */
    
    updatePods.addAll(_podUpdateMap.values());
    
    for (UpdatePod updatePod : updatePods) {
      updatePod(updatePod);
    }
    
    // XXX:
  }
942953
public void startListening() {
        if (listenForCommands) {
            listeningThread = new Thread("kernel-command-listener") {
                @Override
                public void run() {
                    while (listenForCommands && acceptAndExecuteCommand()) {
                        //loop intentionally empty
                    }
                }
            };
            listeningThread.start();
        }
    }
910077
def __start_command_queue_listener(self):
        
        thread_function = self.__command_queue_listener

        class QueueListenerThread(threading.Thread):
            def run(qltself):
                thread_function()

        assert not hasattr(self, "__queue_listener_thread")
        self.log.debug("Starting queue listener thread")
        self.__queue_listener_thread = QueueListenerThread()
        self.__queue_listener_thread.daemon = True
        self.__queue_listener_thread.name = "Command Queue Listener"
        self.__queue_listener_thread.start()
1307303
function main()
{
	aqParseOptions();

	aq_queuename = 'amqpsnoop.' + Math.random() * 10000000;
	aq_amqp = mod_amqp.createConnection(aq_broker);
	aq_amqp.on('ready', function () {
		aq_queue = aq_amqp.queue(aq_queuename,
		    { exclusive: true }, function () {
			aq_queue.bind(aq_exchange, aq_routekey);
			aq_queue.subscribe(aqReceiveMessage);
		    });
	});
}