Commit ceacf07d authored by mhellka's avatar mhellka
Browse files

Make RuntimeContext closeable

parent 90520f1a
package de.gwdg.cdstar.runtime;
import java.io.Closeable;
import java.io.IOException;
import java.nio.file.Path;
import java.util.List;
......@@ -12,7 +13,7 @@ import de.gwdg.cdstar.runtime.client.CDStarClient;
import de.gwdg.cdstar.runtime.client.CDStarSession;
import de.gwdg.cdstar.runtime.listener.RuntimeListener;
public interface RuntimeContext {
public interface RuntimeContext extends Closeable {
/**
* Register one of the supported extension interfaces.
......@@ -79,4 +80,7 @@ public interface RuntimeContext {
*/
Subject getSystemUser(String name);
@Override
void close();
}
......@@ -53,6 +53,7 @@ public class JettyServer {
threadPool.setMaxThreads(Math.max(cpus, 2) * 16);
log.debug("Jetty thread pool: {}", threadPool);
server = new Server(threadPool);
server.setStopAtShutdown(true);
final ServletContextHandler context = new ServletContextHandler(server, "/");
context.addLifeCycleListener(new AbstractLifeCycle.AbstractLifeCycleListener() {
......
package de.gwdg.cdstar.runtime;
import java.io.Closeable;
import java.io.IOException;
import java.nio.file.AccessDeniedException;
import java.nio.file.FileAlreadyExistsException;
......@@ -64,7 +63,7 @@ import de.gwdg.cdstar.tm.DiskTransactionManager;
* Chain of ownership: Runtime, Client, Session, Vault, Archive, File
*
*/
public class CDStarRuntime implements RuntimeContext, Closeable {
public class CDStarRuntime implements RuntimeContext {
public static Logger log = LoggerFactory.getLogger(CDStarRuntime.class);
public enum State {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment