package hu.u_szeged.nbo.server.threads;
import hu.u_szeged.nbo.server.NBOServer;
import java.rmi.registry.LocateRegistry;
import javax.rmi.ssl.SslRMIClientSocketFactory;
import javax.rmi.ssl.SslRMIServerSocketFactory;
public class SSLRMIRegistry extends Thread {
public void run() {
try {
// Start RMI registry on port 43000
LocateRegistry.createRegistry(43000,
new SslRMIClientSocketFactory(),
new SslRMIServerSocketFactory(null, null, true));
NBOServer.log("RMI REGISTRY running on port 43000", 1);
NBOServer.setSslRmiRegistryIsAlive(true);
//Sleep forever
Thread.sleep(Long.MAX_VALUE);
} catch (Exception e) {
NBOServer.log("EXCEPTION while creating RMI registry! Terminating.\n", 2);
e.printStackTrace();
System.exit(0);
}
}
}