<commit_before>package de.techjava.mqtt.camunda.comm;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

import javax.annotation.PostConstruct;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.context.Initialized;
import javax.enterprise.event.Observes;
import javax.inject.Inject;
import javax.inject.Named;
import javax.servlet.ServletContext;

import org.eclipse.paho.client.mqttv3.MqttCallback;
import org.eclipse.paho.client.mqttv3.MqttClient;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import de.techjava.mqtt.camunda.bpm.CatchingSignalEventReceiver;
import de.techjava.mqtt.camunda.config.Property;

/**
 * MqttListener Bean. Manages all subscriptions to MQTT.
 * 
 * @author <NAME>
 * @author <NAME>
 */
@ApplicationScoped
@Named
public class MqttReceiver extends MqttCallbackAdapter {

    private static final Logger logger = LoggerFactory.getLogger(MqttReceiver.class);
    private Map<String, Collection<MqttCallback>> listeners = new HashMap<String, Collection<MqttCallback>>();

    @Inject
    private MqttClient client;

    @Inject
    private CatchingSignalEventReceiver signalReceiver;

    @Inject
    @Property("mqtt.qos")
    private Integer qos;

    @Inject
    @Property("mqtt.signals.deliver")
    private Boolean deliverSignals;

    @Inject
    @Property("mqtt.topic.prefix")
    private String topicPrefix;

    @PostConstruct
    public void init() {
        if (this.deliverSignals == null) {
            this.deliverSignals = Boolean.FALSE;
            logger.warn("MQTT BPMN signal delivery is deactivated. "
                    + "Set mqtt.topic.prefix=true if you want to activate it or set it to false to avoid this message.");
        }
        if (this.client.isConnected()) {
            this.client.setCallback(this);
            this.initializeSignalDelivery();
            logger.info("MQTT receiver initialized.");
        }
    }<commit_msg>fixed config error message.<commit_after>package de.techjava.mqtt.camunda.comm;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

import javax.annotation.PostConstruct;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.context.Initialized;
import javax.enterprise.event.Observes;
import javax.inject.Inject;
import javax.inject.Named;
import javax.servlet.ServletContext;

import org.eclipse.paho.client.mqttv3.MqttCallback;
import org.eclipse.paho.client.mqttv3.MqttClient;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import de.techjava.mqtt.camunda.bpm.CatchingSignalEventReceiver;
import de.techjava.mqtt.camunda.config.Property;

/**
 * MqttListener Bean. Manages all subscriptions to MQTT.
 * 
 * @author <NAME>
 * @author <NAME>
 */
@ApplicationScoped
@Named
public class MqttReceiver extends MqttCallbackAdapter {

    private static final Logger logger = LoggerFactory.getLogger(MqttReceiver.class);
    private Map<String, Collection<MqttCallback>> listeners = new HashMap<String, Collection<MqttCallback>>();

    @Inject
    private MqttClient client;

    @Inject
    private CatchingSignalEventReceiver signalReceiver;

    @Inject
    @Property("mqtt.qos")
    private Integer qos;

    @Inject
    @Property("mqtt.signals.deliver")
    private Boolean deliverSignals;

    @Inject
    @Property("mqtt.topic.prefix")
    private String topicPrefix;

    @PostConstruct
    public void init() {
        if (this.deliverSignals == null) {
            this.deliverSignals = Boolean.FALSE;
            logger.warn("MQTT BPMN signal delivery is deactivated. "
                    + "Set mqtt.signals.deliver=true if you want to activate it or set it to false to avoid this message.");
        }
        if (this.client.isConnected()) {
            this.client.setCallback(this);
            this.initializeSignalDelivery();
            logger.info("MQTT receiver initialized.");
        }
    }
{'fraction_non_alphanumeric': 0.10050131296252089, 'fraction_numerical': 0.0028646455001193603, 'mean_word_length': 3.7131608548931383, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5455138', 'n_tokens_mistral': 1284, 'n_tokens_neox': 1268, 'n_words': 269}