Package org.matt1.climediarenderer

Source Code of org.matt1.climediarenderer.ApacheServiceConfiguration

package org.matt1.climediarenderer;

import org.fourthline.cling.DefaultUpnpServiceConfiguration;
import org.fourthline.cling.transport.impl.apache.StreamClientConfigurationImpl;
import org.fourthline.cling.transport.impl.apache.StreamClientImpl;
import org.fourthline.cling.transport.impl.apache.StreamServerConfigurationImpl;
import org.fourthline.cling.transport.impl.apache.StreamServerImpl;
import org.fourthline.cling.transport.spi.NetworkAddressFactory;
import org.fourthline.cling.transport.spi.StreamClient;
import org.fourthline.cling.transport.spi.StreamServer;

/**
* Configuration to use Apache instead of JRE-based HTTP.  Needed for things that don't support
* the built-in HTTP, like OpenJDK on ARM.
*
* @author Matt
*
*/
@SuppressWarnings("rawtypes")
public class ApacheServiceConfiguration extends DefaultUpnpServiceConfiguration {

  @Override
    public StreamClient createStreamClient() {
        return new StreamClientImpl(new StreamClientConfigurationImpl());
    }

    @Override
    public StreamServer createStreamServer(NetworkAddressFactory networkAddressFactory) {
        return new StreamServerImpl(
                new StreamServerConfigurationImpl(
                        networkAddressFactory.getStreamListenPort()
                )
        );
    }

}
TOP

Related Classes of org.matt1.climediarenderer.ApacheServiceConfiguration

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.