public FutureConnection(CallbackConnection next) { this.next = next; this.next.listener(new ExtendedListener() {
private void connectMqtt() throws Exception { String clientId = this.topologyName + "-" + this.context.getThisComponentId() + "-" + this.context.getThisTaskId(); MQTT client = MqttUtils.configureClient(this.options, clientId, this.keyStoreLoader); this.connection = client.callbackConnection(); this.connection.listener(this); this.connection.connect(new ConnectCallback()); while (!this.mqttConnected && !this.mqttConnectFailed) { LOG.info("Waiting for connection..."); Thread.sleep(500); } if (this.mqttConnected) { List<String> topicList = this.options.getTopics(); Topic[] topics = new Topic[topicList.size()]; QoS qos = MqttUtils.qosFromInt(this.options.getQos()); for (int i = 0; i < topicList.size(); i++) { topics[i] = new Topic(topicList.get(i), qos); } connection.subscribe(topics, new SubscribeCallback()); } }
connection.listener(new org.fusesource.mqtt.client.Listener() {
connection.listener(new org.fusesource.mqtt.client.Listener() {
private FuseChannel(final String clientId, final MqttNamespace namespace, final BinaryPayloadCodec codec, final CallbackConnection connection) { super(codec, namespace, clientId); this.connection = connection; this.connection.listener(listener); }
private FuseChannel(final String clientId, final MqttNamespace namespace, final BinaryPayloadCodec codec, final CallbackConnection connection) { super(codec, namespace, clientId); this.connection = connection; this.connection.listener(listener); }
connection.listener(new Listener() {
connection.listener(new Listener() {
public FutureConnection(CallbackConnection next) { this.next = next; this.next.listener(new ExtendedListener() {
connection.listener(new org.fusesource.mqtt.client.Listener() {
connection.listener(new org.fusesource.mqtt.client.Listener() {
this.connectionArray[0] = createConnection(host, clientId + jmcx.getThreadNum(), durable); this.connectionArray[0].listener(new ListenerforSubscribe()); CallbackforSubscribe cbs = new CallbackforSubscribe(); CallbackforConnect cbc = new CallbackforConnect(topic, + jmcx.getThreadNum() + j, durable); this.connectionArray[j] .listener(new ListenerforSubscribe()); CallbackforSubscribe cbs = new CallbackforSubscribe(); CallbackforConnect cbc = new CallbackforConnect(topic, this.connectionArray[r] = createConnection(host, clientId + jmcx.getThreadNum() + r, durable); this.connectionArray[r].listener(new ListenerforSubscribe()); CallbackforSubscribe cbs = new CallbackforSubscribe(); CallbackforConnect cbc = new CallbackforConnect(topicArray[r],
this.connectionArray[0] = createConnection(host, clientId + jmcx.getThreadNum(), durable, user, password); this.connectionArray[0].listener(new ListenerforSubscribe()); CallbackforSubscribe cbs = new CallbackforSubscribe(); CallbackforConnect cbc = new CallbackforConnect(topic, + jmcx.getThreadNum() + j, durable, user, password); this.connectionArray[j] .listener(new ListenerforSubscribe()); CallbackforSubscribe cbs = new CallbackforSubscribe(); CallbackforConnect cbc = new CallbackforConnect(topic, + jmcx.getThreadNum() + r, durable, user, password); this.connectionArray[r] .listener(new ListenerforSubscribe()); CallbackforSubscribe cbs = new CallbackforSubscribe(); CallbackforConnect cbc = new CallbackforConnect(topicArray[r],