Package org.matt1.climediarenderer

Source Code of org.matt1.climediarenderer.MediaRenderer

package org.matt1.climediarenderer;

import java.util.logging.Level;
import java.util.logging.Logger;

import org.fourthline.cling.UpnpServiceImpl;
import org.matt1.climediarenderer.services.CliMediaRenderer;
import org.matt1.climediarenderer.utils.PropertyHelper;

/**
* Main entry class.  All it does it setup the UPnP service, create a new instane of the
* main class and start it up.
*
* @author Matt
*
*/
public class MediaRenderer {

    public static void main(final String[] args) throws Exception {

      configureLogging();
     
      try {
        CliMediaRenderer mediaRenderer = new CliMediaRenderer(PropertyHelper.getInstance().getName());
 
        UpnpServiceImpl upnp = new UpnpServiceImpl(new ApacheServiceConfiguration());
       
        upnp.getRegistry().addDevice(
                  mediaRenderer.getDevice()
          );
      } catch (Exception e) {
        Logger.getLogger(MediaRenderer.class.getName()).severe("Unexpected error starting up: " + e.getMessage());
      }

    }

    /**
     * Setup logging level to hide all the noise from Cling
     */
    private static void configureLogging() {
      Logger.getLogger("org.fourthline").setLevel(Level.OFF);
    }
}
TOP

Related Classes of org.matt1.climediarenderer.MediaRenderer

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.