final long suspends = suspendChanges.get(); pingedAt = now; queue.executeAfter(CallbackConnection.this.mqtt.getKeepAlive(), TimeUnit.SECONDS, new Task() { @Override public void run() {
public void run() { task.run(); dispatchQueue.execute(new Task() { public void run() { if (isConnected()) { handshake(); } } }); } });
@Override public void run() { queue.execute(new Task() { @Override public void run() { session_state.strategy.update(new Task() { @Override public void run() { SUBACK suback = new SUBACK(); suback.messageId(sub.messageId()); byte[] granted = new byte[sub.topics().length]; int i = 0; for (Topic topic : sub.topics()) { granted[i] = (byte) topic.qos().ordinal(); i++; } suback.grantedQos(granted); send(suback); } }); } }); } });
@Override public void run() { // TODO: perhaps persist the processed list.. session_state.received_message_ids.add(publish.messageId()); session_state.strategy.update(new Task() { @Override public void run() { PUBREC response = new PUBREC(); response.messageId(publish.messageId()); send(response); } }); } });
public void run() { task.run(); transport.getDispatchQueue().execute(new Task() { public void run() { if (readChannel.isOpen() && writeChannel.isOpen()) { try { handshake(); } catch (IOException e) { transport.getTransportListener().onTransportFailure(e); } } } }); } });
@Override public void run() { host().router().connect(new ConnectAddress[]{destination}, prodcuer, security_context); queue.execute(new Task() { @Override public void run() { @Override public void call(DeliveryResult x, StoreUOW y) { host().dispatch_queue().execute(new Task() { @Override public void run() {
host_state.on_load(new Task() { @Override public void run() {
public void run() { if (manager_disconnected) { // we are not the assignment anymore.. go to the session manager // again to setup a new session. MqttSessionManager.attach(host(), client_id, next); } else { // so that we don't switch again until this current switch completes queue.suspend(); if (handler != null) { detach(); handler = null; } queue.execute(new Task() { public void run() { handler = next; attach(); } }); // switch the connection to the session queue.. next.connection()._set_dispatch_queue(queue, new Task() { public void run() { queue.resume(); } }); } } });
@Override public void run() { host = connection().connector().broker().get_default_virtual_host(); queue().execute(new Task() { @Override public void run() { host.authenticator().authenticate(security_context, toScala(new UnitFn1<String>() { public void call(final String auth_err) { queue().execute(new Task() { @Override public void run() {
final long suspends = suspendChanges.get(); pingedAt = now; queue.executeAfter(CallbackConnection.this.mqtt.getKeepAlive(), TimeUnit.SECONDS, new Task() { @Override public void run() {
public void run() { if (_serviceState == STARTED) { final STOPPING state = new STOPPING(); state.add(onCompleted); _serviceState = state; _stop(new Task() { public void run() { _serviceState = STOPPED; state.done(); } }); } else if (_serviceState instanceof STOPPING) { ((STOPPING) _serviceState).add(onCompleted); } else if (_serviceState == STOPPED) { if (onCompleted != null) { onCompleted.run(); } } else { if (onCompleted != null) { onCompleted.run(); } error("stop should not be called from state: " + _serviceState); } } });
public void run() { if (_serviceState == CREATED || _serviceState == STOPPED) { final STARTING state = new STARTING(); state.add(onCompleted); _serviceState = state; _start(new Task() { public void run() { _serviceState = STARTED; state.done(); } }); } else if (_serviceState instanceof STARTING) { ((STARTING) _serviceState).add(onCompleted); } else if (_serviceState == STARTED) { if (onCompleted != null) { onCompleted.run(); } } else { if (onCompleted != null) { onCompleted.run(); } error("start should not be called from state: " + _serviceState); } } });
public void run() { if (_serviceState == STARTED) { final STOPPING state = new STOPPING(); state.add(onCompleted); _serviceState = state; _stop(new Task() { public void run() { _serviceState = STOPPED; state.done(); } }); } else if (_serviceState instanceof STOPPING) { ((STOPPING) _serviceState).add(onCompleted); } else if (_serviceState == STOPPED) { if (onCompleted != null) { onCompleted.run(); } } else { if (onCompleted != null) { onCompleted.run(); } error("stop should not be called from state: " + _serviceState); } } });
public void run() { if (_serviceState == CREATED || _serviceState == STOPPED) { final STARTING state = new STARTING(); state.add(onCompleted); _serviceState = state; _start(new Task() { public void run() { _serviceState = STARTED; state.done(); } }); } else if (_serviceState instanceof STARTING) { ((STARTING) _serviceState).add(onCompleted); } else if (_serviceState == STARTED) { if (onCompleted != null) { onCompleted.run(); } } else { if (onCompleted != null) { onCompleted.run(); } error("start should not be called from state: " + _serviceState); } } });
@Override public void run() { if (clean_session) { host().router().unbind(addresses, mqtt_consumer(), false, security_context); } else { if (mqtt_consumer().addresses.isEmpty()) { host().router().unbind(new BindAddress[]{session_state.durable_sub}, mqtt_consumer(), true, security_context); session_state.durable_sub = null; } else { host().router().bind(new BindAddress[]{session_state.durable_sub}, mqtt_consumer(), security_context, Scala2Java.<Option<String>>noopFn1()); } } queue.execute(new Task() { @Override public void run() { session_state.strategy.update(new Task() { @Override public void run() { UNSUBACK ack = new UNSUBACK(); ack.messageId(unsubscribe.messageId()); send(ack); } }); } }); } });