org.jclouds.http
Class TransformingHttpCommandExecutorServiceImpl

java.lang.Object
  extended by org.jclouds.http.TransformingHttpCommandExecutorServiceImpl
All Implemented Interfaces:
TransformingHttpCommandExecutorService

public class TransformingHttpCommandExecutorServiceImpl
extends Object
implements TransformingHttpCommandExecutorService

Executor which will invoke and transform the response of an EndpointCommand into generic type . TODO

Author:
Adrian Cole

Constructor Summary
TransformingHttpCommandExecutorServiceImpl(HttpCommandExecutorService client, ExecutorService userThreads)
           
 
Method Summary
<T,R extends HttpRequest>
com.google.common.util.concurrent.ListenableFuture<T>
submit(HttpCommand command, com.google.common.base.Function<HttpResponse,T> responseTransformer)
          Submits the command and transforms the result before requested via Future.get().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransformingHttpCommandExecutorServiceImpl

@Inject
public TransformingHttpCommandExecutorServiceImpl(HttpCommandExecutorService client,
                                                         @Named(value="jclouds.user-threads")
                                                         ExecutorService userThreads)
Method Detail

submit

public <T,R extends HttpRequest> com.google.common.util.concurrent.ListenableFuture<T> submit(HttpCommand command,
                                                                                              com.google.common.base.Function<HttpResponse,T> responseTransformer)
Submits the command and transforms the result before requested via Future.get().

Specified by:
submit in interface TransformingHttpCommandExecutorService
Type Parameters:
T - type that is required from the value.
Parameters:
command - holds the state of the request, including metadata such as redirect counts
responseTransformer - how to transform the response from the above command
Returns:
value of the intended response.


Copyright © 2009-2011 jclouds. All Rights Reserved.