/** * Returns a new Promise that has been resolved with the specified failure. * * @param <T> The value type associated with the returned Promise. * @param failure The failure of the resolved Promise. Must not be * {@code null}. * @return A new Promise which uses the default callback executor and * default scheduled executor that has been resolved with the * specified failure. * @see PromiseFactory#failed(Throwable) */ public static <T> Promise<T> failed(Throwable failure) { return defaultFactory.failed(failure); }
/** * Returns a new Promise that has been resolved with the specified failure. * * @param <T> The value type associated with the returned Promise. * @param failure The failure of the resolved Promise. Must not be * {@code null}. * @return A new Promise which uses the default callback executor and * default scheduled executor that has been resolved with the * specified failure. * @see PromiseFactory#failed(Throwable) */ public static <T> Promise<T> failed(Throwable failure) { return defaultFactory.failed(failure); }
/** * Returns a new Promise that has been resolved with the specified failure. * * @param <T> The value type associated with the returned Promise. * @param failure The failure of the resolved Promise. Must not be * {@code null}. * @return A new Promise which uses the default callback executor and * default scheduled executor that has been resolved with the * specified failure. * @see PromiseFactory#failed(Throwable) */ public static <T> Promise<T> failed(Throwable failure) { return defaultFactory.failed(failure); }
/** * Returns a new Promise that has been resolved with the specified failure. * * @param <T> The value type associated with the returned Promise. * @param failure The failure of the resolved Promise. Must not be * {@code null}. * @return A new Promise which uses the default callback executor and * default scheduled executor that has been resolved with the * specified failure. * @see PromiseFactory#failed(Throwable) */ public static <T> Promise<T> failed(Throwable failure) { return defaultFactory.failed(failure); }
/** * Returns a new Promise that has been resolved with the specified failure. * * @param <T> The value type associated with the returned Promise. * @param failure The failure of the resolved Promise. Must not be * {@code null}. * @return A new Promise which uses the default callback executor and * default scheduled executor that has been resolved with the * specified failure. * @see PromiseFactory#failed(Throwable) */ public static <T> Promise<T> failed(Throwable failure) { return defaultFactory.failed(failure); }
/** * Returns a new Promise that has been resolved with the specified failure. * * @param <T> The value type associated with the returned Promise. * @param failure The failure of the resolved Promise. Must not be * {@code null}. * @return A new Promise which uses the default callback executor and * default scheduled executor that has been resolved with the * specified failure. * @see PromiseFactory#failed(Throwable) */ public static <T> Promise<T> failed(Throwable failure) { return defaultFactory.failed(failure); }
/** * Returns a new Promise that has been resolved with the specified failure. * * @param <T> The value type associated with the returned Promise. * @param failure The failure of the resolved Promise. Must not be * {@code null}. * @return A new Promise which uses the default callback executor and * default scheduled executor that has been resolved with the * specified failure. * @see PromiseFactory#failed(Throwable) */ public static <T> Promise<T> failed(Throwable failure) { return defaultFactory.failed(failure); }
private Promise<Void> closedConnectPromise() { return promiseFactory.failed(new IllegalStateException( "This SimplePushEventSource is closed")); }
private Promise<Void> closedConnectPromise() { return promiseFactory.failed(new IllegalStateException( "This SimplePushEventSource is closed")); }
private Promise<Void> closedConnectPromise() { return promiseFactory.failed(new IllegalStateException( "This SimplePushEventSource is closed")); }
public Promise<T> async(URI uri) { try { return async(uri.toURL()); } catch (MalformedURLException e) { return client.promiseFactory() .failed(e); } }
public Promise<T> async(URI uri) { try { return async(uri.toURL()); } catch (MalformedURLException e) { return client.promiseFactory() .failed(e); } }
private Promise<List<Artifact>> getArtifacts(Set<URI> cycles, URI uri) { if (!cycles.add(uri)) { return promiseFactory.resolved(Collections.emptyList()); } try { String type = uri.getPath(); logger.info("getArtifacts type={}", uri); if (type.endsWith("/compositeArtifacts.xml")) { return parseCompositeArtifacts(cycles, hideAndSeek(uri), uri); } else if (type.endsWith("/artifacts.xml.xz")) { return parseArtifacts(hideAndSeek(uri), uri); } else if (type.endsWith("/artifacts.xml")) { return parseArtifacts(hideAndSeek(uri), uri); } else if (type.endsWith("/p2.index")) { return parseIndexArtifacts(cycles, uri); } uri = normalize(uri).resolve("p2.index"); defaults.add(uri); return parseIndexArtifacts(cycles, uri); } catch (Exception e) { logger.error("getArtifacts", e); return promiseFactory.failed(e); } }
private Promise<List<Artifact>> getArtifacts(Set<URI> cycles, URI uri) { if (!cycles.add(uri)) { return promiseFactory.resolved(Collections.emptyList()); } try { String type = uri.getPath(); logger.info("getArtifacts type={}", uri); if (type.endsWith("/compositeArtifacts.xml")) { return parseCompositeArtifacts(cycles, hideAndSeek(uri), uri); } else if (type.endsWith("/artifacts.xml.xz")) { return parseArtifacts(hideAndSeek(uri), uri); } else if (type.endsWith("/artifacts.xml")) { return parseArtifacts(hideAndSeek(uri), uri); } else if (type.endsWith("/p2.index")) { return parseIndexArtifacts(cycles, uri); } uri = normalize(uri).resolve("p2.index"); defaults.add(uri); return parseIndexArtifacts(cycles, uri); } catch (Exception e) { logger.error("getArtifacts", e); return promiseFactory.failed(e); } }