Package org.jclouds.rest.internal
Class InvokeHttpMethod
- java.lang.Object
-
- org.jclouds.rest.internal.InvokeHttpMethod
-
- All Implemented Interfaces:
com.google.common.base.Function<Invocation,Object>,Function<Invocation,Object>
public class InvokeHttpMethod extends Object implements com.google.common.base.Function<Invocation,Object>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectapply(Invocation in)booleanequals(Object o)inthashCode()Objectinvoke(Invocation invocation)invokes the HttpCommand associated withinvocation,parses its response, and applies afallbackif aThrowableis encountered.ObjectinvokeWithTimeout(Invocation invocation, long limitNanos)callsinvoke(Invocation), timing out after the specified time limit.StringtoString()
-
-
-
Method Detail
-
apply
public Object apply(Invocation in)
- Specified by:
applyin interfacecom.google.common.base.Function<Invocation,Object>- Specified by:
applyin interfaceFunction<Invocation,Object>
-
invoke
public Object invoke(Invocation invocation)
invokes the HttpCommand associated withinvocation,parses its response, and applies afallbackif aThrowableis encountered.
-
invokeWithTimeout
public Object invokeWithTimeout(Invocation invocation, long limitNanos)
callsinvoke(Invocation), timing out after the specified time limit. If the target method call finished before the limit is reached, the return value or exception is propagated to the caller exactly as-is. If, on the other hand, the time limit is reached, we attempt to abort the call to the target, and throw anUncheckedTimeoutExceptionto the caller.- Parameters:
invocation- the Invocation to invoke viainvoke(Invocation)limitNanos- with timeoutUnit, the maximum length of time to wait in nanoseconds- Throws:
InterruptedException- if our thread is interrupted during executionUncheckedTimeoutException- if the time limit is reached- See Also:
TimeLimiter.callWithTimeout(Callable, long, TimeUnit)
-
equals
public boolean equals(Object o)
- Specified by:
equalsin interfacecom.google.common.base.Function<Invocation,Object>- Overrides:
equalsin classObject
-
-