void onStop(Task onCompleted) { trace("CANCELED.onStop"); if( !disposed ) { disposed = true; dispose(); } onCompleted.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); } } });
@Override public void destroy(Task cb) { cb.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() { task.run(); dispatchQueue.execute(new Task() { public void run() { if (isConnected()) { handshake(); } } }); } });
void done() { for (Task callback : callbacks) { callback.run(); } } }
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() { 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); } }); } }); } });
public void run() { synchronized (lock) { if (HeartBeatMonitor.this.session == session) { func.run(); } } } });
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() { // 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); } }); } });
void done() { for (Task callback : callbacks) { callback.run(); } } }
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() { ack_connect.run(); } });
@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() {
void onStop(Task onCompleted) { trace("CANCELED.onStop"); if( !disposed ) { disposed = true; dispose(); } onCompleted.run(); } }
host_state.on_load(new Task() { @Override public void run() {
public void run() { if( cancelHandler!=null ) { cancelHandler.run(); } } });