当前位置: 首页>>代码示例>>Java>>正文


Java Registry类代码示例

本文整理汇总了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);	
}
 
开发者ID:SyMPHOnY-,项目名称:Smart-Home-Gateway,代码行数:18,代码来源:UpnpServiceHandler.java

示例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);
}
 
开发者ID:offbye,项目名称:DroidDLNA,代码行数:18,代码来源:BrowserActivity.java

示例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);
	}
}
 
开发者ID:offbye,项目名称:DroidDLNA,代码行数:25,代码来源:DevicesActivity.java

示例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);
        }
    };
}
 
开发者ID:OpenSilk,项目名称:Orpheus,代码行数:18,代码来源:UpnpServiceService.java

示例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);
        }
    };
}
 
开发者ID:archos-sa,项目名称:aos-MediaLib,代码行数:32,代码来源:ArchosUpnpServiceImpl.java

示例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);
    }
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:10,代码来源:UpnpClient.java

示例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();
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:12,代码来源:UpnpClient.java

示例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());
	}
	

}
 
开发者ID:SyMPHOnY-,项目名称:Smart-Home-Gateway,代码行数:36,代码来源:UpnpServiceHandler.java

示例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);
}
 
开发者ID:sky24987,项目名称:UPlayer,代码行数:10,代码来源:DeviceRegistryListener.java

示例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);
}
 
开发者ID:sky24987,项目名称:UPlayer,代码行数:9,代码来源:DeviceRegistryListener.java

示例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()));
  }
}
 
开发者ID:thht,项目名称:ambilike,代码行数:9,代码来源:HueDiscover.java

示例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();
    }
}
 
开发者ID:mklschreiber,项目名称:Crowdi,代码行数:9,代码来源:HeartRateDataServiceSenderConnection.java

示例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();
    }
}
 
开发者ID:mklschreiber,项目名称:Crowdi,代码行数:9,代码来源:WearNotificationServiceSenderConnection.java

示例14: beforeShutdown

import org.fourthline.cling.registry.Registry; //导入依赖的package包/类
@Override
public void beforeShutdown(Registry registry) {
    registryShutdownEvent.select(new AnnotationLiteral<Before>() {
    }).fire(
            new RegistryShutdown()
    );
}
 
开发者ID:offbye,项目名称:DroidDLNA,代码行数:8,代码来源:ManagedUpnpService.java

示例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();
        }
    }
}
 
开发者ID:offbye,项目名称:DroidDLNA,代码行数:16,代码来源:PortMappingListener.java


注:本文中的org.fourthline.cling.registry.Registry类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。