/** * invokes the {@linkplain HttpCommand} associated with {@code invocation}, * {@link #getTransformer(String, HttpCommand) parses its response}, and * applies a {@link #getFallback(String, Invocation, HttpCommand) fallback} * if a {@code Throwable} is encountered. */ public Object invoke(Invocation invocation) { String commandName = config.getCommandName(invocation); HttpCommand command = toCommand(commandName, invocation); Function<HttpResponse, ?> transformer = getTransformer(commandName, command); org.jclouds.Fallback<?> fallback = getFallback(commandName, invocation, command); logger.debug(">> invoking %s", commandName); try { return transformer.apply(http.invoke(command)); } catch (Throwable t) { try { return fallback.createOrPropagate(t); } catch (Exception e) { throw propagate(e); } } }
/** * invokes the {@linkplain HttpCommand} associated with {@code invocation}, * {@link #getTransformer(String, HttpCommand) parses its response}, and * applies a {@link #getFallback(String, Invocation, HttpCommand) fallback} * if a {@code Throwable} is encountered. */ public Object invoke(Invocation invocation) { String commandName = config.getCommandName(invocation); HttpCommand command = toCommand(commandName, invocation); Function<HttpResponse, ?> transformer = getTransformer(commandName, command); org.jclouds.Fallback<?> fallback = getFallback(commandName, invocation, command); logger.debug(">> invoking %s", commandName); try { return transformer.apply(http.invoke(command)); } catch (Throwable t) { try { return fallback.createOrPropagate(t); } catch (Exception e) { throw propagate(e); } } }
/** * submits the {@linkplain HttpCommand} associated with {@code invocation}, * {@link #getTransformer(String, HttpCommand) parses its response}, and * applies a {@link #getFallback(String, Invocation, HttpCommand) fallback} * if a {@code Throwable} is encountered. Parsing and Fallback occur on the * {@code userExecutor} thread. */ public ListenableFuture<?> submit(Invocation invocation) { String commandName = config.getCommandName(invocation); HttpCommand command = toCommand(commandName, invocation); Function<HttpResponse, ?> transformer = getTransformer(commandName, command); org.jclouds.Fallback<?> fallback = getFallback(commandName, invocation, command); logger.debug(">> submitting %s", commandName); return withFallback(transform(http.submit(command), transformer, userExecutor), fallback); }
/** * submits the {@linkplain HttpCommand} associated with {@code invocation}, * {@link #getTransformer(String, HttpCommand) parses its response}, and * applies a {@link #getFallback(String, Invocation, HttpCommand) fallback} * if a {@code Throwable} is encountered. Parsing and Fallback occur on the * {@code userExecutor} thread. */ public ListenableFuture<?> submit(Invocation invocation) { String commandName = config.getCommandName(invocation); HttpCommand command = toCommand(commandName, invocation); Function<HttpResponse, ?> transformer = getTransformer(commandName, command); org.jclouds.Fallback<?> fallback = getFallback(commandName, invocation, command); logger.debug(">> submitting %s", commandName); return withFallback(transform(http.submit(command), transformer, userExecutor), fallback); }
/** * invokes the {@linkplain HttpCommand} associated with {@code invocation}, * {@link #getTransformer(String, HttpCommand) parses its response}, and * applies a {@link #getFallback(String, Invocation, HttpCommand) fallback} * if a {@code Throwable} is encountered. */ public Object invoke(Invocation invocation) { String commandName = config.getCommandName(invocation); HttpCommand command = toCommand(commandName, invocation); Function<HttpResponse, ?> transformer = getTransformer(commandName, command); org.jclouds.Fallback<?> fallback = getFallback(commandName, invocation, command); logger.debug(">> invoking %s", commandName); try { return transformer.apply(http.invoke(command)); } catch (Throwable t) { try { return fallback.createOrPropagate(t); } catch (Exception e) { throw propagate(e); } } }
/** * submits the {@linkplain HttpCommand} associated with {@code invocation}, * {@link #getTransformer(String, HttpCommand) parses its response}, and * applies a {@link #getFallback(String, Invocation, HttpCommand) fallback} * if a {@code Throwable} is encountered. Parsing and Fallback occur on the * {@code userExecutor} thread. */ public ListenableFuture<?> submit(Invocation invocation) { String commandName = config.getCommandName(invocation); HttpCommand command = toCommand(commandName, invocation); Function<HttpResponse, ?> transformer = getTransformer(commandName, command); org.jclouds.Fallback<?> fallback = getFallback(commandName, invocation, command); logger.debug(">> submitting %s", commandName); return withFallback(transform(http.submit(command), transformer, userExecutor), fallback); }
HttpCommand command = toCommand(commandName, invocation); org.jclouds.Fallback<?> fallback = getFallback(commandName, invocation, command);
HttpCommand command = toCommand(commandName, invocation); org.jclouds.Fallback<?> fallback = getFallback(commandName, invocation, command);
HttpCommand command = toCommand(commandName, invocation); org.jclouds.Fallback<?> fallback = getFallback(commandName, invocation, command);