use of org.jivesoftware.spark.util.SwingTimerTask in project Spark by igniterealtime.
the class OutgoingCall method sessionEstablished.
public void sessionEstablished(PayloadType payloadType, TransportCandidate transportCandidate, TransportCandidate transportCandidate1, JingleSession jingleSession) {
established = true;
mediaReceivedTask = new SwingTimerTask() {
public void doRun() {
if (!mediaReceived) {
if (session != null) {
try {
session.terminate("No Media Received. This may be caused by firewall configuration problems.");
} catch (XMPPException | SmackException e) {
Log.error(e);
}
}
}
}
};
TaskEngine.getInstance().schedule(mediaReceivedTask, WAIT_FOR_MEDIA_DELAY, WAIT_FOR_MEDIA_DELAY);
SwingUtilities.invokeLater(() -> updateOutgoingCallPanel());
}
use of org.jivesoftware.spark.util.SwingTimerTask in project Spark by igniterealtime.
the class ChatContainer method handleStaleChats.
/**
* Checks every room every 30 seconds to see if it's timed out.
*/
private void handleStaleChats() {
// delay for 1 second.
int delay = 1000;
// repeat every minute.
int period = 60000;
final TimerTask task = new SwingTimerTask() {
public void doRun() {
for (ChatRoom chatRoom : getStaleChatRooms()) {
// Notify decorators
SparkManager.getChatManager().notifySparkTabHandlers(chatRoom);
}
}
};
TaskEngine.getInstance().scheduleAtFixedRate(task, delay, period);
}
Aggregations