static synchronized LauncherServer getOrCreateServer() throws IOException { LauncherServer server; do { server = serverInstance != null ? serverInstance : new LauncherServer(); } while (!server.running); server.ref(); serverInstance = server; return server; }
static synchronized LauncherServer getOrCreateServer() throws IOException { LauncherServer server; do { server = serverInstance != null ? serverInstance : new LauncherServer(); } while (!server.running); server.ref(); serverInstance = server; return server; }
/** * Creates a handle for an app to be launched. This method will start a server if one hasn't been * started yet. The server is shared for multiple handles, and once all handles are disposed of, * the server is shut down. */ static synchronized ChildProcAppHandle newAppHandle() throws IOException { LauncherServer server = serverInstance != null ? serverInstance : new LauncherServer(); server.ref(); serverInstance = server; String secret = server.createSecret(); while (server.pending.containsKey(secret)) { secret = server.createSecret(); } return server.newAppHandle(secret); }
/** * Creates a handle for an app to be launched. This method will start a server if one hasn't been * started yet. The server is shared for multiple handles, and once all handles are disposed of, * the server is shut down. */ static synchronized ChildProcAppHandle newAppHandle() throws IOException { LauncherServer server = serverInstance != null ? serverInstance : new LauncherServer(); server.ref(); serverInstance = server; String secret = server.createSecret(); while (server.pending.containsKey(secret)) { secret = server.createSecret(); } return server.newAppHandle(secret); }