/** * Impersonates as the given user to start a guava service * * @param user user to impersonate * @param service guava service start start */ public static void startAsUser(String user, final Service service) throws IOException, InterruptedException { runAsUser(user, new Callable<ListenableFuture<Service.State>>() { @Override public ListenableFuture<Service.State> call() throws Exception { return service.start(); } }); }
/** * Impersonates as the given user to start a guava service * * @param user user to impersonate * @param service guava service start start */ public static void startAsUser(String user, final Service service) throws IOException, InterruptedException { runAsUser(user, new Callable<ListenableFuture<Service.State>>() { @Override public ListenableFuture<Service.State> call() throws Exception { return service.start(); } }); }