本文整理汇总了Java中org.fourthline.cling.registry.Registry类的典型用法代码示例。如果您正苦于以下问题:Java Registry类的具体用法?Java Registry怎么用?Java Registry使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Registry类属于org.fourthline.cling.registry包,在下文中一共展示了Registry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: remoteDeviceRemoved
import org.fourthline.cling.registry.Registry; //导入依赖的package包/类
@Override
public void remoteDeviceRemoved(Registry registry, RemoteDevice device) {
System.out.println("{UPNP Discovery}:Registry: Remote device removed: "+ device.getDisplayString());
//posting event
HashMap<String, String> properties = new HashMap<String, String>();
properties.put("UpnpEvent", "Device_Removed");
properties.put("UDN", ""+device.getIdentity().getUdn().getIdentifierString());
properties.put("Name", ""+device.getDisplayString());
properties.put("Type", ""+device.getType().getType());
Activator.event = new Event("symphony/event", properties);
//System.out.println("Posting event");
Activator.admin.postEvent(Activator.event);
//removing device from list
deviceArrayList.remove(device);
}
示例2: remoteDeviceDiscoveryFailed
import org.fourthline.cling.registry.Registry; //导入依赖的package包/类
@Override
public void remoteDeviceDiscoveryFailed(Registry registry, final RemoteDevice device,
final Exception ex) {
runOnUiThread(new Runnable() {
public void run() {
Toast.makeText(
BrowserActivity.this,
"Discovery failed of '"
+ device.getDisplayString()
+ "': "
+ (ex != null ? ex.toString()
: "Couldn't retrieve device/service descriptors"),
Toast.LENGTH_LONG).show();
}
});
deviceRemoved(device);
}
示例3: remoteDeviceAdded
import org.fourthline.cling.registry.Registry; //导入依赖的package包/类
@Override
public void remoteDeviceAdded(Registry registry, RemoteDevice device) {
Log.e("DeviceListRegistryListener",
"remoteDeviceAdded:" + device.toString()
+ device.getType().getType());
if (device.getType().getNamespace().equals("schemas-upnp-org")
&& device.getType().getType().equals("MediaServer")) {
final DeviceItem display = new DeviceItem(device, device
.getDetails().getFriendlyName(),
device.getDisplayString(), "(REMOTE) "
+ device.getType().getDisplayString());
deviceAdded(display);
}
if (device.getType().getNamespace().equals("schemas-upnp-org")
&& device.getType().getType().equals("MediaRenderer")) {
final DeviceItem dmrDisplay = new DeviceItem(device, device
.getDetails().getFriendlyName(),
device.getDisplayString(), "(REMOTE) "
+ device.getType().getDisplayString());
dmrAdded(dmrDisplay);
}
}
示例4: makeUpnpService
import org.fourthline.cling.registry.Registry; //导入依赖的package包/类
private UpnpService makeUpnpService() {
return new UpnpServiceImpl(createConfiguration()) {
@Override protected Router createRouter(ProtocolFactory protocolFactory, Registry registry) {
return new AndroidRouter(getConfiguration(), protocolFactory, UpnpServiceService.this);
}
@Override public synchronized void shutdown() {
// First have to remove the receiver, so Android won't complain about it leaking
// when the main UI thread exits.
((AndroidRouter)getRouter()).unregisterBroadcastReceiver();
// Now we can concurrently run the Cling shutdown code, without occupying the
// Android main UI thread. This will complete probably after the main UI thread
// is done.
super.shutdown(true);
}
};
}
示例5: onCreate
import org.fourthline.cling.registry.Registry; //导入依赖的package包/类
/**
* Starts the UPnP service.
*/
@Override
public void onCreate() {
super.onCreate();
upnpService = new UpnpServiceImpl(createConfiguration()) {
@Override
protected Router createRouter(ProtocolFactory protocolFactory, Registry registry) {
return ArchosUpnpServiceImpl.this.createRouter(
getConfiguration(),
protocolFactory,
ArchosUpnpServiceImpl.this
);
}
@Override
public synchronized void shutdown() {
// First have to remove the receiver, so Android won't complain about it leaking
// when the main UI thread exits.
((AndroidRouter)getRouter()).unregisterBroadcastReceiver();
// Now we can concurrently run the Cling shutdown code, without occupying the
// Android main UI thread. This will complete probably after the main UI thread
// is done.
super.shutdown(true);
}
};
}
示例6: localDeviceRemoved
import org.fourthline.cling.registry.Registry; //导入依赖的package包/类
@Override
public void localDeviceRemoved(Registry registry, LocalDevice localdevice) {
Registry currentRegistry = this.getRegistry();
if (localdevice != null && currentRegistry != null) {
Log.d(getClass().getName(), "localDeviceRemoved: " + localdevice.getDisplayString());
this.deviceRemoved(localdevice);
this.getRegistry().removeDevice(localdevice);
}
}
示例7: getRegistry
import org.fourthline.cling.registry.Registry; //导入依赖的package包/类
/**
* Returns the upnp registry
*
* @return the registry
*/
public Registry getRegistry() {
if (!isInitialized()) {
return null;
}
return androidUpnpService.getRegistry();
}
示例8: remoteDeviceAdded
import org.fourthline.cling.registry.Registry; //导入依赖的package包/类
@Override
public void remoteDeviceAdded(Registry registry, RemoteDevice device) {
System.out.println("{UPNP Discovery}:Registry: Remote device added "+ device.getDisplayString() +
" UDN: " + device.getIdentity().getUdn());
boolean duplicity=false;
for (int i=0; i<deviceArrayList.size(); i++){
Device d=deviceArrayList.get(i);
if (device.getIdentity().getUdn().equals(d.getIdentity().getUdn())==true) duplicity=true;
}
// posting event if not duplicate device
if (duplicity==false){
HashMap<String, String> properties = new HashMap<String, String>();
properties.put("UpnpEvent", "Device_Added");
properties.put("UDN", ""+device.getIdentity().getUdn().getIdentifierString());
properties.put("Name", ""+device.getDisplayString());
properties.put("Type", ""+device.getType().getType());
Activator.event = new Event("symphony/event", properties);
//System.out.println("Posting event");
Activator.admin.postEvent(Activator.event);
//adding device
deviceArrayList.add(device);
}
else {
System.out.println("{UPNP Discovery}:Registry: Ignoring duplicate Device_Added event from " + device.getDisplayString());
}
}
示例9: deviceAdded
import org.fourthline.cling.registry.Registry; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
public void deviceAdded(Registry registry, Device device) {
// TODO Auto-generated method stub
Log.d(LOG_TAG, "One device is added."
+ device.getDetails().getFriendlyName());
if (device.hasServices())
refreshDevice(device, true);
}
示例10: deviceRemoved
import org.fourthline.cling.registry.Registry; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
public void deviceRemoved(Registry registry, Device device) {
// TODO Auto-generated method stub
Log.d(LOG_TAG, "One device is removed.");
if (device.hasServices())
refreshDevice(device, false);
}
示例11: remoteDeviceAdded
import org.fourthline.cling.registry.Registry; //导入依赖的package包/类
public void remoteDeviceAdded(Registry registry, RemoteDevice device)
{
if (device.getDetails().getModelDetails().getModelName().contains("hue bridge"))
{
devices.add(new Device(device.getDetails().getBaseURL().toString(),
device.getDetails().getFriendlyName()));
}
}
示例12: remoteDeviceAdded
import org.fourthline.cling.registry.Registry; //导入依赖的package包/类
@Override
public void remoteDeviceAdded(Registry registry, RemoteDevice device) {
super.remoteDeviceAdded(registry, device);
for(IHeartRateDataServiceSenderConnectionListener listener : mICSUpnpServiceConnectionListenerList) {
listener.onDeviceAdded();
}
}
示例13: remoteDeviceAdded
import org.fourthline.cling.registry.Registry; //导入依赖的package包/类
@Override
public void remoteDeviceAdded(Registry registry, RemoteDevice device) {
super.remoteDeviceAdded(registry, device);
for(IWearNotificationServiceSenderConnectionListener listener : mICSUpnpServiceConnectionListenerList) {
listener.onDeviceAdded();
}
}
示例14: beforeShutdown
import org.fourthline.cling.registry.Registry; //导入依赖的package包/类
@Override
public void beforeShutdown(Registry registry) {
registryShutdownEvent.select(new AnnotationLiteral<Before>() {
}).fire(
new RegistryShutdown()
);
}
示例15: deviceRemoved
import org.fourthline.cling.registry.Registry; //导入依赖的package包/类
@Override
synchronized public void deviceRemoved(Registry registry, Device device) {
for (Service service : device.findServices()) {
Iterator<Map.Entry<Service, List<PortMapping>>> it = activePortMappings.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<Service, List<PortMapping>> activeEntry = it.next();
if (!activeEntry.getKey().equals(service)) continue;
if (activeEntry.getValue().size() > 0)
handleFailureMessage("Device disappeared, couldn't delete port mappings: " + activeEntry.getValue().size());
it.remove();
}
}
}