openviu-server: close KurentoClients in KmsManager on PreDestroy

pull/375/head
pabloFuente 2019-08-23 11:34:47 +02:00
parent 63b61b0e56
commit 8f67cd9d9e
1 changed files with 9 additions and 0 deletions

View File

@ -26,6 +26,7 @@ import java.util.NoSuchElementException;
import java.util.concurrent.ConcurrentHashMap;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import org.kurento.client.KurentoConnectionListener;
import org.slf4j.Logger;
@ -197,4 +198,12 @@ public abstract class KmsManager {
}
}
@PreDestroy
public void close() {
log.info("Closing all KurentoClients");
this.kmss.values().forEach(kms -> {
kms.getKurentoClient().destroy();
});
}
}