org.jclouds.rest.internal
Class InvokeHttpMethod

java.lang.Object
  extended by org.jclouds.rest.internal.InvokeHttpMethod
All Implemented Interfaces:
com.google.common.base.Function<Invocation,Object>

public class InvokeHttpMethod
extends Object
implements com.google.common.base.Function<Invocation,Object>

Author:
Adrian Cole

Method Summary
 Object apply(Invocation in)
           
 boolean equals(Object o)
           
 int hashCode()
           
 Object invoke(Invocation invocation)
          invokes the HttpCommand associated with invocation, parses its response, and applies a fallback if a Throwable is encountered.
 Object invokeWithTimeout(Invocation invocation, long limitNanos)
          calls invoke(Invocation), timing out after the specified time limit.
 com.google.common.util.concurrent.ListenableFuture<?> submit(Invocation invocation)
          submits the HttpCommand associated with invocation, parses its response, and applies a fallback if a Throwable is encountered.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

apply

public Object apply(Invocation in)
Specified by:
apply in interface com.google.common.base.Function<Invocation,Object>

submit

public com.google.common.util.concurrent.ListenableFuture<?> submit(Invocation invocation)
submits the HttpCommand associated with invocation, parses its response, and applies a fallback if a Throwable is encountered. Parsing and Fallback occur on the userExecutor thread.


invoke

public Object invoke(Invocation invocation)
invokes the HttpCommand associated with invocation, parses its response, and applies a fallback if a Throwable is encountered.


invokeWithTimeout

public Object invokeWithTimeout(Invocation invocation,
                                long limitNanos)
calls invoke(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 an UncheckedTimeoutException to the caller.

Parameters:
invocation - the Invocation to invoke via invoke(Invocation)
limitNanos - with timeoutUnit, the maximum length of time to wait in nanoseconds
Throws:
InterruptedException - if our thread is interrupted during execution
com.google.common.util.concurrent.UncheckedTimeoutException - if the time limit is reached
See Also:
TimeLimiter.callWithTimeout(Callable, long, TimeUnit, boolean)

equals

public boolean equals(Object o)
Specified by:
equals in interface com.google.common.base.Function<Invocation,Object>
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009-2013 jclouds. All Rights Reserved.