src/main/java/org/embulk/executor/remoteserver/EmbulkServer.java in embulk-executor-remoteserver-0.1.1 vs src/main/java/org/embulk/executor/remoteserver/EmbulkServer.java in embulk-executor-remoteserver-0.2.0
- old
+ new
@@ -5,23 +5,23 @@
import java.io.IOException;
public class EmbulkServer implements AutoCloseable {
private SocketServer server;
- EmbulkServer(SocketServer server) {
+ private EmbulkServer(SocketServer server) {
this.server = server;
}
static EmbulkServer start(String host, int port, int numOfWorkers) throws IOException {
SocketServer server = new SocketServer();
- SessionManager sessionManager = new SessionManager();
+ ServerSessionRegistry sessionRegistry = new ServerSessionRegistry();
server.setHost(host);
server.setPort(port);
server.setDefaultContentBufferSize(4 * 1024 * 1024); // 4MB
server.setNumOfWorkers(numOfWorkers);
- server.registerSyncCommand(new InitializeSessionCommand(sessionManager));
- server.registerSyncCommand(new RemoveSessionCommand(sessionManager));
- server.registerCommand(new StartTaskCommand(sessionManager));
+ server.registerSyncCommand(new InitializeSessionCommand(sessionRegistry));
+ server.registerSyncCommand(new RemoveSessionCommand(sessionRegistry));
+ server.registerCommand(new StartTaskCommand(sessionRegistry));
server.start();
return new EmbulkServer(server);
}
@Override