Add Manager.schedule(Runnable, long, TimeUnit)

using Smack's scheduled executor service.
This commit is contained in:
Florian Schmaus 2018-02-26 10:24:01 +01:00
parent 4f88f23f33
commit ecc53b1bc8
1 changed files with 7 additions and 1 deletions

View File

@ -1,6 +1,6 @@
/** /**
* *
* Copyright 2014 Florian Schmaus * Copyright 2014-2018 Florian Schmaus
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -17,6 +17,8 @@
package org.jivesoftware.smack; package org.jivesoftware.smack;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import org.jivesoftware.smack.SmackException.NotLoggedInException; import org.jivesoftware.smack.SmackException.NotLoggedInException;
import org.jivesoftware.smack.util.Objects; import org.jivesoftware.smack.util.Objects;
@ -48,4 +50,8 @@ public abstract class Manager {
} }
return connection; return connection;
} }
protected static final ScheduledFuture<?> schedule(Runnable runnable, long delay, TimeUnit unit) {
return AbstractXMPPConnection.SCHEDULED_EXECUTOR_SERVICE.schedule(runnable, delay, unit);
}
} }