comparison src/goodjava/lucene/backup/BackupServer.java @ 1502:8a7b6b32c691

minor threads
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 10 May 2020 22:48:15 -0600
parents e66e3d50b289
children d80395468b4e
comparison
equal deleted inserted replaced
1501:e66e3d50b289 1502:8a7b6b32c691
3 import java.io.File; 3 import java.io.File;
4 import java.io.IOException; 4 import java.io.IOException;
5 import java.util.Map; 5 import java.util.Map;
6 import java.net.Socket; 6 import java.net.Socket;
7 import java.net.ServerSocket; 7 import java.net.ServerSocket;
8 import java.util.concurrent.ThreadPoolExecutor;
9 import java.util.concurrent.Executors; 8 import java.util.concurrent.Executors;
9 import java.util.concurrent.ExecutorService;
10 import javax.net.ssl.SSLServerSocketFactory; 10 import javax.net.ssl.SSLServerSocketFactory;
11 import javax.net.ssl.SSLServerSocket; 11 import javax.net.ssl.SSLServerSocket;
12 import goodjava.util.SoftCacheMap; 12 import goodjava.util.SoftCacheMap;
13 import goodjava.io.IoUtils; 13 import goodjava.io.IoUtils;
14 import goodjava.rpc.RpcServer; 14 import goodjava.rpc.RpcServer;
37 static { 37 static {
38 cipherSuites = null; // for now, until I figure out disgusting java security 38 cipherSuites = null; // for now, until I figure out disgusting java security
39 } 39 }
40 40
41 private final File backupDir; 41 private final File backupDir;
42 private static final ThreadPoolExecutor threadPool = (ThreadPoolExecutor)Executors.newCachedThreadPool(); 42 private static final ExecutorService threadPool = Executors.newCachedThreadPool();
43 private static final Map<String,Backup> backups = new SoftCacheMap<String,Backup>(); 43 private static final Map<String,Backup> backups = new SoftCacheMap<String,Backup>();
44 44
45 public BackupServer(File backupDir) throws IOException { 45 public BackupServer(File backupDir) throws IOException {
46 this.backupDir = backupDir; 46 this.backupDir = backupDir;
47 IoUtils.mkdirs(backupDir); 47 IoUtils.mkdirs(backupDir);