public <R> RequestExecution asyncDelete(final Callback<OperationResult, R> callback) { final JerseyRequest request = getBuilder(Object.class); RequestExecution task = new RequestExecution( new Runnable() { @Override public void run() { callback.execute(request.delete()); } }); ThreadPoolUtil.runAsynchronously(task); return task; }
public <R> RequestExecution asyncSearch( final Callback<OperationResult<ClientResourceListWrapper>, R> callback) { final JerseyRequest<ClientResourceListWrapper> request = getBuilder(ClientResourceListWrapper.class); RequestExecution task = new RequestExecution( new Runnable() { @Override public void run() { callback.execute(request.get()); } }); ThreadPoolUtil.runAsynchronously(task); return task; }