use of org.fourthline.cling.UpnpServiceImpl in project SmartApplianceEnabler by camueller.
the class SempDiscovery method run.
public void run() {
try {
final ExecutorService executorService = Executors.newSingleThreadExecutor();
final UpnpService upnpService = new UpnpServiceImpl(serviceConfiguration);
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
upnpService.shutdown();
}
});
// Add the bound local device to the registry
upnpService.getRegistry().addDevice(createDevice());
} catch (Exception ex) {
System.err.println("Exception occured: " + ex);
ex.printStackTrace(System.err);
System.exit(1);
}
}
use of org.fourthline.cling.UpnpServiceImpl in project libresonic by Libresonic.
the class UPnPService method createService.
private synchronized void createService() throws Exception {
upnpService = new UpnpServiceImpl(new ApacheUpnpServiceConfiguration());
// Asynch search for other devices (most importantly UPnP-enabled routers for port-mapping)
upnpService.getControlPoint().search();
// Start DLNA media server?
setMediaServerEnabled(settingsService.isDlnaEnabled());
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
System.err.println("Shutting down UPnP service...");
upnpService.shutdown();
System.err.println("Shutting down UPnP service - Done!");
}
});
}
Aggregations