org.fourthline.cling.transport.impl.jetty
Class StreamClientImpl

java.lang.Object
  extended by org.fourthline.cling.transport.spi.AbstractStreamClient<StreamClientConfigurationImpl,StreamClientImpl.HttpContentExchange>
      extended by org.fourthline.cling.transport.impl.jetty.StreamClientImpl
All Implemented Interfaces:
StreamClient<StreamClientConfigurationImpl>

public class StreamClientImpl
extends AbstractStreamClient<StreamClientConfigurationImpl,StreamClientImpl.HttpContentExchange>

Implementation based on Jetty 8 client API.

This implementation works on Android, dependencies are the jetty-client Maven module.

Author:
Christian Bauer

Nested Class Summary
static class StreamClientImpl.HttpContentExchange
           
 
Field Summary
protected  org.eclipse.jetty.client.HttpClient client
           
protected  StreamClientConfigurationImpl configuration
           
 
Constructor Summary
StreamClientImpl(StreamClientConfigurationImpl configuration)
           
 
Method Summary
protected  void abort(StreamClientImpl.HttpContentExchange exchange)
          Cancel and abort the request immediately, with the proprietary API.
protected  Callable<StreamResponseMessage> createCallable(StreamRequestMessage requestMessage, StreamClientImpl.HttpContentExchange exchange)
          Create a callable procedure that will execute the request.
protected  StreamClientImpl.HttpContentExchange createRequest(StreamRequestMessage requestMessage)
          Create a proprietary representation of this request, log warnings and return null if creation fails.
 StreamClientConfigurationImpl getConfiguration()
           
protected  boolean logExecutionException(Throwable t)
           
 void stop()
          Stops the service, closes any connection pools etc.
 
Methods inherited from class org.fourthline.cling.transport.spi.AbstractStreamClient
onFinally, sendRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

configuration

protected final StreamClientConfigurationImpl configuration

client

protected final org.eclipse.jetty.client.HttpClient client
Constructor Detail

StreamClientImpl

public StreamClientImpl(StreamClientConfigurationImpl configuration)
                 throws InitializationException
Throws:
InitializationException
Method Detail

getConfiguration

public StreamClientConfigurationImpl getConfiguration()
Returns:
This service's configuration.

createRequest

protected StreamClientImpl.HttpContentExchange createRequest(StreamRequestMessage requestMessage)
Description copied from class: AbstractStreamClient
Create a proprietary representation of this request, log warnings and return null if creation fails.

Specified by:
createRequest in class AbstractStreamClient<StreamClientConfigurationImpl,StreamClientImpl.HttpContentExchange>

createCallable

protected Callable<StreamResponseMessage> createCallable(StreamRequestMessage requestMessage,
                                                         StreamClientImpl.HttpContentExchange exchange)
Description copied from class: AbstractStreamClient
Create a callable procedure that will execute the request.

Specified by:
createCallable in class AbstractStreamClient<StreamClientConfigurationImpl,StreamClientImpl.HttpContentExchange>

abort

protected void abort(StreamClientImpl.HttpContentExchange exchange)
Description copied from class: AbstractStreamClient
Cancel and abort the request immediately, with the proprietary API.

Specified by:
abort in class AbstractStreamClient<StreamClientConfigurationImpl,StreamClientImpl.HttpContentExchange>

logExecutionException

protected boolean logExecutionException(Throwable t)
Specified by:
logExecutionException in class AbstractStreamClient<StreamClientConfigurationImpl,StreamClientImpl.HttpContentExchange>
Returns:
true if no more logging of this exception should be done.

stop

public void stop()
Description copied from interface: StreamClient
Stops the service, closes any connection pools etc.



Copyright © 2013 4th Line GmbH, Switzerland. All Rights Reserved.