org.glassfish.jersey.client.spi
Interface Connector

All Superinterfaces:
Inflector<ClientRequest,ClientResponse>
All Known Implementing Classes:
HttpUrlConnector

public interface Connector
extends Inflector<ClientRequest,ClientResponse>

Client transport connector contract.

Author:
Marek Potociar (marek.potociar at oracle.com)

Method Summary
 ClientResponse apply(ClientRequest request)
          Synchronously process client request into a response.
 java.util.concurrent.Future<?> apply(ClientRequest request, AsyncConnectorCallback callback)
          Asynchronously process client request into a response.
 void close()
          Close connector and release all it's internally associated resources.
 

Method Detail

apply

ClientResponse apply(ClientRequest request)
                     throws ClientException
Synchronously process client request into a response. The method is used by Jersey client runtime to synchronously send a request and receive a response.

Specified by:
apply in interface Inflector<ClientRequest,ClientResponse>
Parameters:
request - Jersey client request to be sent.
Returns:
Jersey client response received for the client request.
Throws:
ClientException - in case of any invocation failure.

apply

java.util.concurrent.Future<?> apply(ClientRequest request,
                                     AsyncConnectorCallback callback)
Asynchronously process client request into a response. The method is used by Jersey client runtime to asynchronously send a request and receive a response.

Parameters:
request - Jersey client request to be sent.
callback - Jersey asynchronous connector callback to asynchronously receive the request processing result (either a response or a failure).
Returns:
asynchronously executed task handle.

close

void close()
Close connector and release all it's internally associated resources.



Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.