本文整理了Java中fr.velossity.sample.device.Device.getType()
方法的一些代码示例,展示了Device.getType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Device.getType()
方法的具体详情如下:
包路径:fr.velossity.sample.device.Device
类名称:Device
方法名:getType
暂无
代码示例来源:origin: fr.velossity.osgi/ServiceProvider
/**
* @see BundleActivator#start(BundleContext)
*/
public void start(BundleContext context) throws Exception {
// Set meta-data properties for the device
Dictionary<String, String> properties = new Hashtable<String, String>();
properties.put("type", myDevice.getType());
// PUBLISHES the Device service
context.registerService(Device.class, myDevice, properties);
}
代码示例来源:origin: fr.velossity.osgi/ServiceProvider2
/**
* @see BundleActivator#start(BundleContext)
*/
public void start(BundleContext context) throws Exception {
// Set meta-data properties for the device
Dictionary<String, String> properties = new Hashtable<String, String>();
properties.put(Device.DEVICE_PROPERTY_IDENTIFIER, myDevice.getIdentifier());
properties.put(Device.DEVICE_PROPERTY_TYPE, myDevice.getType());
// PUBLISHES the Device service
context.registerService(Device.class, myDevice, properties);
}
代码示例来源:origin: fr.velossity.osgi/ServiceProvider1
/**
* @see BundleActivator#start(BundleContext)
*/
public void start(BundleContext context) throws Exception {
// Set meta-data properties for the device
Dictionary<String, String> properties = new Hashtable<String, String>();
properties.put(Device.DEVICE_PROPERTY_IDENTIFIER, myDevice.getIdentifier());
properties.put(Device.DEVICE_PROPERTY_TYPE, myDevice.getType());
// PUBLISHES the Device service
context.registerService(Device.class, myDevice, properties);
}
代码示例来源:origin: fr.velossity.osgi/NativeAdapter
/**
* @see ServiceTracker#addingService(ServiceReference)
*/
public ServiceRegistration<Device> addingService(ServiceReference<AdapteeDevice> ref) {
AdapteeDevice adaptee = context.getService(ref);
Device adapter = new DeviceAdapterImpl(adaptee);
// REGISTERS with mandatory properties
Dictionary<String, String> properties = new Hashtable<String, String>();
properties.put(Device.DEVICE_PROPERTY_IDENTIFIER, adapter.getIdentifier());
properties.put(Device.DEVICE_PROPERTY_TYPE, adapter.getType());
return context.registerService(Device.class, adapter, properties);
}
内容来源于网络,如有侵权,请联系作者删除!