本文整理汇总了Java中org.teleal.cling.model.types.UDADeviceType类的典型用法代码示例。如果您正苦于以下问题:Java UDADeviceType类的具体用法?Java UDADeviceType怎么用?Java UDADeviceType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UDADeviceType类属于org.teleal.cling.model.types包,在下文中一共展示了UDADeviceType类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: searchDevices
import org.teleal.cling.model.types.UDADeviceType; //导入依赖的package包/类
public void searchDevices(final OnSearchDeviceCallback callback) {
if (ActionHandler.isAlive())
ActionHandler.getHandler().post(new Runnable() {
@Override
public void run() {
if (service == null) {
service = ServiceManager.getService();
}
service.getRegistry().addListener(listener);
DeviceManager.this.callback = callback;
UDADeviceType udaType = new UDADeviceType("MediaRenderer");
service.getControlPoint().search(
new UDADeviceTypeHeader(udaType));
}
});
}
示例2: createDevice
import org.teleal.cling.model.types.UDADeviceType; //导入依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
public LocalDevice createDevice() throws ValidationException,
LocalServiceBindingException {
DeviceType type = new UDADeviceType("MediaServer", 1);
DeviceDetails details = new DeviceDetails("MediaServer v1",
new ManufacturerDetails("XXXXX��˾", "http://www.idaoben.com/"),
new ModelDetails("MediaServer v1", "A simple media server.",
"v1"));
LocalService contentDirectory = new AnnotationLocalServiceBinder()
.read(ContentDirectory.class);
contentDirectory
.setManager(new DefaultServiceManager<ContentDirectory>(
contentDirectory, null) {
@Override
protected ContentDirectory createServiceInstance()
throws Exception {
return new ContentDirectory();
}
});
LocalService connectionManager = new AnnotationLocalServiceBinder()
.read(ConnectionManagerService.class);
connectionManager
.setManager(new DefaultServiceManager<ConnectionManagerService>(
connectionManager, ConnectionManagerService.class));
return new LocalDevice(new DeviceIdentity(udn), type, details,
createDefaultDeviceIcon(), new LocalService[] {
connectionManager, contentDirectory });
}
示例3: createDevice
import org.teleal.cling.model.types.UDADeviceType; //导入依赖的package包/类
LocalDevice createDevice()
throws ValidationException, LocalServiceBindingException, IOException {
DeviceIdentity identity =
new DeviceIdentity(
UDN.uniqueSystemIdentifier("CMU Cloudlet Server")
);
DeviceType type =
new UDADeviceType("CloudletServer", 1);
DeviceDetails details =
new DeviceDetails(
"CMU Cloudlet Service",
new ManufacturerDetails("CMU"),
new ModelDetails(
"Cloudlet V1.0",
"A Demo Cloudlet Server",
"v1"
)
);
// Icon icon =new Icon( "image/png", 48, 48, 8, getClass().getResource("icon.png"));
LocalService<GabrielService> gabrielService = new AnnotationLocalServiceBinder().read(GabrielService.class);
gabrielService.setManager(
new DefaultServiceManager(gabrielService, GabrielService.class)
);
return new LocalDevice(identity, type, details, gabrielService);
/* Several services can be bound to the same device:
return new LocalDevice(
identity, type, details, icon,
new LocalService[] {switchPowerService, myOtherService}
);
*/
}
示例4: remoteDeviceAdded
import org.teleal.cling.model.types.UDADeviceType; //导入依赖的package包/类
@Override
public void remoteDeviceAdded(Registry registry, final RemoteDevice device) {
if (device.findDevices(new UDADeviceType("MediaRenderer")).length > 0) {
logger.log(Level.INFO, "Adding remote device: " + device.getDetails().getFriendlyName() + "UUID: " + device.getIdentity().getUdn().toString());
final DeviceListItem deviceItem = adaptDevice(device);
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
listModel.addElement(deviceItem);
}
});
}
}
示例5: refreshDevices
import org.teleal.cling.model.types.UDADeviceType; //导入依赖的package包/类
@Override
public void refreshDevices() {
UDADeviceType deviceType = new UDADeviceType ("MediaRenderer");
controlPoint.search(new UDADeviceTypeHeader(deviceType));
}