Skip to content
Snippets Groups Projects
Commit c78b32e3 authored by Felix Sidokhine's avatar Felix Sidokhine
Browse files

investigating java-ass problem

parent 7ed153c6
No related branches found
No related tags found
No related merge requests found
...@@ -136,4 +136,12 @@ public class JamsCA implements CertificateAuthority { ...@@ -136,4 +136,12 @@ public class JamsCA implements CertificateAuthority {
public X509Certificate getCA() { public X509Certificate getCA() {
return CA.getCertificate(); return CA.getCertificate();
} }
@Override
public boolean shutdownThreads() {
//Unsafe but acceptable.
crlWorker.stop();
ocspWorker.stop();
return true;
}
} }
...@@ -44,5 +44,6 @@ public interface CertificateAuthority { ...@@ -44,5 +44,6 @@ public interface CertificateAuthority {
String getLatestCRLPEMEncoded(); String getLatestCRLPEMEncoded();
OCSPResp getOCSPResponse(OCSPReq ocspRequest); OCSPResp getOCSPResponse(OCSPReq ocspRequest);
X509Certificate getCA(); X509Certificate getCA();
boolean shutdownThreads();
} }
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
package net.jami.jams.server.core; package net.jami.jams.server.core;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.jami.jams.ca.JamsCA;
import net.jami.jams.server.Server;
import org.apache.catalina.WebResourceRoot; import org.apache.catalina.WebResourceRoot;
import org.apache.catalina.connector.Connector; import org.apache.catalina.connector.Connector;
import org.apache.catalina.core.StandardContext; import org.apache.catalina.core.StandardContext;
...@@ -39,6 +41,8 @@ import java.net.URI; ...@@ -39,6 +41,8 @@ import java.net.URI;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Paths; import java.nio.file.Paths;
import static net.jami.jams.server.Server.certificateAuthority;
//This class boots the tomcat server which provides the subsystem //This class boots the tomcat server which provides the subsystem
//for the API calls. //for the API calls.
@Slf4j @Slf4j
...@@ -116,8 +120,10 @@ public class TomcatLauncher { ...@@ -116,8 +120,10 @@ public class TomcatLauncher {
public void stopTomcat() { public void stopTomcat() {
try { try {
synchronized (tomcat) { synchronized (tomcat) {
certificateAuthority.shutdownThreads();
tomcat.stop(); tomcat.stop();
tomcat.destroy(); tomcat.destroy();
context.destroy();
} }
} catch (Exception e) { } catch (Exception e) {
log.info("Failed to stop tomcat server with error {}", e.getMessage()); log.info("Failed to stop tomcat server with error {}", e.getMessage());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment