本文整理匯總了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));
}