本文整理汇总了Java中org.fourthline.cling.model.ValidationException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java ValidationException.printStackTrace方法的具体用法?Java ValidationException.printStackTrace怎么用?Java ValidationException.printStackTrace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.fourthline.cling.model.ValidationException
的用法示例。
在下文中一共展示了ValidationException.printStackTrace方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import org.fourthline.cling.model.ValidationException; //导入方法依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
//Create LocalDevice
LocalService localService = new AnnotationLocalServiceBinder().read(BeyondContentDirectoryService.class);
localService.setManager(new DefaultServiceManager<>(
localService, BeyondContentDirectoryService.class));
String macAddress = Utils.getMACAddress(Utils.WLAN0);
//Generate UUID by MAC address
UDN udn = UDN.valueOf(UUID.nameUUIDFromBytes(macAddress.getBytes()).toString());
try {
mLocalDevice = new LocalDevice(new DeviceIdentity(udn), new UDADeviceType("MediaServer"),
new DeviceDetails("Local Media Server"), new LocalService[]{localService});
} catch (ValidationException e) {
e.printStackTrace();
}
upnpService.getRegistry().addDevice(mLocalDevice);
//LocalBinder instead of binder
binder = new LocalBinder();
}
示例2: MediaRenderer
import org.fourthline.cling.model.ValidationException; //导入方法依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
public MediaRenderer(final Context context) {
DeviceType type = new UDADeviceType(UpnpUtils.DMR, UpnpUtils.VERSION);
DeviceDetails details = new DeviceDetails(
UpnpUtils.DMR_NAME + "(" + android.os.Build.MODEL + ")",
new ManufacturerDetails(UpnpUtils.MANUFACTURER,
UpnpUtils.MANUFACTURER_URL),
new ModelDetails(UpnpUtils.DMR_MODEL_NAME,
UpnpUtils.DMR_MODEL_DESCRIPTION, UpnpUtils.MODEL_NUMBER));
LocalServiceBinder binder = new AnnotationLocalServiceBinder();
LocalService<ConnectionService> connectionManagerService = binder
.read(ConnectionService.class);
ServiceManager<ConnectionService> connectionManager = new DefaultServiceManager<ConnectionService>(
connectionManagerService, ConnectionService.class);
connectionManagerService.setManager(connectionManager);
LocalService<AvtransportService> avtransportService = binder
.read(AvtransportService.class);
mAVtransportServiceManager = new LastChangeAwareServiceManager<AvtransportService>(
avtransportService, new AVTransportLastChangeParser()) {
@Override
protected AvtransportService createServiceInstance()
throws Exception {
return new AvtransportService(context, mAVTransportLastChange);
}
@Override
protected int getLockTimeoutMillis() {
return TIME_OUT;
}
};
avtransportService.setManager(mAVtransportServiceManager);
LocalService<RenderingControlService> renderercontrolService = binder
.read(RenderingControlService.class);
mRenderercontrolServiceManager = new LastChangeAwareServiceManager<RenderingControlService>(
renderercontrolService, new RenderingControlLastChangeParser()) {
@Override
protected RenderingControlService createServiceInstance()
throws Exception {
return new RenderingControlService(context,
mRendererControlLastChange);
}
@Override
protected int getLockTimeoutMillis() {
return TIME_OUT;
}
};
renderercontrolService.setManager(mRenderercontrolServiceManager);
try {
LocalService serviceList[] = { connectionManagerService,
avtransportService, renderercontrolService };
mLocalDevice = new LocalDevice(new DeviceIdentity(UpnpUtils.R_UDN),
type, details,
new Icon[] { createDefaultDeviceIcon(context) },
serviceList);
} catch (ValidationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}