/** * Registers a handle with the server, and returns the secret the child app needs to connect * back. */ synchronized String registerHandle(AbstractAppHandle handle) { String secret = createSecret(); secretToPendingApps.put(secret, handle); return secret; }
/** * Registers a handle with the server, and returns the secret the child app needs to connect * back. */ synchronized String registerHandle(AbstractAppHandle handle) { String secret = createSecret(); secretToPendingApps.put(secret, handle); return 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); }
/** * 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); }